Skip to content

Add --last-failed / --lf flag#508

Merged
MatthewMckee4 merged 1 commit intomainfrom
add-last-failed-flag
Mar 3, 2026
Merged

Add --last-failed / --lf flag#508
MatthewMckee4 merged 1 commit intomainfrom
add-last-failed-flag

Conversation

@MatthewMckee4
Copy link
Member

Summary

Closes #464.

  • Add --last-failed / --lf CLI flag to re-run only tests that failed in the previous run
  • Workers now write per-run failed_tests.json files alongside existing stats/diagnostics/durations
  • Aggregated failed test names are persisted to last-failed.json at the cache root after each run
  • When --last-failed is passed, the partition step filters collected tests against the last-failed list
  • If no previous failures exist (or no cache), all tests run normally

Test plan

  • last_failed_reruns_only_failures -- verifies only failing tests re-run
  • last_failed_lf_alias -- verifies the --lf alias works
  • last_failed_with_no_previous_failures_runs_all -- all pass on previous run, so all re-run
  • last_failed_without_previous_run_runs_all -- no cache at all, all tests run
  • Full test suite passes (681/681)
  • CLI docs regenerated
  • Pre-commit checks pass

🤖 Generated with Claude Code

Track which tests failed in each run and allow re-running only those
tests on the next invocation. Workers write per-run `failed_tests.json`
files, which are aggregated into a root `last-failed.json` in the cache
directory. When `--last-failed` (or `--lf`) is passed, the partition
step filters the collected tests to only those present in the
last-failed list.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@MatthewMckee4 MatthewMckee4 merged commit 80ccaf5 into main Mar 3, 2026
8 checks passed
@MatthewMckee4 MatthewMckee4 deleted the add-last-failed-flag branch March 3, 2026 15:15
@codspeed-hq
Copy link

codspeed-hq bot commented Mar 3, 2026

Merging this PR will not alter performance

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

✅ 1 untouched benchmark


Comparing add-last-failed-flag (beba6e2) with main (777db22)

Open in CodSpeed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add --last-failed / --lf flag

1 participant