test(FN-3607): harden test workflow verification and isolation checks

- Expand test-changed coverage and shard selection assertions for CI workflows
- Improve vitest worker temp-directory utilities and related core/CLI tests
- Refine test isolation guardrails and runtime ignore handling for live .fusion noise
- Update contributing guidance and root test script usage for the verified workflow

Fusion-Task-Id: FN-3607
This commit is contained in:
Fusion
2026-05-06 11:51:31 -07:00
committed by gsxdsm
parent a8bfb32c70
commit d8fd83a921
10 changed files with 204 additions and 48 deletions

View File

@@ -213,7 +213,7 @@ describe("Workspace bootstrap script contract", () => {
it("makes root test changed-only while keeping explicit full-suite and CI-shard commands", () => {
expect(rootPkg.scripts?.test).toBe("node scripts/test-changed.mjs");
expect(rootPkg.scripts?.["test:full"]).toContain("pnpm -r --workspace-concurrency=2 test");
expect(rootPkg.scripts?.["test:full"]).toBe("node scripts/test-changed.mjs --full --no-cache");
expect(rootPkg.scripts?.["test:full"]).not.toContain("pnpm build");
expect(rootPkg.scripts?.["test:ci:shard"]).toBe("node scripts/ci-test-shard.mjs");
});

View File

@@ -9,8 +9,8 @@ import { parseShardArgs, selectShardPackages } from "../../../../scripts/ci-test
describe("root test command changed-only planning", () => {
it("uses changed mode when package-only changes are detected", () => {
const packageMap = new Map([
["core", "@fusion/core"],
["engine", "@fusion/engine"],
["packages/core", "@fusion/core"],
["packages/engine", "@fusion/engine"],
]);
const plan = decideExecutionPlan({
@@ -28,7 +28,7 @@ describe("root test command changed-only planning", () => {
forceFullSuite: false,
comparisonBase: "abc123",
changedFiles: ["scripts/test-with-lock.mjs"],
packageNameByDir: new Map([["core", "@fusion/core"]]),
packageNameByDir: new Map([["packages/core", "@fusion/core"]]),
});
expect(plan).toEqual({ mode: "full", reason: "shared-infra-changed" });