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>
This commit is contained in:
garrytanandcapy-ai[bot] committed 2026-10-26 16:12:57 +00:00
1 parent 426fa370ec
commit 9eb149d839
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -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}`}`;
}
+1 -1
View File
@@ -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);
});