Skip to content

Commit

Permalink
Enable test sharding for bazel_example_test
Browse files Browse the repository at this point in the history
Test sharding run the same "bazel" test in parallel. The
unittest.bash framework then distribute the test functions
equally on the various shard.

--
MOS_MIGRATED_REVID=90990754
  • Loading branch information
damienmg authored and philwo committed Apr 14, 2015
1 parent 3c380eb commit f5c6097
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/test/shell/bazel/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ sh_test(
name = "bazel_example_test",
srcs = ["bazel_example_test.sh"],
data = [":test-deps"],
shard_count = 3,
)

sh_test(
Expand Down
2 changes: 1 addition & 1 deletion src/test/shell/unittest.bash
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ function __update_shards() {
TESTS=$(for test in "${TESTS[@]}"; do echo "$test"; done |
awk "NR % $TEST_TOTAL_SHARDS == $TEST_SHARD_INDEX")

[ -n "$TEST_SHARD_STATUS_FILE" ] && touch "$TEST_SHARD_STATUS_FILE"
[ -z "${TEST_SHARD_STATUS_FILE-}" ] || touch "$TEST_SHARD_STATUS_FILE"
}

# Usage: __test_terminated <signal-number>
Expand Down

0 comments on commit f5c6097

Please sign in to comment.