Wrap the given test so that it can be run on Github Actions with sharding. This makes it possible to run only 1/N tests on each of N github action jobs, speeding up test execution through parallelization. This is necessary since the wrapped integration tests rely on OS-level globals (the shell histo
(test func(t *testing.T))
| 377 | // integration tests rely on OS-level globals (the shell history) that can't otherwise |
| 378 | // be parallelized. |
| 379 | func wrapTestForSharding(test func(t *testing.T)) func(t *testing.T) { |
| 380 | shardNumberAllocator += 1 |
| 381 | return func(t *testing.T) { |
| 382 | testShardNumber := shardNumberAllocator |
| 383 | markTestForSharding(t, testShardNumber) |
| 384 | test(t) |
| 385 | } |
| 386 | } |
| 387 | |
| 388 | var shardNumberAllocator int = 0 |
| 389 |