Skip to content

Commit a5d4742

Browse files
committed
Tighten the gate drift test and document the unguarded test path
The negative assertion missed the likeliest regression: an unguarded run: bun run test step in CI, which passes both prior checks while reintroducing the drift and skipping the projects-dir sandbox. Pin the anchor to end-of-line and note the guard scope in CONTRIBUTING.
1 parent 3563e8a commit a5d4742

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

CONTRIBUTING.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ bun run test
3131
```
3232

3333
These match the CI workflow in `.github/workflows/ci.yml`. Run `bun run check`
34-
(lint, typecheck, build, and the guarded test suite) before opening a PR. Do
34+
(lint, typecheck, build, and the guarded test suite) before opening a PR —
35+
`bun run test` alone skips the projects-dir sandbox guard, which only runs
36+
under `bun run check` and CI. Do
3537
not substitute a bare `bun test` (it also scans
3638
`vendor/` and pollutes pass/fail counts).
3739

tests/unit/check-gate.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@ describe("check gate", () => {
2828
expect(guardSource).toContain('"run", "test"');
2929
});
3030

31-
test("CI's test job invokes the same script, not a raw bun test command", () => {
31+
test("CI's test job invokes the same script, not a raw test command", () => {
3232
expect(ci).toContain(`run: bun run ${GUARD_SCRIPT}`);
33-
expect(ci).not.toMatch(/^\s*run: bun test /m);
33+
// An unguarded suite step here would reintroduce the local-green/CI
34+
// mismatch (and skip the projects-dir sandbox) this gate exists to prevent.
35+
expect(ci).not.toMatch(/^\s*run: bun test(\s|$)/m);
36+
expect(ci).not.toMatch(/^\s*run: bun run test(\s|$)/m);
3437
});
3538
});

0 commit comments

Comments
 (0)