diff --git a/test/plan-review-report-recording.test.ts b/test/plan-review-report-recording.test.ts index d28a96dc0..367278154 100644 --- a/test/plan-review-report-recording.test.ts +++ b/test/plan-review-report-recording.test.ts @@ -25,8 +25,11 @@ type Scenario = { kind: string; table?: string; exitReason?: string; open?: bool // Run the copied section's real Outside Voice preflight against a state root. function outsideMode(section: string, home: string, gstackHome?: string): string { const block = section.slice(section.indexOf('**Preflight — decide whether and how the outside voice runs:**')).match(/```bash\n([\s\S]*?)```/)![1]; - const child = Bun.spawnSync(['bash', '-c', block.replaceAll('"$HOME/.claude/skills/gstack/bin/gstack-config"', JSON.stringify(path.join(ROOT, 'bin/gstack-config')))], { - env: { PATH: process.env.PATH ?? '', HOME: home, ...(gstackHome ? { GSTACK_HOME: gstackHome } : {}) }, timeout: 10_000 }); + // Git Bash on Windows needs its own spelling of the checkout path. + const bin = Bun.spawnSync(['bash', '-c', 'cd "$1" && pwd', '_', path.join(ROOT, 'bin')], { timeout: 10_000 }).stdout.toString().trim(); + const child = Bun.spawnSync(['bash', '-c', block.replaceAll('"$HOME/.claude/skills/gstack/bin/gstack-config"', '"$GSTACK_CONFIG_BIN"')], { + env: { PATH: process.env.PATH ?? '', HOME: home, GSTACK_CONFIG_BIN: `${bin}/gstack-config`, + ...(process.env.SystemRoot ? { SystemRoot: process.env.SystemRoot } : {}), ...(gstackHome ? { GSTACK_HOME: gstackHome } : {}) }, timeout: 10_000 }); return child.stdout.toString().trim(); } diff --git a/test/shared-libs-checker-interface-evidence.test.ts b/test/shared-libs-checker-interface-evidence.test.ts index 8d4021038..084677cc4 100644 --- a/test/shared-libs-checker-interface-evidence.test.ts +++ b/test/shared-libs-checker-interface-evidence.test.ts @@ -704,10 +704,11 @@ describe('errored Bash reads from the captured ignored-path review', () => { expect(hasTrustedSharedLibsCheck(events, erroredRead.expected)).toBe(true); }); - test.each(['no expected sources', 'last source line missing', 'missing file', 'errored single read', 'errored native Read', 'errored checker'])('%s is still rejected', shape => { + test.each(['no expected sources', 'empty expected source', 'last source line missing', 'missing file', 'errored single read', 'errored native Read', 'errored checker'])('%s is still rejected', shape => { const events = structuredClone(erroredRead.events), call = read(events), result = output(events, call.id); const expected: any = structuredClone(erroredRead.expected); if (shape === 'no expected sources') delete expected.sources; + if (shape === 'empty expected source') expected.sources['src/retry-worker.ts'] = ''; if (shape === 'last source line missing') result.content = result.content.replace(/\n +15\t\}\n/, '\n'); if (shape === 'missing file') result.content = 'Exit code 1\ncat: src/retry-worker.ts: No such file or directory'; if (shape === 'errored single read') call.input.command = 'cat -n src/retry-worker.ts';