Skip to content

Add --watch flag to karva test#486

Merged
MatthewMckee4 merged 1 commit intomainfrom
add-watch-mode
Feb 17, 2026
Merged

Add --watch flag to karva test#486
MatthewMckee4 merged 1 commit intomainfrom
add-watch-mode

Conversation

@MatthewMckee4
Copy link
Member

Summary

  • Add --watch flag to karva test that re-runs tests automatically when .py files change
  • Uses notify-debouncer-mini crate for file watching with 200ms debounce
  • Uses crossbeam_channel::select! to wait on both file change events and Ctrl+C shutdown signal
  • On file change: clears screen, prints changed files, re-runs all tests
  • Errors with a clear message when combined with --dry-run

Test plan

  • test_watch_and_dry_run_conflict — verifies error when both flags used
  • test_watch_runs_and_can_be_killed (unix) — spawns watch mode, waits, kills, verifies tests ran
  • just test — all 640 tests pass
  • uvx prek run -a — all pre-commit checks pass

Closes #477

When `--watch` is set, run tests once then watch the project directory
for `.py` file changes using `notify-debouncer-mini`. On change, clear
the screen, print changed files, and re-run all tests. Uses
`crossbeam_channel::select!` to wait on both file changes and the
existing Ctrl+C shutdown signal.

Closes #477
@MatthewMckee4 MatthewMckee4 added cli Related to the command-line interface test-running Related to running tests with karva labels Feb 17, 2026
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 17, 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-watch-mode (a031875) with main (003ed9a)

Open in CodSpeed

@MatthewMckee4 MatthewMckee4 merged commit 446d5a7 into main Feb 17, 2026
9 checks passed
@MatthewMckee4 MatthewMckee4 deleted the add-watch-mode branch February 17, 2026 15:13
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 test-running Related to running tests with karva

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Watch mode (--watch)

1 participant