Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

How to run a test coverage report

Prerequisites

  • cargo-llvm-cov installed (included if you use mise)
  • Valid API credentials for any ignored tests you want to include

Note: There are no coverage targets for RTF. Reports are used to identify unexpected gaps, not to hit a percentage. High coverage does not mean the code is fully tested.

Clear previous coverage data:

cargo llvm-cov clean --workspace

Run all unignored tests:

cargo llvm-cov --no-report

Optionally, run the ignored tests to add their coverage. Supply only the credentials you have available:

GITHUB_TOKEN="$GITHUB_TOKEN" cargo llvm-cov -p rtf-cli --no-report -- --ignored github::
APOLLO_KEY="$APOLLO_KEY" APOLLO_SUDO="true" cargo llvm-cov -p rtf-cli --no-report -- --ignored graphos::

Generate and open the report:

cargo llvm-cov report --open

Inspect the report manually for unexpected gaps. Two things to keep in mind:

  • 100% coverage for an area doesn’t mean it’s fully tested — it means the code ran at least once. A single execution rarely covers all scenarios.
  • Low coverage in some areas may be justified. Where there’s a good reason, leaving lines uncovered is acceptable.