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 | |
| 53 | For prong 2 you can use OpenStack-Health: |
| 54 | |
| 55 | Using OpenStack-Health |
| 56 | """""""""""""""""""""" |
| 57 | |
| 58 | Go to: http://status.openstack.org/openstack-health and then navigate to a per |
| 59 | test page for six months. You'll end up with a page that will graph the success |
| 60 | and 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 | |
| 64 | The Old Way using subunit2sql directly |
| 65 | """""""""""""""""""""""""""""""""""""" |
| 66 | |
Masayuki Igawa | bbbaad6 | 2017-11-21 16:04:03 +0900 | [diff] [blame] | 67 | ``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 Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 70 | |
| 71 | You can access the infra mysql subunit2sql db w/ read-only permissions with: |
| 72 | |
Masayuki Igawa | b78b923 | 2017-11-17 16:12:37 +0900 | [diff] [blame] | 73 | * hostname: logstash.openstack.org |
| 74 | * username: query |
| 75 | * password: query |
| 76 | * db_name: subunit2sql |
Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 77 | |
| 78 | 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] | 79 | ``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] | 80 | you would run the following: |
| 81 | |
Masayuki Igawa | bbbaad6 | 2017-11-21 16:04:03 +0900 | [diff] [blame] | 82 | #. 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 Igawa | b78b923 | 2017-11-17 16:12:37 +0900 | [diff] [blame] | 91 | 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] | 92 | catch failures in ``setUpClass`` and ``tearDownClass``) |
Masayuki Igawa | b78b923 | 2017-11-17 16:12:37 +0900 | [diff] [blame] | 93 | #. paste the output table with numbers and the mysql command you ran to |
| 94 | generate it into the etherpad. |
Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 95 | |
deepak_mourya | e495cd2 | 2018-07-16 12:38:17 +0530 | [diff] [blame] | 96 | 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] | 97 | Also a dashboard is in the works so we don't need to manually run the command. |
| 98 | |
| 99 | 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] | 100 | specific testing is preventing bugs (assuming the Tempest tests were catching |
| 101 | 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] | 102 | rates above a certain threshold in the gate checks that means the functional |
| 103 | testing isn't really being effective in catching that bug (and therefore |
Felipe Monteiro | c384bc4 | 2018-07-10 20:14:04 -0400 | [diff] [blame] | 104 | 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] | 105 | value. |
| 106 | |
deepak_mourya | e495cd2 | 2018-07-16 12:38:17 +0530 | [diff] [blame] | 107 | However, for the 3rd prong verification is a bit more subjective. The original |
Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 108 | intent of this prong was mostly for refstack/defcore and also for things that |
| 109 | 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] | 110 | would break our API consistency checking between releases, or something that |
| 111 | defcore/refstack is depending on being in Tempest. It's worth pointing out |
Felipe Monteiro | f89ab81 | 2018-07-10 20:34:02 -0400 | [diff] [blame] | 112 | that if a test is used in `defcore`_ as part of `interop`_ testing then it will |
Felipe Monteiro | c384bc4 | 2018-07-10 20:14:04 -0400 | [diff] [blame] | 113 | probably have continuing value being in Tempest as part of the |
Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 114 | integration/integrated tests in general. This is one area where some overlap |
Felipe Monteiro | c384bc4 | 2018-07-10 20:14:04 -0400 | [diff] [blame] | 115 | 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] | 116 | |
Felipe Monteiro | f89ab81 | 2018-07-10 20:34:02 -0400 | [diff] [blame] | 117 | .. _defcore: https://wiki.openstack.org/wiki/Governance/InteropWG |
| 118 | .. _interop: https://www.openstack.org/brand/interop |
| 119 | |
Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 120 | Discussing the 3rd prong |
| 121 | """""""""""""""""""""""" |
| 122 | |
| 123 | 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] | 124 | 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] | 125 | well ahead of the scheduled meeting. Since the meeting time will be well known |
| 126 | ahead of time anyone who depends on the tests will have ample time beforehand |
| 127 | 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] | 128 | 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] | 129 | Monday before the meeting. |
| 130 | |
ghanshyam | 59a93d1 | 2019-03-07 17:25:29 +0000 | [diff] [blame^] | 131 | The 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 |
| 133 | or http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003574.html ) |
Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 134 | This 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 |
| 136 | only downside is that it might take more time to get a response, given the |
| 137 | nature of ML. |
| 138 | |
| 139 | Exceptions to this procedure |
| 140 | ---------------------------- |
| 141 | |
deepak_mourya | e495cd2 | 2018-07-16 12:38:17 +0530 | [diff] [blame] | 142 | 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] | 143 | there are a couple of exceptions though: |
| 144 | |
Felipe Monteiro | c384bc4 | 2018-07-10 20:14:04 -0400 | [diff] [blame] | 145 | #. 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] | 146 | #. 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 Monteiro | c384bc4 | 2018-07-10 20:14:04 -0400 | [diff] [blame] | 152 | Tempest. Such tests must still honor `prong #3`_. |
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 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] | 155 | declared out of scope at this point are: |
| 156 | |
Masayuki Igawa | b78b923 | 2017-11-17 16:12:37 +0900 | [diff] [blame] | 157 | * 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 Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 162 | |
deepak_mourya | e495cd2 | 2018-07-16 12:38:17 +0530 | [diff] [blame] | 163 | 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] | 164 | there is equivalent testing elsewhere. |
| 165 | |
| 166 | Tempest Scope |
| 167 | ^^^^^^^^^^^^^ |
| 168 | |
Felipe Monteiro | c384bc4 | 2018-07-10 20:14:04 -0400 | [diff] [blame] | 169 | Starting in the liberty cycle Tempest, has defined a set of projects which |
| 170 | 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] | 171 | is: |
| 172 | |
Masayuki Igawa | b78b923 | 2017-11-17 16:12:37 +0900 | [diff] [blame] | 173 | * Keystone |
| 174 | * Nova |
| 175 | * Glance |
| 176 | * Cinder |
| 177 | * Neutron |
| 178 | * Swift |
Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 179 | |
Felipe Monteiro | c384bc4 | 2018-07-10 20:14:04 -0400 | [diff] [blame] | 180 | 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] | 181 | removed assuming there is equivalent testing elsewhere. Preferably using the |
| 182 | `tempest plugin mechanism`_ |
Felipe Monteiro | c384bc4 | 2018-07-10 20:14:04 -0400 | [diff] [blame] | 183 | to maintain continuity after migrating the tests out of Tempest. |
Masayuki Igawa | b853243 | 2016-06-22 17:02:06 +0900 | [diff] [blame] | 184 | |
chenxing | e98720a | 2017-07-19 03:42:23 +0000 | [diff] [blame] | 185 | .. _tempest plugin mechanism: https://docs.openstack.org/tempest/latest/plugin.html |
Andrea Frittoli | b200555 | 2017-02-23 07:40:29 -0500 | [diff] [blame] | 186 | |
| 187 | API Compatibility |
| 188 | """"""""""""""""" |
| 189 | |
Felipe Monteiro | c384bc4 | 2018-07-10 20:14:04 -0400 | [diff] [blame] | 190 | If an API introduces a non-discoverable, backward-incompatible change, and |
| 191 | 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] | 192 | that API cannot live in Tempest anymore. |
| 193 | This is because tests would not be able to know or control which API response |
| 194 | to expect, and thus would not be able to enforce a specific behavior. |
| 195 | |
deepak_mourya | e495cd2 | 2018-07-16 12:38:17 +0530 | [diff] [blame] | 196 | If a test exists in Tempest that would meet these criteria as a consequence of a |
| 197 | change, the test must be removed according to the procedure discussed in |
Andrea Frittoli | b200555 | 2017-02-23 07:40:29 -0500 | [diff] [blame] | 198 | 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] | 199 | required for test removal can be met. |