-
Notifications
You must be signed in to change notification settings - Fork 6.2k
cmake: Introduce ctest labels for testing #29844
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,6 +48,38 @@ functions, which are themselves defined in | |
| others are binaries that are compiled during the build process. The | ||
| ``add_ceph_test`` function is used to declare unit test scripts, while | ||
| ``add_ceph_unittest`` is used for unit test binaries. | ||
| ``add_tox_test`` declare tests that require ``tox`` for testing and sets up | ||
| the full environment for this during testing. | ||
| :: | ||
|
|
||
| add_ceph_test(test_name test_path <args> <options>) | ||
| add_ceph_unittest(test_name <args> <options>) | ||
| add_tox_test(test_name <args> <options>) | ||
| args: any parameter, not being an options keyword | ||
| options: | ||
| [COST <float>] | ||
| Order of testing is set by COST. | ||
| Highest COST are tested first. | ||
| [TIMEOUT sec] | ||
| Restrict the max runtime of this test to <sec> | ||
| [LABELS "labels"] | ||
| Append "labels" to a test. | ||
| Labels can be selected with ctest -L or -LE | ||
|
|
||
| Since COST is used to determine the testing order, values can be chosen rather | ||
| arbitrarily. Currently long running programs are given a value equal to the | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Zac may have a different view, but I'd make it long-running. |
||
| execution time in a OpenStack VM. The idea is to first run the long standing | ||
| tests, and then fill up free cores with programs with shorter execution time. | ||
| Turning this into a bin-packing challenge, So the exact value is not important, | ||
| it is about the relative COST value. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
"The idea is to first run the long-running tests, and then fill unused cores with tests with shorter execution time.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The main purpose here is to prevent that run in a multi-core environment and try to schedule to very long running jobs at the end of test-run, since that could extend the test-run time with like 5 - 10 minutes. 'Openstack ' refers to the fact that I was running these builds in an OpenStack system. But like I indicated |
||
|
|
||
| Currently some LABELS are introduced:: | ||
|
|
||
| unittest as declared above (DEF COST = 5) | ||
| tox the test used tox to do the testing (DEF COST = 25) | ||
| long when the test executes for more than 60 secs (DEF COST = 50) | ||
| vstart when the test uses vsstart.sh to setup a cluster | ||
|
|
||
|
|
||
| Unit testing of CLI tools | ||
| ------------------------- | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,5 @@ | ||
| # scripts | ||
| add_ceph_test(check-generated.sh ${CMAKE_CURRENT_SOURCE_DIR}/check-generated.sh) | ||
| add_ceph_test(readable.sh ${CMAKE_CURRENT_SOURCE_DIR}/readable.sh) | ||
| add_ceph_test(check-generated.sh ${CMAKE_CURRENT_SOURCE_DIR}/check-generated.sh | ||
| LABELS "long" COST 619.0) | ||
| add_ceph_test(readable.sh ${CMAKE_CURRENT_SOURCE_DIR}/readable.sh | ||
| LABELS "long" COST 813.0) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| add_ceph_test(test_ceph_daemon.py ${CMAKE_CURRENT_SOURCE_DIR}/test_ceph_daemon.py) | ||
| add_ceph_test(test_ceph_argparse.py ${CMAKE_CURRENT_SOURCE_DIR}/test_ceph_argparse.py) | ||
| add_ceph_test(test_ceph_argparse.py ${CMAKE_CURRENT_SOURCE_DIR}/test_ceph_argparse.py | ||
| LABELS "long" COST 104.0) |
Uh oh!
There was an error while loading. Please reload this page.