Skip to content

Commit c39e95f

Browse files
natalieeskNatalie Eskinazi
and
Natalie Eskinazi
authored
Improve accuracy of coverage reports 231 (ZcashFoundation#232)
* Add flag to coverage tool to exclude files we don't need to test (ZcashFoundation#231) * Add documentation to README for running code coverage tests locally (ZcashFoundation#231) --------- Co-authored-by: Natalie Eskinazi <[email protected]>
1 parent 09f3f36 commit c39e95f

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

Diff for: .github/workflows/coverage.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ jobs:
3838
run: cargo install cargo-llvm-cov
3939

4040
- name: Run tests
41-
run: cargo llvm-cov --lcov --no-report
41+
run: cargo llvm-cov --lcov --no-report --ignore-filename-regex 'tests.rs|benches.rs|gendoc'
4242

4343
- name: Generate coverage report
44-
run: cargo llvm-cov --lcov --no-run --output-path lcov.info
44+
run: cargo llvm-cov report --lcov --ignore-filename-regex 'tests.rs|benches.rs|gendoc' --output-path lcov.info
4545

4646
- name: Upload coverage report to Codecov
4747
uses: codecov/[email protected]

Diff for: README.md

+7
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,10 @@ dependency.
3535
1. Run tests `cargo test`
3636
2. Run formatter `cargo fmt`
3737
3. Check linter `cargo clippy` and if you want to automatically fix then run `cargo clippy --fix`
38+
39+
## Coverage
40+
41+
Test coverage checks are performed in the pipeline. This is cofigured here: `.github/workflows/coverage.yaml`
42+
To run these locally:
43+
1. Install coverage tool by running `cargo install cargo-llvm-cov`
44+
2. Run `cargo llvm-cov --ignore-filename-regex 'tests.rs|benches.rs|gendoc'` (you may be asked if you want to install `llvm-tools-preview`, if so type `Y`)

0 commit comments

Comments
 (0)