blob: d6dc83ee5938d582d6bf57350ecf1b816326a604 [file] [log] [blame]
Matthew Treinish16dd51b2014-06-11 12:04:51 -04001Reviewing Tempest Code
2======================
3
4To start read the `OpenStack Common Review Checklist
5<https://wiki.openstack.org/wiki/ReviewChecklist#Common_Review_Checklist>`_
6
7
8Ensuring code is executed
9-------------------------
10
11For any new or change to a test it has to be verified in the gate. This means
12that the first thing to check with any change is that a gate job actually runs
13it. Tests which aren't executed either because of configuration or skips should
14not be accepted.
15
16
17Unit Tests
18----------
19
20For any change that adds new functionality to either common functionality or an
21out-of-band tool unit tests are required. This is to ensure we don't introduce
22future regressions and to test conditions which we may not hit in the gate runs.
23Tests, and service clients aren't required to have unit tests since they should
24be self verifying by running them in the gate.
25
26
27API Stability
28-------------
29Tests should only be added for a published stable APIs. If a patch contains
30tests for an API which hasn't been marked as stable or for an API that which
31doesn't conform to the `API stability guidelines
32<https://wiki.openstack.org/wiki/Governance/Approved/APIStability>`_ then it
33should not be approved.
34
35
36Reject Copy and Paste Test Code
37------------------------
38When creating new tests that are similar to existing tests it is tempting to
39simply copy the code and make a few modifications. This increases code size and
40the maintenance burden. Such changes should not be approved if it is easy to
41abstract the duplicated code into a function or method.
42
43
44Being explicit
45--------------
46When tests are being added that depend on a configurable feature or extension,
47polling the API to discover that it is enabled should not be done. This will
48just result in bugs being masked because the test can be skipped automatically.
49Instead the config file should be used to determine whether a test should be
50skipped or not. Do not approve changes that depend on an API call to determine
51whether to skip or not.
52
53
54When to approve
55---------------
56 * Every patch needs two +2s before being approved.
57 * Its ok to hold off on an approval until a subject matter expert reviews it
58 * If a patch has already been approved but requires a trivial rebase to merge,
59 you do not have to wait for a second +2, since the patch has already had
60 two +2s.