-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Allow sharded execution for bazel test sharding support #2257
Conversation
541c1d1
to
a17927f
Compare
Codecov Report
@@ Coverage Diff @@
## devel #2257 +/- ##
==========================================
- Coverage 91.06% 90.98% -0.08%
==========================================
Files 150 151 +1
Lines 7139 7187 +48
==========================================
+ Hits 6501 6539 +38
- Misses 638 648 +10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, didn't have time to go through this sooner.
I like the general idea, but there is a bunch of changes to be done before merging.
All great comments. I've tried my best to address them in the latest commit. Would you mind taking another look? |
I probably won't get to the tests till tomorrow. |
Thanks, it looks pretty good now, but I think you went overboard on reducing the test script. What I would want to see is:
Since the expensive part is calling into the binary, rather than doing extra processing of the data on the Python side, it is possible to also add extra checks along the way, e.g. checking that the binary obeys |
a3169e4
to
60442bb
Compare
This greatly simplifies running Catch2 tests in single binary in parallel from external test runners. Instead of having to shard the tests by tags/test names, an external test runner can now just ask for test shard 2 (out of X), and execute that in single process, without having to know what tests are actually in the shard. Note that sharding also applies to test listing, and happens after tests were ordered according to the `--order` feature.
c176973
to
6ac20a0
Compare
Description
This PR adds support for splitting test execution across multiple invocations of the test binary (otherwise known as test sharding). The tests to run are split evenly into the number of groups given by the new
Config::shardCount()
, and the group at the index given by the newConfig::shardIndex()
is executed. The intended use is that multiple processes will be run, each with the same shard count, but different shard indices. Sharding works for executing as well as listing tests, and is applied after the list of tests to execute has been created (after filters).The main motivation is to allow Bazel test sharding to work: