feat(FN-3593): add test isolation CI enforcement, fix stuck-requeue race, a
This merge lands five FN-3593 commits establishing a test isolation contract with a new `scripts/check-test-isolation.mjs` guard that scans for accidental `beforeEach`/`afterEach`/`beforeAll`/`afterAll` in setup helpers, plus per-package `setup-test-isolation.ts` bootstraps that canonicalize the pat Fusion-Task-Id: FN-3593
This commit is contained in:
@@ -17,6 +17,7 @@ import {
|
||||
applyCacheToPlan,
|
||||
recordCachePass,
|
||||
cacheFilePath,
|
||||
shouldRunIsolationGuard,
|
||||
} from "../test-changed.mjs";
|
||||
|
||||
import { mkdirSync, writeFileSync, mkdtempSync, rmSync } from "node:fs";
|
||||
@@ -91,6 +92,10 @@ test("shouldForceFullSuite: returns true when scripts/test-changed.mjs changed",
|
||||
assert.equal(shouldForceFullSuite(["scripts/test-changed.mjs"]), true);
|
||||
});
|
||||
|
||||
test("shouldForceFullSuite: returns true when scripts/check-test-isolation.mjs changed", () => {
|
||||
assert.equal(shouldForceFullSuite(["scripts/check-test-isolation.mjs"]), true);
|
||||
});
|
||||
|
||||
test("shouldForceFullSuite: returns true when a GitHub workflow changed", () => {
|
||||
assert.equal(shouldForceFullSuite([".github/workflows/ci.yml"]), true);
|
||||
});
|
||||
@@ -550,3 +555,11 @@ test("cacheFilePath: ends with .fusion/test-cache.json", () => {
|
||||
const p = cacheFilePath();
|
||||
assert.ok(p.endsWith(path.join(".fusion", "test-cache.json")), `got: ${p}`);
|
||||
});
|
||||
|
||||
test("shouldRunIsolationGuard: enabled by default", () => {
|
||||
assert.equal(shouldRunIsolationGuard({}), true);
|
||||
});
|
||||
|
||||
test("shouldRunIsolationGuard: disabled when env flag is set", () => {
|
||||
assert.equal(shouldRunIsolationGuard({ FUSION_TEST_DISABLE_ISOLATION_GUARD: "1" }), false);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user