Cache
Karva keeps only reusable history on disk: per-test durations for parallel scheduling and the test names used by --last-failed. Worker test selections, live state, and complete results travel over loopback IPC and remain in memory.
The cache lives in .karva_cache under the project root. Coverage runs also write per-worker coverage artifacts there.
Re-running just the failures
--last-failed (or --lf) restricts the run to whichever tests failed in the previous invocation:
| Bash | |
|---|---|
1 | |
A typical fix-it-up loop:
| Bash | |
|---|---|
1 2 3 | |
Combine with --watch to keep iterating until they all pass:
| Bash | |
|---|---|
1 | |
If the last run had no failures, --last-failed runs nothing.
Disabling the cache
--no-cache disables reading and writing reusable test history for the current run. Tests are scheduled without duration hints and --last-failed becomes a no-op. Coverage artifacts are still written when coverage is enabled.
| Bash | |
|---|---|
1 | |
Managing the cache
Two karva cache subcommands manage cache contents directly:
| Bash | |
|---|---|
1 2 | |
prune preserves reusable history. Reach for clean if the cache gets corrupted or after a cache-format change.