blob: d06e4ba412dc90010bd012a402c856dce15a97fa [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
32 #. 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
Masayuki Igawaa8d3cae2016-07-11 18:59:23 +090034 tree functional test suite). For API tests preferably the other project will
Masayuki Igawab8532432016-06-22 17:02:06 +090035 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
42 .. _`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
65SELECT * from tests where test_id like "%test_id%";
66(where $test_id is the full test_id, but truncated to the class because of
Ken'ichi Ohmichi4d8ba232017-03-03 18:28:05 -080067setUpClass 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
71 * hostname: logstash.openstack.org
72 * username: query
73 * password: query
74 * db_name: subunit2sql
75
76For example if you were trying to remove the test with the id:
77tempest.api.compute.admin.test_flavors_negative.FlavorsAdminNegativeTestJSON.test_get_flavor_details_for_deleted_flavor
78you would run the following:
79
80 #. run: "mysql -u query -p -h logstash.openstack.org subunit2sql" to connect
81 to the subunit2sql db
82 #. run the query: MySQL [subunit2sql]> select * from tests where test_id like
83 "tempest.api.compute.admin.test_flavors_negative.FlavorsAdminNegativeTestJSON%";
84 which will return a table of all the tests in the class (but it will also
Ken'ichi Ohmichi4d8ba232017-03-03 18:28:05 -080085 catch failures in setUpClass and tearDownClass)
Masayuki Igawab8532432016-06-22 17:02:06 +090086 #. paste the output table with numbers and the mysql command you ran to
87 generate it into the etherpad.
88
89Eventually a cli interface will be created to make that a bit more friendly.
90Also a dashboard is in the works so we don't need to manually run the command.
91
92The intent of the 2nd prong is to verify that moving the test into a project
93specific testing is preventing bugs (assuming the tempest tests were catching
94issues) from bubbling up a layer into tempest jobs. If we're seeing failure
95rates above a certain threshold in the gate checks that means the functional
96testing isn't really being effective in catching that bug (and therefore
97blocking it from landing) and having the testing run in tempest still has
98value.
99
100However for the 3rd prong verification is a bit more subjective. The original
101intent of this prong was mostly for refstack/defcore and also for things that
102running on the stable branches. We don't want to remove any tests if that
103would break our api consistency checking between releases, or something that
104defcore/refstack is depending on being in tempest. It's worth pointing out
105that if a test is used in defcore as part of interop testing then it will
106probably have continuing value being in tempest as part of the
107integration/integrated tests in general. This is one area where some overlap
108is expected between testing in projects and tempest, which is not a bad thing.
109
110Discussing the 3rd prong
111""""""""""""""""""""""""
112
113There are 2 approaches to addressing the 3rd prong. Either it can be raised
114during a qa meeting during the tempest discussion. Please put it on the agenda
115well ahead of the scheduled meeting. Since the meeting time will be well known
116ahead of time anyone who depends on the tests will have ample time beforehand
117to outline any concerns on the before the meeting. To give ample time for
Masayuki Igawaa8d3cae2016-07-11 18:59:23 +0900118people to respond to removal proposals please add things to the agenda by the
Masayuki Igawab8532432016-06-22 17:02:06 +0900119Monday before the meeting.
120
121The other option is to raise the removal on the openstack-dev mailing list.
122(for example see: http://lists.openstack.org/pipermail/openstack-dev/2016-February/086218.html )
123This will raise the issue to the wider community and attract at least the same
124(most likely more) attention than discussing it during the irc meeting. The
125only downside is that it might take more time to get a response, given the
126nature of ML.
127
128Exceptions to this procedure
129----------------------------
130
131For the most part all tempest test removals have to go through this procedure
132there are a couple of exceptions though:
133
134 #. The class of testing has been decided to be outside the scope of tempest.
135 #. A revert for a patch which added a broken test, or testing which didn't
136 actually run in the gate (basically any revert for something which
137 shouldn't have been added)
Andrea Frittolib2005552017-02-23 07:40:29 -0500138 #. Tests that would become out of scope as a consequence of an API change,
139 as described in `API Compatibility`_.
140 Such tests cannot live in Tempest because of the branchless nature of
141 Tempest. Such test must still honor `prong #3`_.
Masayuki Igawab8532432016-06-22 17:02:06 +0900142
143For the first exception type the only types of testing in tree which have been
144declared out of scope at this point are:
145
146 * The CLI tests (which should be completely removed at this point)
147 * Neutron Adv. Services testing (which should be completely removed at this
148 point)
149 * XML API Tests (which should be completely removed at this point)
150 * EC2 API/boto tests (which should be completely removed at this point)
151
152For tests that fit into this category the only criteria for removal is that
153there is equivalent testing elsewhere.
154
155Tempest Scope
156^^^^^^^^^^^^^
157
Andrea Frittolib2005552017-02-23 07:40:29 -0500158Starting in the liberty cycle tempest has defined a set of projects which
Masayuki Igawab8532432016-06-22 17:02:06 +0900159are defined as in scope for direct testing in tempest. As of today that list
160is:
161
162 * Keystone
163 * Nova
164 * Glance
165 * Cinder
166 * Neutron
167 * Swift
168
169anything that lives in tempest which doesn't test one of these projects can be
170removed assuming there is equivalent testing elsewhere. Preferably using the
171`tempest plugin mechanism`_
Masayuki Igawaa8d3cae2016-07-11 18:59:23 +0900172to maintain continuity after migrating the tests out of tempest.
Masayuki Igawab8532432016-06-22 17:02:06 +0900173
174.. _tempest plugin mechanism: http://docs.openstack.org/developer/tempest/plugin.html
Andrea Frittolib2005552017-02-23 07:40:29 -0500175
176API Compatibility
177"""""""""""""""""
178
179If an API introduces a non-discoverable, backward incompatible change, and
180such change is not backported to all versions supported by Tempest, tests for
181that API cannot live in Tempest anymore.
182This is because tests would not be able to know or control which API response
183to expect, and thus would not be able to enforce a specific behavior.
184
185If a test exists in Tempest that would meet this criteria as consequence of a
186change, the test must be removed according to the procedure discussed into
187this document. The API change should not be merged until all conditions
Ken'ichi Ohmichi4d8ba232017-03-03 18:28:05 -0800188required for test removal can be met.