blob: ddae6e2ab7dd85cc0876222f617a8e1f115d1e06 [file] [log] [blame]
Masayuki Igawab8532432016-06-22 17:02:06 +09001Tempest Test Removal Procedure
2==============================
3
4Historically tempest was the only way of doing functional testing and
5integration testing in OpenStack. This was mostly only an artifact of tempest
6being the only proven pattern for doing this, not an artifact of a design
7decision. However, moving forward as functional testing is being spun up in
8each individual project we really only want tempest to be the integration test
9suite it was intended to be; testing the high level interactions between
10projects through REST API requests. In this model there are probably existing
11tests that aren't the best fit living in tempest. However, since tempest is
12largely still the only gating test suite in this space we can't carelessly rip
13out everything from the tree. This document outlines the procedure which was
14developed to ensure we minimize the risk for removing something of value from
15the tempest tree.
16
17This procedure might seem overly conservative and slow paced, but this is by
18design to try and ensure we don't remove something that is actually providing
19value. Having potential duplication between testing is not a big deal
20especially compared to the alternative of removing something which is actually
21providing value and is actively catching bugs, or blocking incorrect patches
22from landing.
23
24Proposing a test removal
25------------------------
26
273 prong rule for removal
28^^^^^^^^^^^^^^^^^^^^^^^^
29
30In the proposal etherpad we'll be looking for answers to 3 questions
31
Masayuki Igawab78b9232017-11-17 16:12:37 +090032#. The tests proposed for removal must have equiv. coverage in a different
33 project's test suite (whether this is another gating test project, or an in
34 tree functional test suite). For API tests preferably the other project will
35 have a similar source of friction in place to prevent breaking api changes
36 so that we don't regress and let breaking api changes slip through the
37 gate.
38#. The test proposed for removal has a failure rate < 0.50% in the gate over
39 the past release (the value and interval will likely be adjusted in the
40 future)
Andrea Frittolib2005552017-02-23 07:40:29 -050041
Masayuki Igawab78b9232017-11-17 16:12:37 +090042 .. _`prong #3`:
43#. There must not be an external user/consumer of tempest
44 that depends on the test proposed for removal
Masayuki Igawab8532432016-06-22 17:02:06 +090045
46The answers to 1 and 2 are easy to verify. For 1 just provide a link to the new
47test location. If you are linking to the tempest removal patch please also put
48a Depends-On in the commit message for the commit which moved the test into
49another repo.
50
51For prong 2 you can use OpenStack-Health:
52
53Using OpenStack-Health
54""""""""""""""""""""""
55
56Go to: http://status.openstack.org/openstack-health and then navigate to a per
57test page for six months. You'll end up with a page that will graph the success
58and failure rates on the bottom graph. For example, something like `this URL`_.
59
60.. _this URL: http://status.openstack.org/openstack-health/#/test/tempest.scenario.test_volume_boot_pattern.TestVolumeBootPatternV2.test_volume_boot_pattern?groupKey=project&resolutionKey=day&duration=P6M
61
62The Old Way using subunit2sql directly
63""""""""""""""""""""""""""""""""""""""
64
Masayuki Igawabbbaad62017-11-21 16:04:03 +090065``SELECT * from tests where test_id like "%test_id%";``
66(where ``$test_id`` is the full test_id, but truncated to the class because of
67``setUpClass`` or ``tearDownClass`` failures)
Masayuki Igawab8532432016-06-22 17:02:06 +090068
69You can access the infra mysql subunit2sql db w/ read-only permissions with:
70
Masayuki Igawab78b9232017-11-17 16:12:37 +090071* hostname: logstash.openstack.org
72* username: query
73* password: query
74* db_name: subunit2sql
Masayuki Igawab8532432016-06-22 17:02:06 +090075
76For example if you were trying to remove the test with the id:
Masayuki Igawabbbaad62017-11-21 16:04:03 +090077``tempest.api.compute.admin.test_flavors_negative.FlavorsAdminNegativeTestJSON.test_get_flavor_details_for_deleted_flavor``
Masayuki Igawab8532432016-06-22 17:02:06 +090078you would run the following:
79
Masayuki Igawabbbaad62017-11-21 16:04:03 +090080#. run the command: ``mysql -u query -p -h logstash.openstack.org subunit2sql``
81 to connect to the subunit2sql db
82#. run the query:
83
84 .. code-block:: console
85
86 MySQL [subunit2sql]> select * from tests where test_id like \
87 "tempest.api.compute.admin.test_flavors_negative.FlavorsAdminNegativeTestJSON%";
88
Masayuki Igawab78b9232017-11-17 16:12:37 +090089 which will return a table of all the tests in the class (but it will also
Masayuki Igawabbbaad62017-11-21 16:04:03 +090090 catch failures in ``setUpClass`` and ``tearDownClass``)
Masayuki Igawab78b9232017-11-17 16:12:37 +090091#. paste the output table with numbers and the mysql command you ran to
92 generate it into the etherpad.
Masayuki Igawab8532432016-06-22 17:02:06 +090093
94Eventually a cli interface will be created to make that a bit more friendly.
95Also a dashboard is in the works so we don't need to manually run the command.
96
97The intent of the 2nd prong is to verify that moving the test into a project
98specific testing is preventing bugs (assuming the tempest tests were catching
99issues) from bubbling up a layer into tempest jobs. If we're seeing failure
100rates above a certain threshold in the gate checks that means the functional
101testing isn't really being effective in catching that bug (and therefore
102blocking it from landing) and having the testing run in tempest still has
103value.
104
105However for the 3rd prong verification is a bit more subjective. The original
106intent of this prong was mostly for refstack/defcore and also for things that
107running on the stable branches. We don't want to remove any tests if that
108would break our api consistency checking between releases, or something that
109defcore/refstack is depending on being in tempest. It's worth pointing out
110that if a test is used in defcore as part of interop testing then it will
111probably have continuing value being in tempest as part of the
112integration/integrated tests in general. This is one area where some overlap
113is expected between testing in projects and tempest, which is not a bad thing.
114
115Discussing the 3rd prong
116""""""""""""""""""""""""
117
118There are 2 approaches to addressing the 3rd prong. Either it can be raised
119during a qa meeting during the tempest discussion. Please put it on the agenda
120well ahead of the scheduled meeting. Since the meeting time will be well known
121ahead of time anyone who depends on the tests will have ample time beforehand
122to outline any concerns on the before the meeting. To give ample time for
Masayuki Igawaa8d3cae2016-07-11 18:59:23 +0900123people to respond to removal proposals please add things to the agenda by the
Masayuki Igawab8532432016-06-22 17:02:06 +0900124Monday before the meeting.
125
126The other option is to raise the removal on the openstack-dev mailing list.
127(for example see: http://lists.openstack.org/pipermail/openstack-dev/2016-February/086218.html )
128This will raise the issue to the wider community and attract at least the same
129(most likely more) attention than discussing it during the irc meeting. The
130only downside is that it might take more time to get a response, given the
131nature of ML.
132
133Exceptions to this procedure
134----------------------------
135
136For the most part all tempest test removals have to go through this procedure
137there are a couple of exceptions though:
138
Masayuki Igawab78b9232017-11-17 16:12:37 +0900139#. The class of testing has been decided to be outside the scope of tempest.
140#. A revert for a patch which added a broken test, or testing which didn't
141 actually run in the gate (basically any revert for something which
142 shouldn't have been added)
143#. Tests that would become out of scope as a consequence of an API change,
144 as described in `API Compatibility`_.
145 Such tests cannot live in Tempest because of the branchless nature of
146 Tempest. Such test must still honor `prong #3`_.
Masayuki Igawab8532432016-06-22 17:02:06 +0900147
148For the first exception type the only types of testing in tree which have been
149declared out of scope at this point are:
150
Masayuki Igawab78b9232017-11-17 16:12:37 +0900151* The CLI tests (which should be completely removed at this point)
152* Neutron Adv. Services testing (which should be completely removed at this
153 point)
154* XML API Tests (which should be completely removed at this point)
155* EC2 API/boto tests (which should be completely removed at this point)
Masayuki Igawab8532432016-06-22 17:02:06 +0900156
157For tests that fit into this category the only criteria for removal is that
158there is equivalent testing elsewhere.
159
160Tempest Scope
161^^^^^^^^^^^^^
162
Andrea Frittolib2005552017-02-23 07:40:29 -0500163Starting in the liberty cycle tempest has defined a set of projects which
Masayuki Igawab8532432016-06-22 17:02:06 +0900164are defined as in scope for direct testing in tempest. As of today that list
165is:
166
Masayuki Igawab78b9232017-11-17 16:12:37 +0900167* Keystone
168* Nova
169* Glance
170* Cinder
171* Neutron
172* Swift
Masayuki Igawab8532432016-06-22 17:02:06 +0900173
174anything that lives in tempest which doesn't test one of these projects can be
175removed assuming there is equivalent testing elsewhere. Preferably using the
176`tempest plugin mechanism`_
Masayuki Igawaa8d3cae2016-07-11 18:59:23 +0900177to maintain continuity after migrating the tests out of tempest.
Masayuki Igawab8532432016-06-22 17:02:06 +0900178
chenxinge98720a2017-07-19 03:42:23 +0000179.. _tempest plugin mechanism: https://docs.openstack.org/tempest/latest/plugin.html
Andrea Frittolib2005552017-02-23 07:40:29 -0500180
181API Compatibility
182"""""""""""""""""
183
184If an API introduces a non-discoverable, backward incompatible change, and
185such change is not backported to all versions supported by Tempest, tests for
186that API cannot live in Tempest anymore.
187This is because tests would not be able to know or control which API response
188to expect, and thus would not be able to enforce a specific behavior.
189
190If a test exists in Tempest that would meet this criteria as consequence of a
191change, the test must be removed according to the procedure discussed into
192this document. The API change should not be merged until all conditions
Ken'ichi Ohmichi4d8ba232017-03-03 18:28:05 -0800193required for test removal can be met.