blob: a461a0fc00593023bfabf5a0813ff5091ccae519 [file] [log] [blame]
Matthew Treinish55511d92016-02-23 10:55:53 -05001.. _library:
2
Rodrigo Duarte6af041a2016-03-07 12:17:08 -03003Tempest Library Documentation
Matthew Treinish55511d92016-02-23 10:55:53 -05004=============================
5
6Tempest provides a stable library interface that provides external tools or
7test suites an interface for reusing pieces of tempest code. Any public
8interface that lives in tempest/lib in the tempest repo is treated as a stable
9public interface and it should be safe to external consume that. Every effort
Andrea Frittoli (andreaf)1370baf2016-04-29 14:26:22 -050010goes into maintaining backwards compatibility with any change.
11The library is self contained and doesn't have any dependency on
12other tempest internals outside of lib (including no usage of tempest
13configuration).
Matthew Treinish55511d92016-02-23 10:55:53 -050014
15Stability
16---------
Andrea Frittoli (andreaf)1370baf2016-04-29 14:26:22 -050017Any code that lives in tempest/lib will be treated as a stable interface.
Matthew Treinish55511d92016-02-23 10:55:53 -050018This means that any public interface under the tempest/lib directory is
19expected to be a stable interface suitable for public consumption. However, for
20any interfaces outside of tempest/lib in the tempest tree (unless otherwise
21noted) or any private interfaces the same stability guarantees don't apply.
22
23Adding Interfaces
24'''''''''''''''''
25When adding an interface to tempest/lib we have to make sure there are no
26dependencies on any pieces of tempest outside of tempest/lib. This means if
27for example there is a dependency on the configuration file we need remove that.
28The other aspect when adding an interface is to make sure it's really an
29interface ready for external consumption and something we want to commit to
30supporting.
31
32Making changes
33''''''''''''''
34When making changes to tempest/lib you have to be conscious of the effect of
35any changes on external consumers. If your proposed changeset will change the
36default behaviour of any interface, or make something which previously worked
37not after your change, then it is not acceptable. Every effort needs to go into
38preserving backwards compatibility in changes.
39
40Reviewing
41'''''''''
42When reviewing a proposed change to tempest/lib code we need to be careful to
43ensure that we don't break backwards compatibility. For patches that change
44existing interfaces we have to be careful to make sure we don't break any
45external consumers. Some common red flags are:
46
47 * a change to an existing API requires a change outside the library directory
48 where the interface is being consumed
49 * a unit test has to be significantly changed to make the proposed change pass
50
51Testing
52'''''''
53When adding a new interface to the library we need to at a minimum have unit
54test coverage. A proposed change to add an interface to tempest/lib that
55doesn't have unit tests shouldn't be accepted. Ideally these unit tests will
56provide sufficient coverage to ensure a stable interface moving forward.
57
58Current Library APIs
59--------------------
60
61.. toctree::
62 :maxdepth: 2
63
64 library/cli
65 library/decorators
66 library/rest_client
67 library/utils
Ghanshyam1f47cf92016-02-25 04:57:18 +090068 library/api_microversion_testing
Masayuki Igawaeb11b252016-06-10 10:40:02 +090069 library/auth
Andrea Frittoli (andreaf)e07579c2016-08-05 07:27:02 +010070 library/clients
Matthew Treinishc51b7122017-07-17 12:28:07 -040071 library/credential_providers