feat: add Rust test coverage#4842
Merged
Merged
Conversation
0b7db14 to
2bff590
Compare
abdnh
requested changes
May 15, 2026
Collaborator
abdnh
left a comment
There was a problem hiding this comment.
Missing Windows support (see my commit in the Python PR).
Contributor
Author
|
@abdnh I saw it. I'm working into it! Thanks! |
Add just test-py with --coverage and --html flag support, backed by coverage.py. Runs pylib and qt test suites separately, writes data to out/coverage/, and enforces minimum line thresholds (65% pylib, 20% qt). Closes #4838
Update just test to accept --coverage and --html, delegating to a new coverage recipe. Currently covers Python only.
Add just test-rust with --coverage and --html flag support, backed by cargo-llvm-cov. Installs the tool on demand into out/bin/ to avoid polluting the global cargo install.
Install llvm-tools-preview in CI so cargo-llvm-cov can instrument binaries. Extend the coverage umbrella to run Rust coverage ahead of Python.
…rust Extract cargo-llvm-cov invocation into tools/coverage-rust (bash) and tools/coverage-rust.bat (Windows), mirroring the tools/coverage-py pattern. Simplifies _coverage-rust in the justfile.
cargo-llvm-cov's llvm-profdata uses the host toolchain, which cannot merge profraw files produced on aarch64-pc-windows-msvc. Refs: rust-lang/rust#150123, taiki-e/cargo-llvm-cov#436.
173f712 to
ace294a
Compare
d422c9e to
37186c6
Compare
Contributor
Author
|
@abdnh I added the windows support! |
abdnh
approved these changes
May 18, 2026
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.
Linked issue
Closes #4839
Summary / motivation
Adds
cargo-llvm-cov-based test coverage for the full Rust workspace. Introducesjust test-rust --coverageandjust test-rust --coverage --html, and wires Rust into thejust test --coverageumbrella.cargo-llvm-covis installed on demand intoout/bin/to avoid polluting the global cargo install. Thellvm-tools-previewrustup component is now installed in CI so the tool can instrument binaries.How to test (required)
Note: first run of
--coveragewill installcargo-llvm-covintoout/bin/(~30s). Subsequent runs skip the install step.Checklist
./ninja checkor an equivalent relevant check locally.Details
cargo-llvm-covpinned at0.8.4, installed intoout/bin/viacargo install --root out.--workspace --lockedmeasures all crates and respects the lockfile.llvm-tools-previewadded tosetup-ankiaction so CI can instrument Rust binaries.just test-rustbecausecargo-llvm-covrebuilds with instrumentation — this is expected.Before / after behavior
Before: no
just test-rust, no Rust coverage support.After:
just test-rustruns Rust tests via ninja;just test-rust --coverageruns them withcargo-llvm-cov