blob: 6570bb7e4eab590827e2fe7e67bf33cb8de6f292 [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
34 tree funcitonal 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)
41 #. There must not be an external user/consumer of tempest that depends on the
42 test proposed for removal
43
44The answers to 1 and 2 are easy to verify. For 1 just provide a link to the new
45test location. If you are linking to the tempest removal patch please also put
46a Depends-On in the commit message for the commit which moved the test into
47another repo.
48
49For prong 2 you can use OpenStack-Health:
50
51Using OpenStack-Health
52""""""""""""""""""""""
53
54Go to: http://status.openstack.org/openstack-health and then navigate to a per
55test page for six months. You'll end up with a page that will graph the success
56and failure rates on the bottom graph. For example, something like `this URL`_.
57
58.. _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
59
60The Old Way using subunit2sql directly
61""""""""""""""""""""""""""""""""""""""
62
63SELECT * from tests where test_id like "%test_id%";
64(where $test_id is the full test_id, but truncated to the class because of
65setupclass or teardownclass failures)
66
67You can access the infra mysql subunit2sql db w/ read-only permissions with:
68
69 * hostname: logstash.openstack.org
70 * username: query
71 * password: query
72 * db_name: subunit2sql
73
74For example if you were trying to remove the test with the id:
75tempest.api.compute.admin.test_flavors_negative.FlavorsAdminNegativeTestJSON.test_get_flavor_details_for_deleted_flavor
76you would run the following:
77
78 #. run: "mysql -u query -p -h logstash.openstack.org subunit2sql" to connect
79 to the subunit2sql db
80 #. run the query: MySQL [subunit2sql]> select * from tests where test_id like
81 "tempest.api.compute.admin.test_flavors_negative.FlavorsAdminNegativeTestJSON%";
82 which will return a table of all the tests in the class (but it will also
83 catch failures in setupClass and tearDownClass)
84 #. paste the output table with numbers and the mysql command you ran to
85 generate it into the etherpad.
86
87Eventually a cli interface will be created to make that a bit more friendly.
88Also a dashboard is in the works so we don't need to manually run the command.
89
90The intent of the 2nd prong is to verify that moving the test into a project
91specific testing is preventing bugs (assuming the tempest tests were catching
92issues) from bubbling up a layer into tempest jobs. If we're seeing failure
93rates above a certain threshold in the gate checks that means the functional
94testing isn't really being effective in catching that bug (and therefore
95blocking it from landing) and having the testing run in tempest still has
96value.
97
98However for the 3rd prong verification is a bit more subjective. The original
99intent of this prong was mostly for refstack/defcore and also for things that
100running on the stable branches. We don't want to remove any tests if that
101would break our api consistency checking between releases, or something that
102defcore/refstack is depending on being in tempest. It's worth pointing out
103that if a test is used in defcore as part of interop testing then it will
104probably have continuing value being in tempest as part of the
105integration/integrated tests in general. This is one area where some overlap
106is expected between testing in projects and tempest, which is not a bad thing.
107
108Discussing the 3rd prong
109""""""""""""""""""""""""
110
111There are 2 approaches to addressing the 3rd prong. Either it can be raised
112during a qa meeting during the tempest discussion. Please put it on the agenda
113well ahead of the scheduled meeting. Since the meeting time will be well known
114ahead of time anyone who depends on the tests will have ample time beforehand
115to outline any concerns on the before the meeting. To give ample time for
116people to respond to removal proposals please add things to the agend by the
117Monday before the meeting.
118
119The other option is to raise the removal on the openstack-dev mailing list.
120(for example see: http://lists.openstack.org/pipermail/openstack-dev/2016-February/086218.html )
121This will raise the issue to the wider community and attract at least the same
122(most likely more) attention than discussing it during the irc meeting. The
123only downside is that it might take more time to get a response, given the
124nature of ML.
125
126Exceptions to this procedure
127----------------------------
128
129For the most part all tempest test removals have to go through this procedure
130there are a couple of exceptions though:
131
132 #. The class of testing has been decided to be outside the scope of tempest.
133 #. A revert for a patch which added a broken test, or testing which didn't
134 actually run in the gate (basically any revert for something which
135 shouldn't have been added)
136
137For the first exception type the only types of testing in tree which have been
138declared out of scope at this point are:
139
140 * The CLI tests (which should be completely removed at this point)
141 * Neutron Adv. Services testing (which should be completely removed at this
142 point)
143 * XML API Tests (which should be completely removed at this point)
144 * EC2 API/boto tests (which should be completely removed at this point)
145
146For tests that fit into this category the only criteria for removal is that
147there is equivalent testing elsewhere.
148
149Tempest Scope
150^^^^^^^^^^^^^
151
152Also starting in the liberty cycle tempest has defined a set of projects which
153are defined as in scope for direct testing in tempest. As of today that list
154is:
155
156 * Keystone
157 * Nova
158 * Glance
159 * Cinder
160 * Neutron
161 * Swift
162
163anything that lives in tempest which doesn't test one of these projects can be
164removed assuming there is equivalent testing elsewhere. Preferably using the
165`tempest plugin mechanism`_
166to mantain continuity after migrating the tests out of tempest
167
168.. _tempest plugin mechanism: http://docs.openstack.org/developer/tempest/plugin.html