test(#1975): scope GSD_TEST_MODE off in real-install folds; fix ci-test-scope fixture

gsd-test surfaced 21 failures:
- 19: folded real-install suites (bug-1834 .sh hooks, enh-2380 --skills-root, fix-1521
  install stamping, bug-2136 .sh hook version) spawn install.js and assert side effects,
  but their host suites (install-minimal-hooks/install.test/managed-hooks) set
  GSD_TEST_MODE=1 at collection time — the install child inherited it and suppressed
  the writes. Clear GSD_TEST_MODE in each of those blocks (before/after; standalone had
  it unset), so the child performs a real install.
- 2: ci-test-scope A1 used deleted tests/bug-1974-context-exhaustion-record.test.cjs as a
  fixture; scopeFor filters nonexistent paths, so it fell back to ['unit']. Repointed to
  its consolidation destination tests/perf-317-context-monitor-fs.test.cjs (an existing test).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Tom Boucher
2026-07-03 03:00:05 -04:00
parent 6d072435d0
commit b2ed7940c9
2 changed files with 11 additions and 3 deletions

View File

@@ -285,12 +285,12 @@ describe('ci-test-scope superset invariant (#494, narrowed)', () => {
// so OS-specific breakage in the changed test (the #482 class) is still
// exercised pre-merge. Ubuntu 22/24 coverage comes via targeted_tests.
test('A1: a changed test file joins the windows scoped lane without full_matrix', () => {
const result = scopeFor(['tests/bug-1974-context-exhaustion-record.test.cjs']);
const result = scopeFor(['tests/perf-317-context-monitor-fs.test.cjs']);
assert.strictEqual(result.full_matrix, false,
`expected full_matrix=false for a tests/**-only change, got: ${JSON.stringify(result)}`);
assert.ok(result.targeted_tests.includes('tests/bug-1974-context-exhaustion-record.test.cjs'),
assert.ok(result.targeted_tests.includes('tests/perf-317-context-monitor-fs.test.cjs'),
`expected the changed test in targeted_tests, got: ${JSON.stringify(result.targeted_tests)}`);
assert.ok(result.windows_tests.includes('tests/bug-1974-context-exhaustion-record.test.cjs'),
assert.ok(result.windows_tests.includes('tests/perf-317-context-monitor-fs.test.cjs'),
`expected the changed test in windows_tests, got: ${JSON.stringify(result.windows_tests)}`);
});

View File

@@ -74,6 +74,14 @@ describe('bug #2136: MANAGED_HOOKS must include all shipped hook files', () => {
{
const { describe: __foldDescribe } = require('node:test');
__foldDescribe("folded:bug-2136-sh-hook-version (consolidation epic #1969 B6 #1975)", () => {
// Consolidation #1969: this block spawns a REAL install and asserts side effects.
// The host suite sets GSD_TEST_MODE=1 at collection time, which the install child
// inherits via process.env and which suppresses hook/skill writes. Clear it for
// this block's duration (standalone had it unset); restore after.
const { before: __gtmBefore, after: __gtmAfter } = require('node:test');
let __savedGsdTestMode;
__gtmBefore(() => { __savedGsdTestMode = process.env.GSD_TEST_MODE; delete process.env.GSD_TEST_MODE; });
__gtmAfter(() => { if (__savedGsdTestMode === undefined) delete process.env.GSD_TEST_MODE; else process.env.GSD_TEST_MODE = __savedGsdTestMode; });
// allow-test-rule: structural-regression-guard (see #2136)
// The shebang line must be `#!/usr/bin/env bash` (PATH-resolved) rather than