Skip to content

Support test sharding#1259

Merged
ianthehat merged 2 commits intobazel-contrib:masterfrom
yasushi-saito:sharding
Jan 24, 2018
Merged

Support test sharding#1259
ianthehat merged 2 commits intobazel-contrib:masterfrom
yasushi-saito:sharding

Conversation

@yasushi-saito
Copy link
Copy Markdown
Contributor

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.

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.
@bazel-io
Copy link
Copy Markdown

Can one of the admins verify this patch?

Comment thread go/tools/builders/generate_test_main.go Outdated

func testsInShard() []testing.InternalTest {
totalShards, err := strconv.Atoi(os.Getenv("TEST_TOTAL_SHARDS"))
if err != nil || totalShards <= 0 {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If total shards is 1 you could still just return allTests

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, done.

@googlebot
Copy link
Copy Markdown

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.
In order to pass this check, please resolve this problem and have the pull request author add another comment and the bot will run again. If the bot doesn't comment, it means it doesn't think anything has changed.

@googlebot
Copy link
Copy Markdown

CLAs look good, thanks!

@ianthehat ianthehat merged commit 2aa1ef0 into bazel-contrib:master Jan 24, 2018
@ianthehat
Copy link
Copy Markdown
Contributor

Thanks!

yushan26 pushed a commit to yushan26/rules_go that referenced this pull request Jun 16, 2025
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants