From b2ed7940c9c5654b3889d7f44ba250fcecf2cda1 Mon Sep 17 00:00:00 2001 From: Tom Boucher Date: Fri, 3 Jul 2026 03:00:05 -0400 Subject: [PATCH] test(#1975): scope GSD_TEST_MODE off in real-install folds; fix ci-test-scope fixture MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- tests/ci-test-scope.test.cjs | 6 +++--- tests/managed-hooks.test.cjs | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/ci-test-scope.test.cjs b/tests/ci-test-scope.test.cjs index 4642eda6e..670ae7224 100644 --- a/tests/ci-test-scope.test.cjs +++ b/tests/ci-test-scope.test.cjs @@ -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)}`); }); diff --git a/tests/managed-hooks.test.cjs b/tests/managed-hooks.test.cjs index 4f4071d20..271267d7b 100644 --- a/tests/managed-hooks.test.cjs +++ b/tests/managed-hooks.test.cjs @@ -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