Skip to content

Add --durations N flag#507

Merged
MatthewMckee4 merged 2 commits intomainfrom
add-durations-flag
Mar 3, 2026
Merged

Add --durations N flag#507
MatthewMckee4 merged 2 commits intomainfrom
add-durations-flag

Conversation

@MatthewMckee4
Copy link
Member

Summary

  • Add a --durations N CLI flag that displays the N slowest tests after a run completes
  • Aggregates per-worker duration data (already cached in durations.json) into AggregatedResults and prints a sorted summary
  • Supports edge cases: N=0 shows header only, N > test_count shows all tests, works alongside failing tests

Closes #466

Test plan

  • durations_shows_slowest_tests — verifies top-N sorting with sleep-based timing
  • durations_shows_all_when_n_exceeds_test_count — verifies graceful handling when N > total tests
  • durations_zero_shows_header_only — verifies N=0 edge case
  • durations_with_failing_tests — verifies durations display alongside failure diagnostics
  • All 681 existing tests pass
  • Pre-commit checks pass

🤖 Generated with Claude Code

@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-durations-flag (a56b66c) with main (80ccaf5)

Open in CodSpeed

MatthewMckee4 and others added 2 commits March 3, 2026 15:17
Add a `--durations N` CLI flag that displays the N slowest tests after
a run completes. Duration data was already collected and cached in
`durations.json` -- this adds a summary reporter that sorts and prints
the top N at the end of the run.

Closes #466

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@MatthewMckee4 MatthewMckee4 merged commit b8b92c6 into main Mar 3, 2026
8 checks passed
@MatthewMckee4 MatthewMckee4 deleted the add-durations-flag branch March 3, 2026 15:26
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 --durations N flag

1 participant