Crates.io | isotarp |
lib.rs | isotarp |
version | 0.1.12 |
created_at | 2025-04-20 23:41:17.29113+00 |
updated_at | 2025-04-24 17:11:58.539081+00 |
description | Identify which tests provide code coverage of which lines, uniquness, and redundancy |
homepage | |
repository | https://github.com/lmmx/isotarp |
max_upload_size | |
id | 1642107 |
size | 96,509 |
Isotarp is a tool to help Rust developers identify which tests provide unique code coverage.
When writing tests to improve code coverage, it's valuable to know:
Cargo-tarpaulin is excellent for measuring overall coverage, but doesn't provide this test-specific information.
Isotarp fills this gap, by doing the slightly awkward dance of enumerating all the tests, running cargo tarpaulin for each of them, filtering the results so as to not produce tons of JSON in the process.
Ensure you have cargo-tarpaulin
installed first:
cargo install cargo-tarpaulin
Then install Isotarp:
cargo install isotarp
You can use cargo binstall
for both if you prefer.
isotarp list -p your_package_name
Run analysis on all tests in a package:
isotarp analyze -p your_package_name
Or analyze specific tests:
isotarp analyze -p your_package_name -t test_name1 -t test_name2
You can customize output locations:
isotarp analyze -p your_package_name -o ./coverage -r coverage-report.json
Isotarp offers two modes for managing target directories during test execution:
# Default mode: creates separate target directories for each test (faster, more disk space)
isotarp analyze -p your_package_name --target-mode per
# Memory-efficient mode: reuses a single target directory (slower, less disk space)
isotarp analyze -p your_package_name --target-mode one
The --target-mode
option accepts two values:
per
(default): Creates a separate target directory for each test, allowing parallel execution for faster results but requiring more disk space.one
: Reuses a single target directory across tests sequentially, significantly reducing disk usage at the cost of some execution speed.For large projects where target directories can grow to multiple GB, the one
mode can reduce peak disk usage by 80-90% while only increasing execution time by about 50%.
Isotarp runs each test individually through cargo-tarpaulin to generate coverage data, then:
The analysis produces a JSON file with detailed information about each test:
Command-line summary:
Tests ranked by unique line coverage:
integration::parsing::test_complex_case: 42 unique lines (58.3% of 72 total covered lines)
integration::errors::test_invalid_input: 18 unique lines (45.0% of 40 total covered lines)
unit::helpers::test_normalization: 5 unique lines (10.2% of 49 total covered lines)
Tests with NO unique coverage:
unit::helpers::test_validation
Choose the appropriate target mode based on your environment:
Use --target-mode per
(default) when:
Use --target-mode one
when:
In testing, for a project with 6 tests generating 3GB peak disk usage in the default mode, switching to --target-mode one
reduced peak usage to 0.5-0.7GB while increasing execution time by approximately 50%.
This project is licensed under either of:
at your option.