Part 1 of #2416. It adds code and changes nothing about how the gate runs, so it cannot turn some other test red.
Done looks like:
[ ] scripts/shards.ts exports besideOthers(red, alone, cap = 3). red is a shard's failing files; alone maps a file to whether it passed when run alone. It returns { red: string[], besideOthers: string[], line: string | null }. A file that passed alone moves to besideOthers. A file that failed alone, or was never retried, stays red. Only the first cap files of a shard may be cleared, and the rest stay red. line is fails only beside others: <file> (shard-mates: …), or null.
[ ] Unit tests in test/shards.test.ts cover: cleared, still red, over the cap, and an empty input. Run bun test test/shards.test.ts and quote the result.
Part 1 of #2416. It adds code and changes nothing about how the gate runs, so it cannot turn some other test red.
Done looks like:
scripts/shards.tsexportsbesideOthers(red, alone, cap = 3).redis a shard's failing files;alonemaps a file to whether it passed when run alone. It returns{ red: string[], besideOthers: string[], line: string | null }. A file that passed alone moves tobesideOthers. A file that failed alone, or was never retried, stays red. Only the firstcapfiles of a shard may be cleared, and the rest stay red.lineisfails only beside others: <file> (shard-mates: …), or null.test/shards.test.tscover: cleared, still red, over the cap, and an empty input. Runbun test test/shards.test.tsand quote the result.