blob: 0587e7b8879caebf8ee196bf161304f00c13b2e7 [file] [log] [blame]
Matthew Treinish817a8082014-07-25 16:07:20 -04001.. _unit_tests_field_guide:
Matthew Treinisha9aef872014-07-25 16:03:08 -04002
Masayuki Igawac268dd62013-09-18 00:51:05 +09003Tempest Field Guide to Unit tests
4=================================
Matthew Treinish32d35702013-08-13 11:59:06 -04005
6What are these tests?
7---------------------
8
9Unit tests are the self checks for Tempest. They provide functional
Jordan Pittier74a56ab2017-04-26 16:46:20 +020010verification and regression checking for the internal components of Tempest.
11They should be used to just verify that the individual pieces of Tempest are
Matthew Treinish32d35702013-08-13 11:59:06 -040012working as expected. They should not require an external service to be running
Jordan Pittier74a56ab2017-04-26 16:46:20 +020013and should be able to run solely from the Tempest tree.
Matthew Treinish32d35702013-08-13 11:59:06 -040014
Jordan Pittier74a56ab2017-04-26 16:46:20 +020015Why are these tests in Tempest?
Matthew Treinish32d35702013-08-13 11:59:06 -040016-------------------------------
17These tests exist to make sure that the mechanisms that we use inside of
Jordan Pittier74a56ab2017-04-26 16:46:20 +020018Tempest are valid and remain functional. They are only here for self
19validation of Tempest.
Matthew Treinish32d35702013-08-13 11:59:06 -040020
21
22Scope of these tests
23--------------------
24Unit tests should not require an external service to be running or any extra
25configuration to run. Any state that is required for a test should either be
26mocked out or created in a temporary test directory. (see test_wrappers.py for
27an example of using a temporary test directory)