blob: 081dd07e6acbbbe47c7fde8a5abaf30b138139bf [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-------------------------------
Martin Kopecd76178e2024-01-16 20:43:56 +010017
Matthew Treinish32d35702013-08-13 11:59:06 -040018These tests exist to make sure that the mechanisms that we use inside of
Jordan Pittier74a56ab2017-04-26 16:46:20 +020019Tempest are valid and remain functional. They are only here for self
20validation of Tempest.
Matthew Treinish32d35702013-08-13 11:59:06 -040021
22
23Scope of these tests
24--------------------
Martin Kopecd76178e2024-01-16 20:43:56 +010025
Matthew Treinish32d35702013-08-13 11:59:06 -040026Unit tests should not require an external service to be running or any extra
27configuration to run. Any state that is required for a test should either be
28mocked out or created in a temporary test directory. (see test_wrappers.py for
29an example of using a temporary test directory)