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