File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,11 @@ func testsInShard() []testing.InternalTest {
146146 if err != nil || totalShards <= 1 {
147147 return allTests
148148 }
149+ file, err := os.Create(os.Getenv("TEST_SHARD_STATUS_FILE"))
150+ if err != nil {
151+ log.Fatalf("Failed to touch TEST_SHARD_STATUS_FILE: %v", err)
152+ }
153+ _ = file.Close()
149154 shardIndex, err := strconv.Atoi(os.Getenv("TEST_SHARD_INDEX"))
150155 if err != nil || shardIndex < 0 {
151156 return allTests
Original file line number Diff line number Diff line change @@ -244,6 +244,12 @@ go_test(
244244 ],
245245)
246246
247+ go_test (
248+ name = "sharding_test" ,
249+ srcs = ["sharding_test.go" ],
250+ shard_count = 2 ,
251+ )
252+
247253go_bazel_test (
248254 name = "env_inherit_test" ,
249255 srcs = ["env_inherit_test.go" ],
Original file line number Diff line number Diff line change 1+ package sharding_test
2+
3+ import (
4+ "log"
5+ "os"
6+ "testing"
7+ )
8+
9+ func TestShardStatusFile (t * testing.T ) {
10+ if _ , err := os .Stat (os .Getenv ("TEST_SHARD_STATUS_FILE" )); err != nil {
11+ log .Fatalf ("Expected Go test runner to create TEST_SHARD_STATUS_FILE: %v" , err )
12+ }
13+ }
You can’t perform that action at this time.
0 commit comments