Skip to content

Commit 7585f3c

Browse files
committed
Pin the CI shard path union in the check gate
1 parent 5827d20 commit 7585f3c

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎tests/unit/check-gate.test.ts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,16 @@ describe("check gate", () => {
4343
expect(ci).not.toMatch(/^\s*run: bun test(\s|$)/m);
4444
expect(ci).not.toMatch(/^\s*run: bun run test(\s|$)/m);
4545
});
46+
47+
test("CI test shards cover exactly the suite's paths", () => {
48+
// Sharding must never silently drop part of the suite: the union of the
49+
// matrix shards has to equal the unsharded `test` script's paths.
50+
const shardPaths = [...ci.matchAll(/^\s+paths: (.+)$/gm)]
51+
.flatMap((match) => match[1]?.trim().split(/\s+/) ?? [])
52+
.sort();
53+
const suitePaths = TEST_SUITE.split(" ")
54+
.filter((part) => part.startsWith("./"))
55+
.sort();
56+
expect(shardPaths).toEqual(suitePaths);
57+
});
4658
});

0 commit comments

Comments
 (0)