Merged
Conversation
Enable coverage collection for the karva codebase, including the karva-worker subprocess which contains karva_test_semantic code. Two coverage modes are available: - `just coverage`: simple karva-crate-only coverage with HTML output - `just coverage-full`: full coverage including karva_test_semantic (~86% line coverage), using instrumented worker binary Key changes: - Add `KARVA_WORKER_BINARY` env var to override worker binary discovery - Add `__KARVA_COVERAGE` private env var to gate coverage-only venv activation in the embedded Python interpreter - Add coverage job to CI workflow (same conditions as cargo test) - Add `just coverage` and `just coverage-full` recipes - Add `*.profraw` to .gitignore The coverage-specific venv activation (registering embedded _karva module, adding site-packages, fixing sys.executable) is completely gated behind `__KARVA_COVERAGE` and is a no-op in normal test runs.
Merging this PR will not alter performance
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cargo llvm-covcoverage infrastructure with two modes:just coverage— karva crate only, ~70% line coverage, HTML outputjust coverage-full— all crates includingkarva_test_semanticvia instrumented worker binary, ~86% line coveragecargo test)KARVA_WORKER_BINARYenv var override for worker binary discovery__KARVA_COVERAGEenv var to gate coverage-only venv activation in the embedded Python interpreterThe coverage-specific code (venv activation for the embedded PyO3 interpreter) is completely gated behind
__KARVA_COVERAGEand is a no-op during normal test runs. All 685 tests continue to pass unchanged.Test plan
just test— 685/685 tests pass (no behavior change)just coverage— 457/457 tests pass, HTML report generatedjust coverage-full— 457/457 tests pass, 86% line coverage across all cratesuvx prek run -a— all pre-commit checks pass