Matthew Treinish | 16dd51b | 2014-06-11 12:04:51 -0400 | [diff] [blame] | 1 | Reviewing Tempest Code |
| 2 | ====================== |
| 3 | |
| 4 | To start read the `OpenStack Common Review Checklist |
Masayuki Igawa | 1608cc0 | 2016-04-11 13:54:38 +0900 | [diff] [blame] | 5 | <http://docs.openstack.org/infra/manual/developers.html#peer-review>`_ |
Matthew Treinish | 16dd51b | 2014-06-11 12:04:51 -0400 | [diff] [blame] | 6 | |
| 7 | |
| 8 | Ensuring code is executed |
| 9 | ------------------------- |
| 10 | |
| 11 | For any new or change to a test it has to be verified in the gate. This means |
| 12 | that the first thing to check with any change is that a gate job actually runs |
| 13 | it. Tests which aren't executed either because of configuration or skips should |
| 14 | not be accepted. |
| 15 | |
Jordan Pittier | f6a0b5e | 2016-09-30 16:20:30 +0200 | [diff] [blame^] | 16 | If a new test is added that depends on a new config option (like a feature |
| 17 | flag), the commit message must reference a change in DevStack or DevStack-Gate |
| 18 | that enables the execution of this newly introduced test. This reference could |
| 19 | either be a `Cross-Repository Dependency <http://docs.openstack.org/infra/ |
| 20 | manual/developers.html#cross-repository-dependencies>`_ or a simple link |
| 21 | to a Gerrit review. |
| 22 | |
Matthew Treinish | 16dd51b | 2014-06-11 12:04:51 -0400 | [diff] [blame] | 23 | |
| 24 | Unit Tests |
| 25 | ---------- |
| 26 | |
| 27 | For any change that adds new functionality to either common functionality or an |
| 28 | out-of-band tool unit tests are required. This is to ensure we don't introduce |
| 29 | future regressions and to test conditions which we may not hit in the gate runs. |
| 30 | Tests, and service clients aren't required to have unit tests since they should |
| 31 | be self verifying by running them in the gate. |
| 32 | |
| 33 | |
| 34 | API Stability |
| 35 | ------------- |
| 36 | Tests should only be added for a published stable APIs. If a patch contains |
| 37 | tests for an API which hasn't been marked as stable or for an API that which |
| 38 | doesn't conform to the `API stability guidelines |
| 39 | <https://wiki.openstack.org/wiki/Governance/Approved/APIStability>`_ then it |
| 40 | should not be approved. |
| 41 | |
| 42 | |
| 43 | Reject Copy and Paste Test Code |
Matthew Treinish | f45ba2e | 2015-08-24 15:05:01 -0400 | [diff] [blame] | 44 | ------------------------------- |
Matthew Treinish | 16dd51b | 2014-06-11 12:04:51 -0400 | [diff] [blame] | 45 | When creating new tests that are similar to existing tests it is tempting to |
| 46 | simply copy the code and make a few modifications. This increases code size and |
| 47 | the maintenance burden. Such changes should not be approved if it is easy to |
| 48 | abstract the duplicated code into a function or method. |
| 49 | |
| 50 | |
| 51 | Being explicit |
| 52 | -------------- |
| 53 | When tests are being added that depend on a configurable feature or extension, |
| 54 | polling the API to discover that it is enabled should not be done. This will |
| 55 | just result in bugs being masked because the test can be skipped automatically. |
| 56 | Instead the config file should be used to determine whether a test should be |
| 57 | skipped or not. Do not approve changes that depend on an API call to determine |
| 58 | whether to skip or not. |
| 59 | |
| 60 | |
Matthew Treinish | 13a1ed6 | 2015-09-08 10:39:58 -0400 | [diff] [blame] | 61 | Configuration Options |
| 62 | --------------------- |
| 63 | With the introduction of the tempest external test plugin interface we needed |
| 64 | to provide a stable contract for tempest's configuration options. This means |
| 65 | we can no longer simply remove a configuration option when it's no longer used. |
| 66 | Patches proposed that remove options without a deprecation cycle should not |
| 67 | be approved. Similarly when changing default values with configuration we need |
| 68 | to similarly be careful that we don't break existing functionality. Also, when |
| 69 | adding options, just as before, we need to weigh the benefit of adding an |
| 70 | additional option against the complexity and maintenance overhead having it |
| 71 | costs. |
| 72 | |
| 73 | |
Matthew Treinish | 5507888 | 2014-08-12 19:01:34 -0400 | [diff] [blame] | 74 | Test Documentation |
| 75 | ------------------ |
| 76 | When a new test is being added refer to the :ref:`TestDocumentation` section in |
| 77 | hacking to see if the requirements are being met. With the exception of a class |
| 78 | level docstring linking to the API ref doc in the API tests and a docstring for |
| 79 | scenario tests this is up to the reviewers discretion whether a docstring is |
| 80 | required or not. |
| 81 | |
Matthew Treinish | b786dca | 2016-06-22 10:32:45 -0400 | [diff] [blame] | 82 | Release Notes |
| 83 | ------------- |
| 84 | Release notes are how we indicate to users and other consumers of Tempest what |
| 85 | has changed in a given release. Since Tempest 10.0.0 we've been using `reno`_ |
| 86 | to manage and build the release notes. There are certain types of changes that |
| 87 | require release notes and we should not approve them without including a release |
| 88 | note. These include but aren't limited to, any addition, deprecation or removal |
| 89 | from the lib interface, any change to configuration options (including |
| 90 | deprecation), CLI additions or deprecations, major feature additions, and |
| 91 | anything backwards incompatible or would require a user to take note or do |
| 92 | something extra. |
| 93 | |
| 94 | .. _reno: http://docs.openstack.org/developer/reno/ |
Matthew Treinish | 5507888 | 2014-08-12 19:01:34 -0400 | [diff] [blame] | 95 | |
Matthew Treinish | 16dd51b | 2014-06-11 12:04:51 -0400 | [diff] [blame] | 96 | When to approve |
| 97 | --------------- |
| 98 | * Every patch needs two +2s before being approved. |
| 99 | * Its ok to hold off on an approval until a subject matter expert reviews it |
| 100 | * If a patch has already been approved but requires a trivial rebase to merge, |
| 101 | you do not have to wait for a second +2, since the patch has already had |
| 102 | two +2s. |