You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running the Jest suite (npx jest --config .jest.config.cjs) modifies the working tree:
Modifies a tracked file:scripts/automation/__tests__/performance/results-phase-2b.json, written by phase-2b-validation.test.js (line 242).
Creates untracked files:.github/reports/metrics/collection-summary-<date>.json via scripts/workflows/metrics-collection-orchestrator.cjs (exercised by metrics-collection-orchestrator.test.js), and .github/reports/changelog-metrics/<date>.json via agents/changelog-agent/includes/metricsSnapshotBuilder.cjs (default metricsDir, lines 180/226).
A developer running the suite and then git add -A or git commit -a commits test output, and CI runs are not hermetic.
Change
Tests write only to os.tmpdir() (for example fs.mkdtempSync), or inject an output directory into the module under test.
results-phase-2b.json: if it is a committed baseline, the test should read it and never write it; if it is output, move it to a temp dir and untrack it.
Problem
Running the Jest suite (
npx jest --config .jest.config.cjs) modifies the working tree:scripts/automation/__tests__/performance/results-phase-2b.json, written byphase-2b-validation.test.js(line 242)..github/reports/metrics/collection-summary-<date>.jsonviascripts/workflows/metrics-collection-orchestrator.cjs(exercised bymetrics-collection-orchestrator.test.js), and.github/reports/changelog-metrics/<date>.jsonviaagents/changelog-agent/includes/metricsSnapshotBuilder.cjs(defaultmetricsDir, lines 180/226).A developer running the suite and then
git add -Aorgit commit -acommits test output, and CI runs are not hermetic.Change
os.tmpdir()(for examplefs.mkdtempSync), or inject an output directory into the module under test.results-phase-2b.json: if it is a committed baseline, the test should read it and never write it; if it is output, move it to a temp dir and untrack it.git status --porcelainmust be empty. Wire this into the test workflow planned in fix(ci): no workflow runs the Jest suite, so test regressions merge green #3479.Acceptance
npx jest --config .jest.config.cjs && git status --porcelainprints nothing on a clean checkout.Found while verifying #3477/#3478.