also looking at this
Add deterministic test sharding for distributed CI
#22
10 files
+322
-5
| @@ -276,6 +276,16 @@ pub fn build(b: *std.Build) void { | ||
| 276 | 276 | run_invalid_config.expectExitCode(2); |
| 277 | 277 | test_step.dependOn(&run_invalid_config.step); |
| 278 | 278 | |
| 279 | // Exercise both sides of a file-level shard split. One shard runs the | |
| 280 | // fixture and the other is intentionally empty; both are valid CI jobs. | |
| 281 | const run_shard_one = b.addRunArtifact(exe); | |
| 282 | run_shard_one.addArgs(&.{ "--test-dir", "tests", "--pattern", "sample.test.zig", "--shard-index", "1", "--shard-count", "2", "--no-color" }); | |
| 283 | test_step.dependOn(&run_shard_one.step); | |
| 284 | ||
| 285 | const run_shard_two = b.addRunArtifact(exe); | |
| 286 | run_shard_two.addArgs(&.{ "--test-dir", "tests", "--pattern", "sample.test.zig", "--shard-index", "2", "--shard-count", "2", "--no-color" }); | |
| 287 | test_step.dependOn(&run_shard_two.step); | |
| 288 | ||
| 279 | 289 | const run_version = b.addRunArtifact(exe); |
| 280 | 290 | run_version.addArg("--version"); |
| 281 | 291 | run_version.expectStdErrEqual(b.fmt("Zig Test Framework v{s}\n", .{package_version})); |