blob: ff4fa092929c256ab192eefc4a7bb1317e92b648 [file] [log] [blame]
Felipe Monteirof89ab812018-07-10 20:34:02 -04001.. _test-removal:
2
Masayuki Igawab8532432016-06-22 17:02:06 +09003Tempest Test Removal Procedure
4==============================
5
Felipe Monteiroc384bc42018-07-10 20:14:04 -04006Historically, Tempest was the only way of doing functional testing and
7integration testing in OpenStack. This was mostly only an artifact of Tempest
Masayuki Igawab8532432016-06-22 17:02:06 +09008being the only proven pattern for doing this, not an artifact of a design
Felipe Monteiroc384bc42018-07-10 20:14:04 -04009decision. However, moving forward, as functional testing is being spun up in
10each individual project, we really only want Tempest to be the integration test
11suite it was intended to be: testing the high-level interactions between
12projects through REST API requests. In this model, there are probably existing
13tests that aren't the best fit living in Tempest. However, since Tempest is
Masayuki Igawab8532432016-06-22 17:02:06 +090014largely still the only gating test suite in this space we can't carelessly rip
15out everything from the tree. This document outlines the procedure which was
16developed to ensure we minimize the risk for removing something of value from
Felipe Monteiroc384bc42018-07-10 20:14:04 -040017the Tempest tree.
Masayuki Igawab8532432016-06-22 17:02:06 +090018
Felipe Monteiroc384bc42018-07-10 20:14:04 -040019This procedure might seem overly conservative and slow-paced, but this is by
20design to try to ensure we don't remove something that is actually providing
Masayuki Igawab8532432016-06-22 17:02:06 +090021value. Having potential duplication between testing is not a big deal
22especially compared to the alternative of removing something which is actually
23providing value and is actively catching bugs, or blocking incorrect patches
24from landing.
25
26Proposing a test removal
27------------------------
28
293 prong rule for removal
30^^^^^^^^^^^^^^^^^^^^^^^^
31
Felipe Monteiroc384bc42018-07-10 20:14:04 -040032In the proposal etherpad we'll be looking for answers to 3 questions:
Masayuki Igawab8532432016-06-22 17:02:06 +090033
Masayuki Igawab78b9232017-11-17 16:12:37 +090034#. The tests proposed for removal must have equiv. coverage in a different
35 project's test suite (whether this is another gating test project, or an in
36 tree functional test suite). For API tests preferably the other project will
Felipe Monteiroc384bc42018-07-10 20:14:04 -040037 have a similar source of friction in place to prevent breaking API changes
38 so that we don't regress and let breaking API changes slip through the
Masayuki Igawab78b9232017-11-17 16:12:37 +090039 gate.
40#. The test proposed for removal has a failure rate < 0.50% in the gate over
41 the past release (the value and interval will likely be adjusted in the
42 future)
Andrea Frittolib2005552017-02-23 07:40:29 -050043
Masayuki Igawab78b9232017-11-17 16:12:37 +090044 .. _`prong #3`:
Felipe Monteiroc384bc42018-07-10 20:14:04 -040045#. There must not be an external user/consumer of Tempest
Masayuki Igawab78b9232017-11-17 16:12:37 +090046 that depends on the test proposed for removal
Masayuki Igawab8532432016-06-22 17:02:06 +090047
48The answers to 1 and 2 are easy to verify. For 1 just provide a link to the new
Felipe Monteiroc384bc42018-07-10 20:14:04 -040049test location. If you are linking to the Tempest removal patch please also put
Masayuki Igawab8532432016-06-22 17:02:06 +090050a Depends-On in the commit message for the commit which moved the test into
51another repo.
52
53For prong 2 you can use OpenStack-Health:
54
55Using OpenStack-Health
56""""""""""""""""""""""
57
58Go to: http://status.openstack.org/openstack-health and then navigate to a per
59test page for six months. You'll end up with a page that will graph the success
60and failure rates on the bottom graph. For example, something like `this URL`_.
61
62.. _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
63
64The Old Way using subunit2sql directly
65""""""""""""""""""""""""""""""""""""""
66
Masayuki Igawabbbaad62017-11-21 16:04:03 +090067``SELECT * from tests where test_id like "%test_id%";``
68(where ``$test_id`` is the full test_id, but truncated to the class because of
69``setUpClass`` or ``tearDownClass`` failures)
Masayuki Igawab8532432016-06-22 17:02:06 +090070
71You can access the infra mysql subunit2sql db w/ read-only permissions with:
72
Masayuki Igawab78b9232017-11-17 16:12:37 +090073* hostname: logstash.openstack.org
74* username: query
75* password: query
76* db_name: subunit2sql
Masayuki Igawab8532432016-06-22 17:02:06 +090077
78For example if you were trying to remove the test with the id:
Masayuki Igawabbbaad62017-11-21 16:04:03 +090079``tempest.api.compute.admin.test_flavors_negative.FlavorsAdminNegativeTestJSON.test_get_flavor_details_for_deleted_flavor``
Masayuki Igawab8532432016-06-22 17:02:06 +090080you would run the following:
81
Masayuki Igawabbbaad62017-11-21 16:04:03 +090082#. run the command: ``mysql -u query -p -h logstash.openstack.org subunit2sql``
83 to connect to the subunit2sql db
84#. run the query:
85
86 .. code-block:: console
87
88 MySQL [subunit2sql]> select * from tests where test_id like \
89 "tempest.api.compute.admin.test_flavors_negative.FlavorsAdminNegativeTestJSON%";
90
Masayuki Igawab78b9232017-11-17 16:12:37 +090091 which will return a table of all the tests in the class (but it will also
Masayuki Igawabbbaad62017-11-21 16:04:03 +090092 catch failures in ``setUpClass`` and ``tearDownClass``)
Masayuki Igawab78b9232017-11-17 16:12:37 +090093#. paste the output table with numbers and the mysql command you ran to
94 generate it into the etherpad.
Masayuki Igawab8532432016-06-22 17:02:06 +090095
deepak_mouryae495cd22018-07-16 12:38:17 +053096Eventually, a CLI interface will be created to make that a bit more friendly.
Masayuki Igawab8532432016-06-22 17:02:06 +090097Also a dashboard is in the works so we don't need to manually run the command.
98
99The intent of the 2nd prong is to verify that moving the test into a project
Felipe Monteiroc384bc42018-07-10 20:14:04 -0400100specific testing is preventing bugs (assuming the Tempest tests were catching
101issues) from bubbling up a layer into Tempest jobs. If we're seeing failure
Masayuki Igawab8532432016-06-22 17:02:06 +0900102rates above a certain threshold in the gate checks that means the functional
103testing isn't really being effective in catching that bug (and therefore
Felipe Monteiroc384bc42018-07-10 20:14:04 -0400104blocking it from landing) and having the testing run in Tempest still has
Masayuki Igawab8532432016-06-22 17:02:06 +0900105value.
106
deepak_mouryae495cd22018-07-16 12:38:17 +0530107However, for the 3rd prong verification is a bit more subjective. The original
Masayuki Igawab8532432016-06-22 17:02:06 +0900108intent of this prong was mostly for refstack/defcore and also for things that
109running on the stable branches. We don't want to remove any tests if that
Felipe Monteiroc384bc42018-07-10 20:14:04 -0400110would break our API consistency checking between releases, or something that
111defcore/refstack is depending on being in Tempest. It's worth pointing out
Felipe Monteirof89ab812018-07-10 20:34:02 -0400112that if a test is used in `defcore`_ as part of `interop`_ testing then it will
Felipe Monteiroc384bc42018-07-10 20:14:04 -0400113probably have continuing value being in Tempest as part of the
Masayuki Igawab8532432016-06-22 17:02:06 +0900114integration/integrated tests in general. This is one area where some overlap
Felipe Monteiroc384bc42018-07-10 20:14:04 -0400115is expected between testing in projects and Tempest, which is not a bad thing.
Masayuki Igawab8532432016-06-22 17:02:06 +0900116
Felipe Monteirof89ab812018-07-10 20:34:02 -0400117.. _defcore: https://wiki.openstack.org/wiki/Governance/InteropWG
118.. _interop: https://www.openstack.org/brand/interop
119
Masayuki Igawab8532432016-06-22 17:02:06 +0900120Discussing the 3rd prong
121""""""""""""""""""""""""
122
123There are 2 approaches to addressing the 3rd prong. Either it can be raised
Felipe Monteirof89ab812018-07-10 20:34:02 -0400124during a QA meeting during the Tempest discussion. Please put it on the agenda
Masayuki Igawab8532432016-06-22 17:02:06 +0900125well ahead of the scheduled meeting. Since the meeting time will be well known
126ahead of time anyone who depends on the tests will have ample time beforehand
127to outline any concerns on the before the meeting. To give ample time for
Masayuki Igawaa8d3cae2016-07-11 18:59:23 +0900128people to respond to removal proposals please add things to the agenda by the
Masayuki Igawab8532432016-06-22 17:02:06 +0900129Monday before the meeting.
130
ghanshyam59a93d12019-03-07 17:25:29 +0000131The other option is to raise the removal on the openstack-discuss mailing list.
132(for example see: http://lists.openstack.org/pipermail/openstack-dev/2016-February/086218.html
133or http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003574.html )
Masayuki Igawab8532432016-06-22 17:02:06 +0900134This will raise the issue to the wider community and attract at least the same
135(most likely more) attention than discussing it during the irc meeting. The
136only downside is that it might take more time to get a response, given the
137nature of ML.
138
139Exceptions to this procedure
140----------------------------
141
deepak_mouryae495cd22018-07-16 12:38:17 +0530142For the most part, all Tempest test removals have to go through this procedure
Masayuki Igawab8532432016-06-22 17:02:06 +0900143there are a couple of exceptions though:
144
Felipe Monteiroc384bc42018-07-10 20:14:04 -0400145#. The class of testing has been decided to be outside the scope of Tempest.
Masayuki Igawab78b9232017-11-17 16:12:37 +0900146#. A revert for a patch which added a broken test, or testing which didn't
147 actually run in the gate (basically any revert for something which
148 shouldn't have been added)
149#. Tests that would become out of scope as a consequence of an API change,
150 as described in `API Compatibility`_.
151 Such tests cannot live in Tempest because of the branchless nature of
Felipe Monteiroc384bc42018-07-10 20:14:04 -0400152 Tempest. Such tests must still honor `prong #3`_.
Masayuki Igawab8532432016-06-22 17:02:06 +0900153
deepak_mouryae495cd22018-07-16 12:38:17 +0530154For the first exception type, the only types of testing in the tree which have been
Masayuki Igawab8532432016-06-22 17:02:06 +0900155declared out of scope at this point are:
156
Masayuki Igawab78b9232017-11-17 16:12:37 +0900157* The CLI tests (which should be completely removed at this point)
158* Neutron Adv. Services testing (which should be completely removed at this
159 point)
160* XML API Tests (which should be completely removed at this point)
161* EC2 API/boto tests (which should be completely removed at this point)
Masayuki Igawab8532432016-06-22 17:02:06 +0900162
deepak_mouryae495cd22018-07-16 12:38:17 +0530163For tests that fit into this category, the only criteria for removal is that
Masayuki Igawab8532432016-06-22 17:02:06 +0900164there is equivalent testing elsewhere.
165
166Tempest Scope
167^^^^^^^^^^^^^
168
Felipe Monteiroc384bc42018-07-10 20:14:04 -0400169Starting in the liberty cycle Tempest, has defined a set of projects which
170are defined as in scope for direct testing in Tempest. As of today that list
Masayuki Igawab8532432016-06-22 17:02:06 +0900171is:
172
Masayuki Igawab78b9232017-11-17 16:12:37 +0900173* Keystone
174* Nova
175* Glance
176* Cinder
177* Neutron
178* Swift
Masayuki Igawab8532432016-06-22 17:02:06 +0900179
Felipe Monteiroc384bc42018-07-10 20:14:04 -0400180Anything that lives in Tempest which doesn't test one of these projects can be
Masayuki Igawab8532432016-06-22 17:02:06 +0900181removed assuming there is equivalent testing elsewhere. Preferably using the
182`tempest plugin mechanism`_
Felipe Monteiroc384bc42018-07-10 20:14:04 -0400183to maintain continuity after migrating the tests out of Tempest.
Masayuki Igawab8532432016-06-22 17:02:06 +0900184
chenxinge98720a2017-07-19 03:42:23 +0000185.. _tempest plugin mechanism: https://docs.openstack.org/tempest/latest/plugin.html
Andrea Frittolib2005552017-02-23 07:40:29 -0500186
187API Compatibility
188"""""""""""""""""
189
Felipe Monteiroc384bc42018-07-10 20:14:04 -0400190If an API introduces a non-discoverable, backward-incompatible change, and
191such a change is not backported to all versions supported by Tempest, tests for
Andrea Frittolib2005552017-02-23 07:40:29 -0500192that API cannot live in Tempest anymore.
193This is because tests would not be able to know or control which API response
194to expect, and thus would not be able to enforce a specific behavior.
195
deepak_mouryae495cd22018-07-16 12:38:17 +0530196If a test exists in Tempest that would meet these criteria as a consequence of a
197change, the test must be removed according to the procedure discussed in
Andrea Frittolib2005552017-02-23 07:40:29 -0500198this document. The API change should not be merged until all conditions
Ken'ichi Ohmichi4d8ba232017-03-03 18:28:05 -0800199required for test removal can be met.