blob: bb223b1d67d6b0f1f13428f3cf80145dc303a85b [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
Ghanshyam Mann38fcb5f2022-04-05 19:50:15 -050053For prong 2 you can use subunit2sql:
Masayuki Igawab8532432016-06-22 17:02:06 +090054
Ghanshyam Mann38fcb5f2022-04-05 19:50:15 -050055Using subunit2sql directly
56""""""""""""""""""""""""""
Masayuki Igawab8532432016-06-22 17:02:06 +090057
Masayuki Igawabbbaad62017-11-21 16:04:03 +090058``SELECT * from tests where test_id like "%test_id%";``
59(where ``$test_id`` is the full test_id, but truncated to the class because of
60``setUpClass`` or ``tearDownClass`` failures)
Masayuki Igawab8532432016-06-22 17:02:06 +090061
62You can access the infra mysql subunit2sql db w/ read-only permissions with:
63
Masayuki Igawab78b9232017-11-17 16:12:37 +090064* hostname: logstash.openstack.org
65* username: query
66* password: query
67* db_name: subunit2sql
Masayuki Igawab8532432016-06-22 17:02:06 +090068
69For example if you were trying to remove the test with the id:
Masayuki Igawabbbaad62017-11-21 16:04:03 +090070``tempest.api.compute.admin.test_flavors_negative.FlavorsAdminNegativeTestJSON.test_get_flavor_details_for_deleted_flavor``
Masayuki Igawab8532432016-06-22 17:02:06 +090071you would run the following:
72
Masayuki Igawabbbaad62017-11-21 16:04:03 +090073#. run the command: ``mysql -u query -p -h logstash.openstack.org subunit2sql``
74 to connect to the subunit2sql db
75#. run the query:
76
77 .. code-block:: console
78
79 MySQL [subunit2sql]> select * from tests where test_id like \
80 "tempest.api.compute.admin.test_flavors_negative.FlavorsAdminNegativeTestJSON%";
81
Masayuki Igawab78b9232017-11-17 16:12:37 +090082 which will return a table of all the tests in the class (but it will also
Masayuki Igawabbbaad62017-11-21 16:04:03 +090083 catch failures in ``setUpClass`` and ``tearDownClass``)
Masayuki Igawab78b9232017-11-17 16:12:37 +090084#. paste the output table with numbers and the mysql command you ran to
85 generate it into the etherpad.
Masayuki Igawab8532432016-06-22 17:02:06 +090086
deepak_mouryae495cd22018-07-16 12:38:17 +053087Eventually, a CLI interface will be created to make that a bit more friendly.
Masayuki Igawab8532432016-06-22 17:02:06 +090088Also 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
Felipe Monteiroc384bc42018-07-10 20:14:04 -040091specific testing is preventing bugs (assuming the Tempest tests were catching
92issues) from bubbling up a layer into Tempest jobs. If we're seeing failure
Masayuki Igawab8532432016-06-22 17:02:06 +090093rates above a certain threshold in the gate checks that means the functional
94testing isn't really being effective in catching that bug (and therefore
Felipe Monteiroc384bc42018-07-10 20:14:04 -040095blocking it from landing) and having the testing run in Tempest still has
Masayuki Igawab8532432016-06-22 17:02:06 +090096value.
97
deepak_mouryae495cd22018-07-16 12:38:17 +053098However, for the 3rd prong verification is a bit more subjective. The original
Martin Kopec425b4862021-11-08 10:41:24 +000099intent of this prong was mostly for interop/refstack and also for things that
Masayuki Igawab8532432016-06-22 17:02:06 +0900100running on the stable branches. We don't want to remove any tests if that
Felipe Monteiroc384bc42018-07-10 20:14:04 -0400101would break our API consistency checking between releases, or something that
Martin Kopec425b4862021-11-08 10:41:24 +0000102interop/refstack is depending on being in Tempest. It's worth pointing out
103that if a test is used in `interop_wg`_ as part of `interop`_ testing then it
104will probably have continuing value being in Tempest as part of the
Masayuki Igawab8532432016-06-22 17:02:06 +0900105integration/integrated tests in general. This is one area where some overlap
Felipe Monteiroc384bc42018-07-10 20:14:04 -0400106is expected between testing in projects and Tempest, which is not a bad thing.
Masayuki Igawab8532432016-06-22 17:02:06 +0900107
Martin Kopec425b4862021-11-08 10:41:24 +0000108.. _interop_wg: https://docs.opendev.org/openinfra/interop/latest/
Felipe Monteirof89ab812018-07-10 20:34:02 -0400109.. _interop: https://www.openstack.org/brand/interop
110
Masayuki Igawab8532432016-06-22 17:02:06 +0900111Discussing the 3rd prong
112""""""""""""""""""""""""
113
114There are 2 approaches to addressing the 3rd prong. Either it can be raised
Felipe Monteirof89ab812018-07-10 20:34:02 -0400115during a QA meeting during the Tempest discussion. Please put it on the agenda
Masayuki Igawab8532432016-06-22 17:02:06 +0900116well ahead of the scheduled meeting. Since the meeting time will be well known
117ahead of time anyone who depends on the tests will have ample time beforehand
118to outline any concerns on the before the meeting. To give ample time for
Masayuki Igawaa8d3cae2016-07-11 18:59:23 +0900119people to respond to removal proposals please add things to the agenda by the
Masayuki Igawab8532432016-06-22 17:02:06 +0900120Monday before the meeting.
121
ghanshyam59a93d12019-03-07 17:25:29 +0000122The other option is to raise the removal on the openstack-discuss mailing list.
123(for example see: http://lists.openstack.org/pipermail/openstack-dev/2016-February/086218.html
124or http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003574.html )
Masayuki Igawab8532432016-06-22 17:02:06 +0900125This will raise the issue to the wider community and attract at least the same
126(most likely more) attention than discussing it during the irc meeting. The
127only downside is that it might take more time to get a response, given the
128nature of ML.
129
130Exceptions to this procedure
131----------------------------
132
deepak_mouryae495cd22018-07-16 12:38:17 +0530133For the most part, all Tempest test removals have to go through this procedure
Masayuki Igawab8532432016-06-22 17:02:06 +0900134there are a couple of exceptions though:
135
Felipe Monteiroc384bc42018-07-10 20:14:04 -0400136#. The class of testing has been decided to be outside the scope of Tempest.
Masayuki Igawab78b9232017-11-17 16:12:37 +0900137#. A revert for a patch which added a broken test, or testing which didn't
138 actually run in the gate (basically any revert for something which
139 shouldn't have been added)
140#. Tests that would become out of scope as a consequence of an API change,
141 as described in `API Compatibility`_.
142 Such tests cannot live in Tempest because of the branchless nature of
Felipe Monteiroc384bc42018-07-10 20:14:04 -0400143 Tempest. Such tests must still honor `prong #3`_.
Masayuki Igawab8532432016-06-22 17:02:06 +0900144
deepak_mouryae495cd22018-07-16 12:38:17 +0530145For the first exception type, the only types of testing in the tree which have been
Masayuki Igawab8532432016-06-22 17:02:06 +0900146declared out of scope at this point are:
147
Masayuki Igawab78b9232017-11-17 16:12:37 +0900148* The CLI tests (which should be completely removed at this point)
149* Neutron Adv. Services testing (which should be completely removed at this
150 point)
151* XML API Tests (which should be completely removed at this point)
152* EC2 API/boto tests (which should be completely removed at this point)
Masayuki Igawab8532432016-06-22 17:02:06 +0900153
deepak_mouryae495cd22018-07-16 12:38:17 +0530154For tests that fit into this category, the only criteria for removal is that
Masayuki Igawab8532432016-06-22 17:02:06 +0900155there is equivalent testing elsewhere.
156
157Tempest Scope
158^^^^^^^^^^^^^
159
Felipe Monteiroc384bc42018-07-10 20:14:04 -0400160Starting in the liberty cycle Tempest, has defined a set of projects which
161are defined as in scope for direct testing in Tempest. As of today that list
Masayuki Igawab8532432016-06-22 17:02:06 +0900162is:
163
Masayuki Igawab78b9232017-11-17 16:12:37 +0900164* Keystone
165* Nova
166* Glance
167* Cinder
168* Neutron
169* Swift
Masayuki Igawab8532432016-06-22 17:02:06 +0900170
Felipe Monteiroc384bc42018-07-10 20:14:04 -0400171Anything that lives in Tempest which doesn't test one of these projects can be
Masayuki Igawab8532432016-06-22 17:02:06 +0900172removed assuming there is equivalent testing elsewhere. Preferably using the
173`tempest plugin mechanism`_
Felipe Monteiroc384bc42018-07-10 20:14:04 -0400174to maintain continuity after migrating the tests out of Tempest.
Masayuki Igawab8532432016-06-22 17:02:06 +0900175
chenxinge98720a2017-07-19 03:42:23 +0000176.. _tempest plugin mechanism: https://docs.openstack.org/tempest/latest/plugin.html
Andrea Frittolib2005552017-02-23 07:40:29 -0500177
178API Compatibility
179"""""""""""""""""
180
Felipe Monteiroc384bc42018-07-10 20:14:04 -0400181If an API introduces a non-discoverable, backward-incompatible change, and
182such a change is not backported to all versions supported by Tempest, tests for
Andrea Frittolib2005552017-02-23 07:40:29 -0500183that API cannot live in Tempest anymore.
184This is because tests would not be able to know or control which API response
185to expect, and thus would not be able to enforce a specific behavior.
186
deepak_mouryae495cd22018-07-16 12:38:17 +0530187If a test exists in Tempest that would meet these criteria as a consequence of a
188change, the test must be removed according to the procedure discussed in
Andrea Frittolib2005552017-02-23 07:40:29 -0500189this document. The API change should not be merged until all conditions
Ken'ichi Ohmichi4d8ba232017-03-03 18:28:05 -0800190required for test removal can be met.