feat(test): add batch test selection to the test runner - #2586
Merged
an-tao merged 2 commits intoSep 7, 2026
Conversation
Allow -r to accept multiple test names and start them in the specified order. Validate all requested test names before starting any test and report unknown names. Reject duplicate names immediately to avoid running the same TestCase instance more than once. Add CLI regression coverage for single and batch selection, invalid arguments, test listing, and help output.
den-a-s
marked this pull request as ready for review
September 6, 2026 12:39
Avoid calling exit() from test::run() on CLI early-exit paths. exit() bypasses the unittest main's shutdown sequence, leaving the app event-loop thread running while static objects are destroyed. This can race with Drogon teardown and cause a use-after-free when listing tests. Return the corresponding status instead, so main() can quit the app and join the thread before process teardown.
Author
|
I think it would be better not to squash the commits, since an important bug was discovered and fixed thanks to the new tests. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Allow the Drogon test runner to select several named tests in one invocation:
Why
CI jobs and local development often need to rerun a focused set of related
tests. Previously, -r accepted only one test name, requiring a separate
process for every selected test.
User story
As a developer, I want to pass a list of test names to -r so that I can run
a targeted group of tests with one command while preserving the order in which
I requested them.
Behaviour
-r accepts one or more test names until the next option.
Selected tests are started in the supplied order.
The runner validates every requested name before starting tests; if one or
more names are unknown, it reports all missing names and starts none.
Duplicate names are rejected immediately to avoid running the same
TestCase instance more than once.
--help documents batch syntax and shell expansion, for example
-r $(cat selected-tests.txt).
Existing -s, -l, -h, and unknown-option behaviour is preserved.
Tests
Added CTest CLI coverage for single and batch selection, order preservation,
duplicates, unknown names, missing arguments, unknown options, listing, and
help output.
Ran drogon_test_runner_cli.
Ran the complete unittest suite successfully.