Skip to content

Add --dry-run flag to karva test#479

Merged
MatthewMckee4 merged 1 commit intomainfrom
add-dry-run-flag
Feb 13, 2026
Merged

Add --dry-run flag to karva test#479
MatthewMckee4 merged 1 commit intomainfrom
add-dry-run-flag

Conversation

@MatthewMckee4
Copy link
Member

Summary

  • Add --dry-run flag to karva test that prints discovered tests without executing them
  • Extract collect_tests() from run_parallel_tests() in karva_runner for reuse
  • Output sorted test names as <test> module::function with a summary count (N tests collected)

Closes #465

Test plan

  • test_dry_run — multiple files, verifies sorted output and count
  • test_dry_run_empty — empty project, verifies 0 tests collected
  • test_dry_run_with_path_filter — verifies --dry-run respects path arguments
  • Full test suite passes (just test — 631 tests)
  • Pre-commit checks pass (uvx prek run -a)

When set, karva collects tests via AST parsing but skips worker spawning
and execution. Output is a sorted list of collected test names followed
by a summary count, useful for verifying test discovery, debugging
filters, and CI scripting.

Closes #465
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 13, 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-dry-run-flag (ba83f89) with main (8401165)

Open in CodSpeed

@MatthewMckee4 MatthewMckee4 added discovery Related to the discovery of tests cli Related to the command-line interface labels Feb 13, 2026
@MatthewMckee4 MatthewMckee4 merged commit 631b238 into main Feb 13, 2026
9 checks passed
@MatthewMckee4 MatthewMckee4 deleted the add-dry-run-flag branch February 13, 2026 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli Related to the command-line interface discovery Related to the discovery of tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add --collect-only / --dry-run flag

1 participant