mirror of
https://github.com/oven-sh/bun
synced 2026-02-11 11:29:02 +00:00
#### (Copies commits from #26447) ## Summary - Add a global `--retry <N>` flag to `bun test` that sets a default retry count for all tests (overridable by per-test `{ retry: N }`). Also configurable via `[test] retry = N` in bunfig.toml. - When a test passes after one or more retries, the JUnit XML reporter emits a separate `<testcase>` entry for each failed attempt (with `<failure>`), followed by the final passing `<testcase>`. This gives flaky test detection tools per-attempt timing and result data using standard JUnit XML that all CI systems can parse. ## Test plan - `bun bd test test/js/junit-reporter/junit.test.js` — verifies separate `<testcase>` entries appear in JUnit XML for tests that pass after retry - `bun bd test test/cli/test/retry-flag.test.ts` — verifies the `--retry` CLI flag applies a default retry count to all tests ## Changelog <!-- CHANGELOG:START --> - Added `--retry <N>` flag to `bun test` to set a default retry count for all tests - Added `[test] retry` option to bunfig.toml - JUnit XML reporter now emits separate `<testcase>` entries for each retry attempt, providing CI visibility into flaky tests <!-- CHANGELOG:END --> --------- Co-authored-by: Chris Lloyd <chrislloyd@anthropic.com> Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>