-
-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add way to run individual tests to cinder_test_runner.py
Summary: Adds a new sub-command to `cinder_test_runner.py` which efficiently runs individual tests. This brings together 3 features which were previously split betweeen 3 different test tools: * From `python -m test` - test features like refleak checking (`-R`), and environment change detection. * From `python -m unittest` - fine-grain test specification e.g. `test.test_asyncgen.AsyncGenTest` to select a single class of tests rather than the whole `test_asyncgen` module. * From `cinder_test_runner.py` - respect CinderX skip rules in .txt files (see D50354346). Also as I hope we start using this as the default way to run specific tests, it provides a central location to: * Add `test_cinderx` to the default tests search path. * Unlimit the native stack size. While the above fixes some annoying usability issues with CPython's various test tools, the primary motivation is reducing changes to CPython for CinderX. This allows us skip tests under certain conditions without adding annotations to core Python tests. Instead the skipping features of `cinder_test_runner.py` are used instead. The major downside of this approach is the only way to implement this without reinventing everything is heavy use of monkey-patching. monkeypatch # Example Usages Run a specific test class: ``` $ ./python CinderX/TestScripts/cinder_test_runner.py test -t test.test_asyncgen.AsyncGenTest ............ == Tests result: SUCCESS == 1 test OK. Total duration: 112 ms Tests result: SUCCESS ``` Run a refleak test on a specific test method: ``` $ ./python CinderX/TestScripts/cinder_test_runner.py test -t test.test_asyncgen.AsyncGenTest.test_async_gen_api_01 -- -R : beginning 9 repetitions 123456789 ......... == Tests result: SUCCESS == 1 test OK. Total duration: 458 ms Tests result: SUCCESS ``` Reviewed By: oclbdk Differential Revision: D50663286 fbshipit-source-id: 86f80acb7338f69080c5d0a0ba7b17f30824ed1f
- Loading branch information
1 parent
19790af
commit cf9ee67
Showing
1 changed file
with
184 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters