blob: b22503b7ad62799f27ff5b514b70e7dad25f0b94 [file] [log] [blame]
Masayuki Igawab8532432016-06-22 17:02:06 +09001Tempest Test Removal Procedure
2==============================
3
Felipe Monteiroc384bc42018-07-10 20:14:04 -04004Historically, Tempest was the only way of doing functional testing and
5integration testing in OpenStack. This was mostly only an artifact of Tempest
Masayuki Igawab8532432016-06-22 17:02:06 +09006being the only proven pattern for doing this, not an artifact of a design
Felipe Monteiroc384bc42018-07-10 20:14:04 -04007decision. 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
Masayuki Igawab8532432016-06-22 17:02:06 +090012largely 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
Felipe Monteiroc384bc42018-07-10 20:14:04 -040015the Tempest tree.
Masayuki Igawab8532432016-06-22 17:02:06 +090016
Felipe Monteiroc384bc42018-07-10 20:14:04 -040017This procedure might seem overly conservative and slow-paced, but this is by
18design to try to ensure we don't remove something that is actually providing
Masayuki Igawab8532432016-06-22 17:02:06 +090019value. 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
Felipe Monteiroc384bc42018-07-10 20:14:04 -040030In the proposal etherpad we'll be looking for answers to 3 questions:
Masayuki Igawab8532432016-06-22 17:02:06 +090031
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
Felipe Monteiroc384bc42018-07-10 20:14:04 -040035 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
Masayuki Igawab78b9232017-11-17 16:12:37 +090037 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`:
Felipe Monteiroc384bc42018-07-10 20:14:04 -040043#. There must not be an external user/consumer of Tempest
Masayuki Igawab78b9232017-11-17 16:12:37 +090044 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
Felipe Monteiroc384bc42018-07-10 20:14:04 -040047test location. If you are linking to the Tempest removal patch please also put
Masayuki Igawab8532432016-06-22 17:02:06 +090048a 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
Felipe Monteiroc384bc42018-07-10 20:14:04 -040094Eventually a CLI interface will be created to make that a bit more friendly.
Masayuki Igawab8532432016-06-22 17:02:06 +090095Also 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
Felipe Monteiroc384bc42018-07-10 20:14:04 -040098specific testing is preventing bugs (assuming the Tempest tests were catching
99issues) from bubbling up a layer into Tempest jobs. If we're seeing failure
Masayuki Igawab8532432016-06-22 17:02:06 +0900100rates above a certain threshold in the gate checks that means the functional
101testing isn't really being effective in catching that bug (and therefore
Felipe Monteiroc384bc42018-07-10 20:14:04 -0400102blocking it from landing) and having the testing run in Tempest still has
Masayuki Igawab8532432016-06-22 17:02:06 +0900103value.
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
Felipe Monteiroc384bc42018-07-10 20:14:04 -0400108would break our API consistency checking between releases, or something that
109defcore/refstack is depending on being in Tempest. It's worth pointing out
Masayuki Igawab8532432016-06-22 17:02:06 +0900110that if a test is used in defcore as part of interop testing then it will
Felipe Monteiroc384bc42018-07-10 20:14:04 -0400111probably have continuing value being in Tempest as part of the
Masayuki Igawab8532432016-06-22 17:02:06 +0900112integration/integrated tests in general. This is one area where some overlap
Felipe Monteiroc384bc42018-07-10 20:14:04 -0400113is expected between testing in projects and Tempest, which is not a bad thing.
Masayuki Igawab8532432016-06-22 17:02:06 +0900114
115Discussing the 3rd prong
116""""""""""""""""""""""""
117
118There are 2 approaches to addressing the 3rd prong. Either it can be raised
Felipe Monteiroc384bc42018-07-10 20:14:04 -0400119during a qa meeting during the Tempest discussion. Please put it on the agenda
Masayuki Igawab8532432016-06-22 17:02:06 +0900120well 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
Felipe Monteiroc384bc42018-07-10 20:14:04 -0400136For the most part all Tempest test removals have to go through this procedure
Masayuki Igawab8532432016-06-22 17:02:06 +0900137there are a couple of exceptions though:
138
Felipe Monteiroc384bc42018-07-10 20:14:04 -0400139#. The class of testing has been decided to be outside the scope of Tempest.
Masayuki Igawab78b9232017-11-17 16:12:37 +0900140#. 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
Felipe Monteiroc384bc42018-07-10 20:14:04 -0400146 Tempest. Such tests 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
Felipe Monteiroc384bc42018-07-10 20:14:04 -0400163Starting in the liberty cycle Tempest, has defined a set of projects which
164are defined as in scope for direct testing in Tempest. As of today that list
Masayuki Igawab8532432016-06-22 17:02:06 +0900165is:
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
Felipe Monteiroc384bc42018-07-10 20:14:04 -0400174Anything that lives in Tempest which doesn't test one of these projects can be
Masayuki Igawab8532432016-06-22 17:02:06 +0900175removed assuming there is equivalent testing elsewhere. Preferably using the
176`tempest plugin mechanism`_
Felipe Monteiroc384bc42018-07-10 20:14:04 -0400177to 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
Felipe Monteiroc384bc42018-07-10 20:14:04 -0400184If an API introduces a non-discoverable, backward-incompatible change, and
185such a change is not backported to all versions supported by Tempest, tests for
Andrea Frittolib2005552017-02-23 07:40:29 -0500186that 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.