diff --git a/tests/system/ci-runner/ci-evidence-freshness.test.ts b/tests/system/ci-runner/ci-evidence-freshness.test.ts index f7057563..56d67614 100644 --- a/tests/system/ci-runner/ci-evidence-freshness.test.ts +++ b/tests/system/ci-runner/ci-evidence-freshness.test.ts @@ -6,6 +6,12 @@ import path from "node:path"; import { afterEach, describe, expect, it } from "vitest"; import { loadCiGateContract } from "../../../scripts/contracts/ci-gates.ts"; +import { FIXTURE_PNPM_ENVIRONMENT } from "../../../scripts/lib/fixture-node-modules.ts"; + +// F-12. The temp roots have a package.json but no node_modules or lockfile. +// Run directly (not under pnpm), pnpm's pre-script install check started an +// install there and failed with ERR_PNPM_IGNORED_BUILDS; the gate runner has +// to run the scripts as they are. const temporaryRoots: string[] = []; @@ -58,7 +64,7 @@ describe("CI-runner command-generated evidence freshness", () => { const result = spawnSync( process.execPath, [path.resolve("scripts/run-ci-gate.ts"), "FE-GATE-004"], - { cwd: root, encoding: "utf8", env: { ...process.env, CI: "false" } }, + { cwd: root, encoding: "utf8", env: { ...process.env, ...FIXTURE_PNPM_ENVIRONMENT, CI: "false" } }, ); expect(result.status).toBe(1); @@ -112,7 +118,7 @@ describe("CI-runner command-generated evidence freshness", () => { const result = spawnSync( process.execPath, [path.resolve("scripts/run-ci-gate.ts"), "FE-GATE-004"], - { cwd: root, encoding: "utf8", env: { ...process.env, CI: "false" } }, + { cwd: root, encoding: "utf8", env: { ...process.env, ...FIXTURE_PNPM_ENVIRONMENT, CI: "false" } }, ); expect(result.status).toBe(0); @@ -165,7 +171,7 @@ describe("CI-runner gate output budget", () => { { cwd: root, encoding: "utf8", - env: { ...process.env, CI: "false" }, + env: { ...process.env, ...FIXTURE_PNPM_ENVIRONMENT, CI: "false" }, timeout: 15_000, }, );