Commit 531f6d4
exclude cachet's untestable no-logs telemetry blocks from coverage
`record_{debug,info,error}_with_duration` each contain a
`#[cfg(not(any(feature = "logs", test)))]` no-op block that only exists to
silence unused-variable warnings when logging is compiled out. Under
`--no-default-features` these blocks compile only into non-test builds (notably
cachet's examples) and are never executed, so they surfaced as 9 uncovered
lines under anvil's nextest-based coverage (which instruments example binaries;
oxidizer's libtest `cargo llvm-cov` does not, which is why Codecov shows the
file 100%).
Add `#[cfg_attr(coverage_nightly, coverage(off))]` to the three functions (and
enable `feature(coverage_attribute)` at the crate root) so these untestable
discards are not instrumented. cachet goes 99.7% -> 100%.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 604c7d2 commit 531f6d4
2 files changed
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
145 | 150 | | |
146 | 151 | | |
147 | 152 | | |
| |||
161 | 166 | | |
162 | 167 | | |
163 | 168 | | |
| 169 | + | |
164 | 170 | | |
165 | 171 | | |
166 | 172 | | |
| |||
180 | 186 | | |
181 | 187 | | |
182 | 188 | | |
| 189 | + | |
183 | 190 | | |
184 | 191 | | |
185 | 192 | | |
| |||
0 commit comments