Matthew Treinish | 817a808 | 2014-07-25 16:07:20 -0400 | [diff] [blame] | 1 | .. _unit_tests_field_guide: |
Matthew Treinish | a9aef87 | 2014-07-25 16:03:08 -0400 | [diff] [blame] | 2 | |
Masayuki Igawa | c268dd6 | 2013-09-18 00:51:05 +0900 | [diff] [blame] | 3 | Tempest Field Guide to Unit tests |
| 4 | ================================= |
Matthew Treinish | 32d3570 | 2013-08-13 11:59:06 -0400 | [diff] [blame] | 5 | |
| 6 | What are these tests? |
| 7 | --------------------- |
| 8 | |
| 9 | Unit tests are the self checks for Tempest. They provide functional |
| 10 | verification and regression checking for the internal components of tempest. |
| 11 | They should be used to just verify that the individual pieces of tempest are |
| 12 | working as expected. They should not require an external service to be running |
| 13 | and should be able to run solely from the tempest tree. |
| 14 | |
| 15 | Why are these tests in tempest? |
| 16 | ------------------------------- |
| 17 | These tests exist to make sure that the mechanisms that we use inside of |
| 18 | tempest to are valid and remain functional. They are only here for self |
| 19 | validation of tempest. |
| 20 | |
| 21 | |
| 22 | Scope of these tests |
| 23 | -------------------- |
| 24 | Unit tests should not require an external service to be running or any extra |
| 25 | configuration to run. Any state that is required for a test should either be |
| 26 | mocked out or created in a temporary test directory. (see test_wrappers.py for |
| 27 | an example of using a temporary test directory) |