| Felipe Monteiro | f89ab81 | 2018-07-10 20:34:02 -0400 | [diff] [blame] | 1 | .. _test-removal: | 
|  | 2 |  | 
| Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 3 | Tempest Test Removal Procedure | 
|  | 4 | ============================== | 
|  | 5 |  | 
| Felipe Monteiro | c384bc4 | 2018-07-10 20:14:04 -0400 | [diff] [blame] | 6 | Historically, Tempest was the only way of doing functional testing and | 
|  | 7 | integration testing in OpenStack. This was mostly only an artifact of Tempest | 
| Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 8 | being the only proven pattern for doing this, not an artifact of a design | 
| Felipe Monteiro | c384bc4 | 2018-07-10 20:14:04 -0400 | [diff] [blame] | 9 | decision. However, moving forward, as functional testing is being spun up in | 
|  | 10 | each individual project, we really only want Tempest to be the integration test | 
|  | 11 | suite it was intended to be: testing the high-level interactions between | 
|  | 12 | projects through REST API requests. In this model, there are probably existing | 
|  | 13 | tests that aren't the best fit living in Tempest. However, since Tempest is | 
| Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 14 | largely still the only gating test suite in this space we can't carelessly rip | 
|  | 15 | out everything from the tree. This document outlines the procedure which was | 
|  | 16 | developed to ensure we minimize the risk for removing something of value from | 
| Felipe Monteiro | c384bc4 | 2018-07-10 20:14:04 -0400 | [diff] [blame] | 17 | the Tempest tree. | 
| Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 18 |  | 
| Felipe Monteiro | c384bc4 | 2018-07-10 20:14:04 -0400 | [diff] [blame] | 19 | This procedure might seem overly conservative and slow-paced, but this is by | 
|  | 20 | design to try to ensure we don't remove something that is actually providing | 
| Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 21 | value. Having potential duplication between testing is not a big deal | 
|  | 22 | especially compared to the alternative of removing something which is actually | 
|  | 23 | providing value and is actively catching bugs, or blocking incorrect patches | 
|  | 24 | from landing. | 
|  | 25 |  | 
|  | 26 | Proposing a test removal | 
|  | 27 | ------------------------ | 
|  | 28 |  | 
|  | 29 | 3 prong rule for removal | 
|  | 30 | ^^^^^^^^^^^^^^^^^^^^^^^^ | 
|  | 31 |  | 
| Felipe Monteiro | c384bc4 | 2018-07-10 20:14:04 -0400 | [diff] [blame] | 32 | In the proposal etherpad we'll be looking for answers to 3 questions: | 
| Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 33 |  | 
| Masayuki Igawa | b78b923 | 2017-11-17 16:12:37 +0900 | [diff] [blame] | 34 | #. 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 Monteiro | c384bc4 | 2018-07-10 20:14:04 -0400 | [diff] [blame] | 37 | 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 Igawa | b78b923 | 2017-11-17 16:12:37 +0900 | [diff] [blame] | 39 | 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 Frittoli | b200555 | 2017-02-23 07:40:29 -0500 | [diff] [blame] | 43 |  | 
| Masayuki Igawa | b78b923 | 2017-11-17 16:12:37 +0900 | [diff] [blame] | 44 | .. _`prong #3`: | 
| Felipe Monteiro | c384bc4 | 2018-07-10 20:14:04 -0400 | [diff] [blame] | 45 | #. There must not be an external user/consumer of Tempest | 
| Masayuki Igawa | b78b923 | 2017-11-17 16:12:37 +0900 | [diff] [blame] | 46 | that depends on the test proposed for removal | 
| Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 47 |  | 
|  | 48 | The answers to 1 and 2 are easy to verify. For 1 just provide a link to the new | 
| Felipe Monteiro | c384bc4 | 2018-07-10 20:14:04 -0400 | [diff] [blame] | 49 | test location. If you are linking to the Tempest removal patch please also put | 
| Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 50 | a Depends-On in the commit message for the commit which moved the test into | 
|  | 51 | another repo. | 
|  | 52 |  | 
| Ghanshyam Mann | 38fcb5f | 2022-04-05 19:50:15 -0500 | [diff] [blame] | 53 | For prong 2 you can use subunit2sql: | 
| Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 54 |  | 
| Ghanshyam Mann | 38fcb5f | 2022-04-05 19:50:15 -0500 | [diff] [blame] | 55 | Using subunit2sql directly | 
|  | 56 | """""""""""""""""""""""""" | 
| Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 57 |  | 
| Masayuki Igawa | bbbaad6 | 2017-11-21 16:04:03 +0900 | [diff] [blame] | 58 | ``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 Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 61 |  | 
|  | 62 | You can access the infra mysql subunit2sql db w/ read-only permissions with: | 
|  | 63 |  | 
| Masayuki Igawa | b78b923 | 2017-11-17 16:12:37 +0900 | [diff] [blame] | 64 | * hostname: logstash.openstack.org | 
|  | 65 | * username: query | 
|  | 66 | * password: query | 
|  | 67 | * db_name: subunit2sql | 
| Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 68 |  | 
|  | 69 | For example if you were trying to remove the test with the id: | 
| Masayuki Igawa | bbbaad6 | 2017-11-21 16:04:03 +0900 | [diff] [blame] | 70 | ``tempest.api.compute.admin.test_flavors_negative.FlavorsAdminNegativeTestJSON.test_get_flavor_details_for_deleted_flavor`` | 
| Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 71 | you would run the following: | 
|  | 72 |  | 
| Masayuki Igawa | bbbaad6 | 2017-11-21 16:04:03 +0900 | [diff] [blame] | 73 | #. 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 Igawa | b78b923 | 2017-11-17 16:12:37 +0900 | [diff] [blame] | 82 | which will return a table of all the tests in the class (but it will also | 
| Masayuki Igawa | bbbaad6 | 2017-11-21 16:04:03 +0900 | [diff] [blame] | 83 | catch failures in ``setUpClass`` and ``tearDownClass``) | 
| Masayuki Igawa | b78b923 | 2017-11-17 16:12:37 +0900 | [diff] [blame] | 84 | #. paste the output table with numbers and the mysql command you ran to | 
|  | 85 | generate it into the etherpad. | 
| Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 86 |  | 
| deepak_mourya | e495cd2 | 2018-07-16 12:38:17 +0530 | [diff] [blame] | 87 | Eventually, a CLI interface will be created to make that a bit more friendly. | 
| Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 88 | Also a dashboard is in the works so we don't need to manually run the command. | 
|  | 89 |  | 
|  | 90 | The intent of the 2nd prong is to verify that moving the test into a project | 
| Felipe Monteiro | c384bc4 | 2018-07-10 20:14:04 -0400 | [diff] [blame] | 91 | specific testing is preventing bugs (assuming the Tempest tests were catching | 
|  | 92 | issues) from bubbling up a layer into Tempest jobs. If we're seeing failure | 
| Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 93 | rates above a certain threshold in the gate checks that means the functional | 
|  | 94 | testing isn't really being effective in catching that bug (and therefore | 
| Felipe Monteiro | c384bc4 | 2018-07-10 20:14:04 -0400 | [diff] [blame] | 95 | blocking it from landing) and having the testing run in Tempest still has | 
| Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 96 | value. | 
|  | 97 |  | 
| deepak_mourya | e495cd2 | 2018-07-16 12:38:17 +0530 | [diff] [blame] | 98 | However, for the 3rd prong verification is a bit more subjective. The original | 
| Martin Kopec | 425b486 | 2021-11-08 10:41:24 +0000 | [diff] [blame] | 99 | intent of this prong was mostly for interop/refstack and also for things that | 
| Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 100 | running on the stable branches. We don't want to remove any tests if that | 
| Felipe Monteiro | c384bc4 | 2018-07-10 20:14:04 -0400 | [diff] [blame] | 101 | would break our API consistency checking between releases, or something that | 
| Martin Kopec | 425b486 | 2021-11-08 10:41:24 +0000 | [diff] [blame] | 102 | interop/refstack is depending on being in Tempest. It's worth pointing out | 
|  | 103 | that if a test is used in `interop_wg`_ as part of `interop`_ testing then it | 
|  | 104 | will probably have continuing value being in Tempest as part of the | 
| Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 105 | integration/integrated tests in general. This is one area where some overlap | 
| Felipe Monteiro | c384bc4 | 2018-07-10 20:14:04 -0400 | [diff] [blame] | 106 | is expected between testing in projects and Tempest, which is not a bad thing. | 
| Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 107 |  | 
| Martin Kopec | 425b486 | 2021-11-08 10:41:24 +0000 | [diff] [blame] | 108 | .. _interop_wg: https://docs.opendev.org/openinfra/interop/latest/ | 
| Felipe Monteiro | f89ab81 | 2018-07-10 20:34:02 -0400 | [diff] [blame] | 109 | .. _interop: https://www.openstack.org/brand/interop | 
|  | 110 |  | 
| Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 111 | Discussing the 3rd prong | 
|  | 112 | """""""""""""""""""""""" | 
|  | 113 |  | 
|  | 114 | There are 2 approaches to addressing the 3rd prong. Either it can be raised | 
| Felipe Monteiro | f89ab81 | 2018-07-10 20:34:02 -0400 | [diff] [blame] | 115 | during a QA meeting during the Tempest discussion. Please put it on the agenda | 
| Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 116 | well ahead of the scheduled meeting. Since the meeting time will be well known | 
|  | 117 | ahead of time anyone who depends on the tests will have ample time beforehand | 
|  | 118 | to outline any concerns on the before the meeting. To give ample time for | 
| Masayuki Igawa | a8d3cae | 2016-07-11 18:59:23 +0900 | [diff] [blame] | 119 | people to respond to removal proposals please add things to the agenda by the | 
| Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 120 | Monday before the meeting. | 
|  | 121 |  | 
| ghanshyam | 59a93d1 | 2019-03-07 17:25:29 +0000 | [diff] [blame] | 122 | The 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 | 
|  | 124 | or http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003574.html ) | 
| Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 125 | This 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 | 
|  | 127 | only downside is that it might take more time to get a response, given the | 
|  | 128 | nature of ML. | 
|  | 129 |  | 
|  | 130 | Exceptions to this procedure | 
|  | 131 | ---------------------------- | 
|  | 132 |  | 
| deepak_mourya | e495cd2 | 2018-07-16 12:38:17 +0530 | [diff] [blame] | 133 | For the most part, all Tempest test removals have to go through this procedure | 
| Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 134 | there are a couple of exceptions though: | 
|  | 135 |  | 
| Felipe Monteiro | c384bc4 | 2018-07-10 20:14:04 -0400 | [diff] [blame] | 136 | #. The class of testing has been decided to be outside the scope of Tempest. | 
| Masayuki Igawa | b78b923 | 2017-11-17 16:12:37 +0900 | [diff] [blame] | 137 | #. 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 Monteiro | c384bc4 | 2018-07-10 20:14:04 -0400 | [diff] [blame] | 143 | Tempest. Such tests must still honor `prong #3`_. | 
| Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 144 |  | 
| deepak_mourya | e495cd2 | 2018-07-16 12:38:17 +0530 | [diff] [blame] | 145 | For the first exception type, the only types of testing in the tree which have been | 
| Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 146 | declared out of scope at this point are: | 
|  | 147 |  | 
| Masayuki Igawa | b78b923 | 2017-11-17 16:12:37 +0900 | [diff] [blame] | 148 | * 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 Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 153 |  | 
| deepak_mourya | e495cd2 | 2018-07-16 12:38:17 +0530 | [diff] [blame] | 154 | For tests that fit into this category, the only criteria for removal is that | 
| Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 155 | there is equivalent testing elsewhere. | 
|  | 156 |  | 
|  | 157 | Tempest Scope | 
|  | 158 | ^^^^^^^^^^^^^ | 
|  | 159 |  | 
| Felipe Monteiro | c384bc4 | 2018-07-10 20:14:04 -0400 | [diff] [blame] | 160 | Starting in the liberty cycle Tempest, has defined a set of projects which | 
|  | 161 | are defined as in scope for direct testing in Tempest. As of today that list | 
| Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 162 | is: | 
|  | 163 |  | 
| Masayuki Igawa | b78b923 | 2017-11-17 16:12:37 +0900 | [diff] [blame] | 164 | * Keystone | 
|  | 165 | * Nova | 
|  | 166 | * Glance | 
|  | 167 | * Cinder | 
|  | 168 | * Neutron | 
|  | 169 | * Swift | 
| Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 170 |  | 
| Felipe Monteiro | c384bc4 | 2018-07-10 20:14:04 -0400 | [diff] [blame] | 171 | Anything that lives in Tempest which doesn't test one of these projects can be | 
| Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 172 | removed assuming there is equivalent testing elsewhere. Preferably using the | 
|  | 173 | `tempest plugin mechanism`_ | 
| Felipe Monteiro | c384bc4 | 2018-07-10 20:14:04 -0400 | [diff] [blame] | 174 | to maintain continuity after migrating the tests out of Tempest. | 
| Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 175 |  | 
| chenxing | e98720a | 2017-07-19 03:42:23 +0000 | [diff] [blame] | 176 | .. _tempest plugin mechanism: https://docs.openstack.org/tempest/latest/plugin.html | 
| Andrea Frittoli | b200555 | 2017-02-23 07:40:29 -0500 | [diff] [blame] | 177 |  | 
|  | 178 | API Compatibility | 
|  | 179 | """"""""""""""""" | 
|  | 180 |  | 
| Felipe Monteiro | c384bc4 | 2018-07-10 20:14:04 -0400 | [diff] [blame] | 181 | If an API introduces a non-discoverable, backward-incompatible change, and | 
|  | 182 | such a change is not backported to all versions supported by Tempest, tests for | 
| Andrea Frittoli | b200555 | 2017-02-23 07:40:29 -0500 | [diff] [blame] | 183 | that API cannot live in Tempest anymore. | 
|  | 184 | This is because tests would not be able to know or control which API response | 
|  | 185 | to expect, and thus would not be able to enforce a specific behavior. | 
|  | 186 |  | 
| deepak_mourya | e495cd2 | 2018-07-16 12:38:17 +0530 | [diff] [blame] | 187 | If a test exists in Tempest that would meet these criteria as a consequence of a | 
|  | 188 | change, the test must be removed according to the procedure discussed in | 
| Andrea Frittoli | b200555 | 2017-02-23 07:40:29 -0500 | [diff] [blame] | 189 | this document. The API change should not be merged until all conditions | 
| Ken'ichi Ohmichi | 4d8ba23 | 2017-03-03 18:28:05 -0800 | [diff] [blame] | 190 | required for test removal can be met. |