Support test sharding#1259
Support test sharding#1259ianthehat merged 2 commits intobazel-contrib:masterfrom yasushi-saito:sharding
Conversation
Passing shard_count=N to a go_test rule will run the test in N process, with each process sharding the tests in a round-robin fashion.
|
Can one of the admins verify this patch? |
|
|
||
| func testsInShard() []testing.InternalTest { | ||
| totalShards, err := strconv.Atoi(os.Getenv("TEST_TOTAL_SHARDS")) | ||
| if err != nil || totalShards <= 0 { |
There was a problem hiding this comment.
If total shards is 1 you could still just return allTests
|
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. |
|
CLAs look good, thanks! |
|
Thanks! |
This makes rules_python always provide a default toolchain when using bzlmod. Note that, unlike workspace builds, the default is not the local system Python (`@bazel_tools//tools/python:autodetecting_toolchain`). Instead, the default is a hermetic runtime, but no guarantees are made about the particular version used. In practice, it will be the latest available Python version. Work towards bazel-contrib#1233
Passing shard_count=N to a go_test rule will run the test in N process, with
each process sharding the tests in a round-robin fashion.