la-stack uses cargo-llvm-cov for local and CI coverage. Coverage runs use
Rust's LLVM source-based instrumentation with the same core test selection in
both environments:
cargo llvm-cov --features exact --workspace --lib --testsGenerate the local developer report with:
just coverageThe HTML report is written to:
target/llvm-cov/html/index.html
The report opens automatically after generation.
Generate the CI-compatible Cobertura report with:
just coverage-ciThe XML report is written to:
coverage/cobertura.xml
The Codecov workflow installs Rust's llvm-tools-preview component, installs
cargo-llvm-cov, caches the installed cargo binary by version, runs
just coverage-ci, verifies coverage/cobertura.xml, uploads that file to
Codecov, and archives the full coverage/ directory. Local setup via
just setup-tools installs the same Rust component and cargo subcommand.
- Keep
just coverage-cias the single source of truth for CI coverage arguments; workflows should install tools and upload artifacts, not duplicate the coverage command. - Use
--cobertura --output-path coverage/cobertura.xmlfor services that consume Cobertura XML. - Use
--open --output-dir target/llvm-covfor local reports. - Preserve the crate's full coverage surface with
--features exact --workspace --lib --tests. cargo-llvm-covexcludes workspacetests/,examples/, andbenches/source files from reports by default, while still allowing integration tests to exercise library code. This matches the intended reporting surface here: library implementation coverage, not test harness coverage.- Doc-test coverage remains intentionally disabled because
cargo-llvm-covmarks that path as unstable.