From 4fc89497d05b83c31b981a96fc6e08b0f5a30930 Mon Sep 17 00:00:00 2001 From: Tom Boucher Date: Wed, 22 Jul 2026 20:58:29 -0400 Subject: [PATCH] fix(#2505): set USERPROFILE in kimi-variant test env + add issue refs on allow-test-rule exemptions (#2545) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The kimi-variant-disambiguation test set only HOME in the spawnSync env, but os.homedir() on Windows resolves USERPROFILE — so the installer never found the probe config files and the 'variant mismatch' warning never fired. Every other installer test in the repo sets both HOME and USERPROFILE (agent-skills, augment-upgrades, antigravity-upgrades, etc.); this one was newly written for Phase 5 and missed the pattern. Also: both new test files carried allow-test-rule exemptions without the 'see #NNN' issue reference required by ADR-456, failing lint-allow-test-rule-refs. --- tests/kimi-variant-disambiguation.test.cjs | 4 ++-- tests/resolve-dispatch-type.test.cjs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/kimi-variant-disambiguation.test.cjs b/tests/kimi-variant-disambiguation.test.cjs index 6b00290a4..4d39066a1 100644 --- a/tests/kimi-variant-disambiguation.test.cjs +++ b/tests/kimi-variant-disambiguation.test.cjs @@ -1,4 +1,4 @@ -// allow-test-rule: behavioral-subprocess-test — Phase 5 kimi-variant +// allow-test-rule: behavioral-subprocess-test — see #2505 — Phase 5 kimi-variant // disambiguation is verified via install.js subprocess output capture, since // the disambiguateKimiVariant function is inline in bin/install.js (not // exported). The test sets a disposable HOME, creates the probe config files, @@ -27,7 +27,7 @@ function runInstall(args, home) { // spawnSync captures stdout AND stderr separately regardless of exit code // (execFileSync drops stderr on success, which hid the console.error warnings). const r = spawnSync('node', [INSTALL_JS, ...args], { - env: { ...process.env, HOME: home, GSD_TEST_MODE: '1' }, + env: { ...process.env, HOME: home, USERPROFILE: home, GSD_TEST_MODE: '1' }, encoding: 'utf8', timeout: 15000, }); diff --git a/tests/resolve-dispatch-type.test.cjs b/tests/resolve-dispatch-type.test.cjs index ba4957949..289386491 100644 --- a/tests/resolve-dispatch-type.test.cjs +++ b/tests/resolve-dispatch-type.test.cjs @@ -1,4 +1,4 @@ -// allow-test-rule: behavioral-query-coverage — this test exercises the +// allow-test-rule: behavioral-query-coverage — see #2505 — this test exercises the // resolve-dispatch-type query end-to-end (subprocess) AND the pure // resolveDispatchType function (require), covering the runtime-aware dispatch // contract from epic #2505 Phase 4 (#2508). The query is the workflow-facing