From 9eb149d8398bd795290b260c92ea314ce443df61 Mon Sep 17 00:00:00 2001 From: garrytan Date: Mon, 26 Oct 2026 16:12:57 +0000 Subject: [PATCH] stack-tests: drop the dead detail clause and assert the worktree is gone r.detail === 'pass' can never hold when r.ok is false; the dry-run test now checks git worktree list instead of a state-dir name that was never written. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --- lib/ship-queue-stack-tests.ts | 2 +- test/ship-queue-train-ops.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ship-queue-stack-tests.ts b/lib/ship-queue-stack-tests.ts index 9f94a5b1f..cca639e1d 100644 --- a/lib/ship-queue-stack-tests.ts +++ b/lib/ship-queue-stack-tests.ts @@ -58,5 +58,5 @@ export function stackTests(repoRoot: string, baseSha: string, slots: TrainSlot[] /** One `STACK_TESTS:` line per slot. */ export function stackTestLine(r: StackTestResult): string { if (!r.files.length) return `STACK_TESTS: #${r.pr} T${r.prefix} no new test files`; - return `STACK_TESTS: #${r.pr} T${r.prefix} ${r.files.length} new test file(s) ${r.ok ? 'pass' : 'FAIL'} (${r.files.join(', ')})${r.ok || r.detail === 'pass' ? '' : `: ${r.detail}`}`; + return `STACK_TESTS: #${r.pr} T${r.prefix} ${r.files.length} new test file(s) ${r.ok ? 'pass' : 'FAIL'} (${r.files.join(', ')})${r.ok ? '' : `: ${r.detail}`}`; } diff --git a/test/ship-queue-train-ops.test.ts b/test/ship-queue-train-ops.test.ts index ff6189e6a..e6fef30c6 100644 --- a/test/ship-queue-train-ops.test.ts +++ b/test/ship-queue-train-ops.test.ts @@ -419,7 +419,7 @@ describe('train build --dry-run --stack-tests', () => { 'STACK_TESTS: #2 T1 1 new test file(s) pass (test/pr-2.test.ts)', 'STACK_TESTS: #1 T2 1 new test file(s) pass (test/pr-1.test.ts)', 'STACK_TESTS: #3 T3 no new test files']); - expect(fs.readdirSync(path.join(fx.state, 'ship-queue')).filter(n => n.startsWith('stack-tests'))).toEqual([]); + expect(fx.repo.git('worktree', 'list', '--porcelain')).not.toContain('gstack-stack-tests-'); expect(queue(fx, ['train', 'build', '--prs', `1@${h1}`, '--stack-tests']).status).toBe(EXIT.usage); }, 180_000); });