Code Coverage¶
We measure coverage for both the Rust engine and the Python bindings. Our goal is at least 80% line coverage for each.
Local run¶
Use the helper script from the repo root:
scripts/coverage.sh
It runs:
- Rust:
cargo tarpaulinwith a Cobertura XML report incoverage/rust/cobertura.xml. - Python:
pytest --covwith an XML report incoverage/python/coverage.xml.
Thresholds (both default to 80%) can be overridden via env vars:
RUST_FAIL_UNDER=85 PY_FAIL_UNDER=85 scripts/coverage.sh
CI¶
The Coverage GitHub Action executes on every PR and on pushes to main:
- File:
.github/workflows/coverage.yml - Fails the job if either Rust or Python coverage drops below 80%.
- Uploads artifacts under the
coverage/directory for inspection.
What’s included¶
- Rust: All crates except the Python extension crate (
rusty_runways_py) are measured. Integration tests are executed via Tarpaulin. - Python: Tests under
crates/py/testsrun against the local dev build (viamaturin develop).
Future work¶
- Frontend (React) coverage: we currently do not include the UI in coverage. We can add Vitest + jsdom and collect coverage from TS/TSX files in
apps/tauri/ui/srcif desired.