blob: b300dcb8476a4a6d4d63ac0551560f256ceaeab3 [file] [log] [blame]
Attila Fazekas58d23302013-07-24 10:25:02 +02001============================
Sean Dague7679b482013-05-24 08:49:44 -04002Tempest Field Guide Overview
Attila Fazekas58d23302013-07-24 10:25:02 +02003============================
Sean Dague31a57ad2013-05-07 15:24:05 -04004
5Tempest is designed to be useful for a large number of different
6environments. This includes being useful for gating commits to
7OpenStack core projects, being used to validate OpenStack cloud
8implementations for both correctness, as well as a burn in tool for
9OpenStack clouds.
10
Martin Kopecd76178e2024-01-16 20:43:56 +010011As such Tempest tests come in many flavors, each with its own rules
gaobinaf6d18a2018-12-09 19:59:12 +080012and guidelines. Below is the overview of the Tempest repository structure
Sean Dague31a57ad2013-05-07 15:24:05 -040013to make this clear.
14
David Rabel0a83c712018-05-24 08:45:26 +020015.. code-block:: console
Masayuki Igawa989f9112017-11-14 16:29:35 +090016
David Rabel0a83c712018-05-24 08:45:26 +020017 tempest/
18 api/ - API tests
19 scenario/ - complex scenario tests
Martin Kopecd76178e2024-01-16 20:43:56 +010020 serial_tests/ - tests that run always in the serial mode
David Rabel0a83c712018-05-24 08:45:26 +020021 tests/ - unit tests for Tempest internals
Sean Dague31a57ad2013-05-07 15:24:05 -040022
23Each of these directories contains different types of tests. What
24belongs in each directory, the rules and examples for good tests, are
25documented in a README.rst file in the directory.
26
Matthew Treinisha9aef872014-07-25 16:03:08 -040027:ref:`api_field_guide`
28----------------------
Sean Dague31a57ad2013-05-07 15:24:05 -040029
30API tests are validation tests for the OpenStack API. They should not
Jordan Pittier74a56ab2017-04-26 16:46:20 +020031use the existing Python clients for OpenStack, but should instead use
32the Tempest implementations of clients. Having raw clients let us
guo yunxiana2216472016-08-01 16:34:43 +080033pass invalid JSON to the APIs and see the results, something we could
34not get with the native clients.
Sean Dague31a57ad2013-05-07 15:24:05 -040035
36When it makes sense, API testing should be moved closer to the
37projects themselves, possibly as functional tests in their unit test
38frameworks.
39
Sean Dague31a57ad2013-05-07 15:24:05 -040040
Matthew Treinisha9aef872014-07-25 16:03:08 -040041:ref:`scenario_field_guide`
42---------------------------
Sean Dague31a57ad2013-05-07 15:24:05 -040043
44Scenario tests are complex "through path" tests for OpenStack
Martin Kopecd76178e2024-01-16 20:43:56 +010045functionality. They are typically a series of steps where a complicated
Sean Dague31a57ad2013-05-07 15:24:05 -040046state requiring multiple services is set up exercised, and torn down.
47
Jordan Pittier74a56ab2017-04-26 16:46:20 +020048Scenario tests should not use the existing Python clients for OpenStack,
49but should instead use the Tempest implementations of clients.
Sean Dague31a57ad2013-05-07 15:24:05 -040050
Sean Dague31a57ad2013-05-07 15:24:05 -040051
Martin Kopecd76178e2024-01-16 20:43:56 +010052:ref:`serial_tests_guide`
53--------------------------------
54
55Tests within this category will always be executed serially from the rest of
56the test cases.
57
58
Matthew Treinish817a8082014-07-25 16:07:20 -040059:ref:`unit_tests_field_guide`
60-----------------------------
61
62Unit tests are the self checks for Tempest. They provide functional
Jordan Pittier74a56ab2017-04-26 16:46:20 +020063verification and regression checking for the internal components of Tempest.
64They should be used to just verify that the individual pieces of Tempest are
Matthew Treinish817a8082014-07-25 16:07:20 -040065working as expected.