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