From 46da3f1972858db29a54db4d774a6ff2ba081f1c Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Mon, 31 Aug 2026 04:34:57 +0000 Subject: [PATCH] test: wire skippedTests end-to-end through runPaidShard The census unit tests hand-built outcomes and the classifier tests parsed strings; nothing proved a real child's ' N skip' recap flows into outcome.skippedTests and the formatSummary label. A commandFor fake now prints the recap shape and the test asserts the parsed counts, the all-skipped predicate, and the 'verified nothing' label. Co-Authored-By: Claude Fable 5 --- test/paid-shards.test.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/paid-shards.test.ts b/test/paid-shards.test.ts index 1c91da24f..a73922deb 100644 --- a/test/paid-shards.test.ts +++ b/test/paid-shards.test.ts @@ -379,6 +379,27 @@ describe('all-skipped pass census', () => { expect(isAllSkippedPass({ ...base, status: 'passed', executedTests: null, skippedTests: null } as ShardOutcome)).toBe(false); }); + test('wiring: a real child’s skip recap flows through runPaidShard into skippedTests', async () => { + // End-to-end through the actual spawn/classify path (not hand-built + // outcomes): a fake shard child prints bun’s recap shape with every test + // skipped; the outcome must carry the parsed counts and formatSummary + // must label it. This is the seam the unit tests above skip. + const ALL_SKIP = 'console.log(" 0 pass"); console.log(" 3 skip"); console.log(" 0 fail"); console.log("Ran 3 tests across 1 files. [5ms]")'; + const summary = await runPaidShards([['all-skip']], { + timeoutMs: 30_000, + jobs: 1, + commandFor: () => ({ command: process.execPath, args: ['-e', ALL_SKIP] }), + log: () => {}, + }); + const outcome = summary.outcomes[0]; + expect(outcome.status).toBe('passed'); + expect(outcome.executedTests).toBe(3); + expect(outcome.skippedTests).toBe(3); + expect(isAllSkippedPass(outcome)).toBe(true); + const lines = formatSummary(summary); + expect(lines.find((l) => l.includes('all-skip'))).toContain('all 3 tests SKIPPED'); + }, 30_000); + test('formatSummary labels an all-skipped pass and leaves real passes alone', () => { const lines = formatSummary(summarize([ { ...base, status: 'passed', executedTests: 8, skippedTests: 8 } as ShardOutcome,