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:
Fusion
2026-05-06 09:33:58 -07:00
committed by gsxdsm
parent 8c18b45750
commit 4556df5954
22 changed files with 536 additions and 156 deletions

View File

@@ -1,20 +1,4 @@
/**
* Global test isolation: prevents dashboard tests from writing to the real ~/.fusion/ directory.
*
* This runs in every Vitest worker before shared setup. By forcing process.env.HOME
* to a fresh temp directory, homedir()-derived paths resolve to isolated locations.
* Deprecated shim: canonical test isolation is in @fusion/core vitest-setup.
*/
import { mkdtempSync } from "node:fs";
import { tmpdir } from "node:os";
import { join } from "node:path";
const tempHome = mkdtempSync(join(tmpdir(), "fn-test-home-"));
process.env.HOME = tempHome;
process.env.USERPROFILE = tempHome;
if (process.platform === "win32") {
const match = tempHome.match(/^([A-Za-z]:)(.*)$/);
if (match) {
process.env.HOMEDRIVE = match[1];
process.env.HOMEPATH = match[2] || "\\";
}
}
import "../../../core/src/__test-utils__/vitest-setup";