rules_scala icon indicating copy to clipboard operation
rules_scala copied to clipboard

Supporting test sharding

Open jadenPete opened this issue 11 months ago • 0 comments
trafficstars

This issue is part of a broader proposal to merge some of the features in lucidsoftware/rules_scala into this ruleset.

The tracking issue for this effort

The relevant proposal section.

Bazel has a test sharding feature that test runners can choose to support. From the documentation on test sharding:

Tests can be parallelized via test sharding. See --test_sharding_strategy and shard_count to enable test sharding. When sharding is enabled, the test runner is launched once per shard. The environment variable TEST_TOTAL_SHARDS is the number of shards, and TEST_SHARD_INDEX is the shard index, beginning at 0. Runners use this information to select which tests to run - for example, using a round-robin strategy. Not all test runners support sharding.

Test sharding imposes a couple benefits:

  • It's an easy way to speed up large test targets
  • It's helpful in end-to-end testing, where each running test can spin up its own web browser

We rely on test sharding extensively at Lucid Software and would like to implement it in bazelbuild/rules_scala.

jadenPete avatar Dec 09 '24 14:12 jadenPete