blob: b34503255b62091c4825a7c47afeda0816ca151a [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
11As such Tempest tests come in many flavors, each with their 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
20 tests/ - unit tests for Tempest internals
Sean Dague31a57ad2013-05-07 15:24:05 -040021
22Each of these directories contains different types of tests. What
23belongs in each directory, the rules and examples for good tests, are
24documented in a README.rst file in the directory.
25
Matthew Treinisha9aef872014-07-25 16:03:08 -040026:ref:`api_field_guide`
27----------------------
Sean Dague31a57ad2013-05-07 15:24:05 -040028
29API tests are validation tests for the OpenStack API. They should not
Jordan Pittier74a56ab2017-04-26 16:46:20 +020030use the existing Python clients for OpenStack, but should instead use
31the Tempest implementations of clients. Having raw clients let us
guo yunxiana2216472016-08-01 16:34:43 +080032pass invalid JSON to the APIs and see the results, something we could
33not get with the native clients.
Sean Dague31a57ad2013-05-07 15:24:05 -040034
35When it makes sense, API testing should be moved closer to the
36projects themselves, possibly as functional tests in their unit test
37frameworks.
38
Sean Dague31a57ad2013-05-07 15:24:05 -040039
Matthew Treinisha9aef872014-07-25 16:03:08 -040040:ref:`scenario_field_guide`
41---------------------------
Sean Dague31a57ad2013-05-07 15:24:05 -040042
43Scenario tests are complex "through path" tests for OpenStack
44functionality. They are typically a series of steps where complicated
45state requiring multiple services is set up exercised, and torn down.
46
Jordan Pittier74a56ab2017-04-26 16:46:20 +020047Scenario tests should not use the existing Python clients for OpenStack,
48but should instead use the Tempest implementations of clients.
Sean Dague31a57ad2013-05-07 15:24:05 -040049
Sean Dague31a57ad2013-05-07 15:24:05 -040050
Matthew Treinish817a8082014-07-25 16:07:20 -040051:ref:`unit_tests_field_guide`
52-----------------------------
53
54Unit tests are the self checks for Tempest. They provide functional
Jordan Pittier74a56ab2017-04-26 16:46:20 +020055verification and regression checking for the internal components of Tempest.
56They should be used to just verify that the individual pieces of Tempest are
Matthew Treinish817a8082014-07-25 16:07:20 -040057working as expected.