Commit a336ecf
committed
Merge bitcoindevkit#371: Switch to cargo-llvm-cov for code coverage
527037c ci(coverage): Switch to cargo-llvm-cov for code coverage (copilot-swe-agent[bot])
Pull request description:
### Description
Replaces `grcov` with `cargo-llvm-cov` for coverage generation. `grcov` lacks branch coverage support and has other limitations.
**Workflow changes:**
- Use nightly toolchain with `cargo-llvm-cov`
- Set `RUSTFLAGS="--cfg coverage_nightly"` during coverage runs only
- Remove `lcov` tools and old coverage environment variables
- Enable branch coverage with `--branch` flag
- Add `--quiet` flag to reduce output verbosity
**Code changes:**
- Enable `coverage_attribute` feature via `#[cfg_attr(coverage_nightly, feature(coverage_attribute))]` in `lib.rs`
- Exclude test modules from coverage with `#[cfg_attr(coverage_nightly, coverage(off))]` on 13 test modules
- Add `coverage_nightly` to `[lints.rust]` in `Cargo.toml` to declare the custom cfg
Stable builds are unaffected. Coverage exclusions only activate when the cfg is set.
### Notes to the reviewers
The `coverage_nightly` cfg is only set during coverage generation in CI. Regular builds and tests use stable toolchain without this cfg.
Branch coverage is now explicitly enabled, providing more detailed coverage metrics than the previous grcov setup.
### Changelog notice
- ci: Switch to `cargo-llvm-cov` for code coverage
### Checklists
#### All Submissions:
* [x] I've signed all my commits
* [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
<!-- START COPILOT ORIGINAL PROMPT -->
<details>
<summary>Original prompt</summary>
>
> ----
>
> *This section details on the original issue you should resolve*
>
> <issue_title>[coverage] Consider using `cargo-llvm-cov`</issue_title>
> <issue_description>**Describe the enhancement**
>
> Switch to using [`llvm-cov`](https://crates.io/crates/cargo-llvm-cov) in `.github/workflows/code_coverage.yml` for generating coverage data. For example see bitcoindevkit/bdk#1986.
>
> **Impact**
> - [ ] Blocking production usage
> - [ ] Nice-to-have / UX improvement
> - [x] Developer experience / maintainability
>
> **Additional context**
>
> - `grcov` has some limitations including lacking support for branch coverage which makes it a less appealing option.
> - bitcoindevkit/bdk#1984</issue_description>
>
> ## Comments on the Issue (you are @copilot in this section)
>
> <comments>
> </comments>
>
</details>
<!-- START COPILOT CODING AGENT SUFFIX -->
- Fixes bitcoindevkit#366
<!-- START COPILOT CODING AGENT TIPS -->
---
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more [Copilot coding agent tips](https://gh.io/copilot-coding-agent-tips) in the docs.
ACKs for top commit:
ValuedMammal:
ACK 527037c
notmandatory:
ACK 527037c
luisschwab:
ACK 527037c
Tree-SHA512: c5dc740c3e5b90b12b92ccff0581f9ca21ae45f3b08b486b58d6f9bdcc54865999b48a1eeef1349a0fd81727bdba18b5de615e60cc9e0e41cdda6d96bc50cc1317 files changed
Lines changed: 33 additions & 19 deletions
File tree
- .github/workflows
- src
- descriptor
- keys
- wallet
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | 17 | | |
22 | 18 | | |
23 | 19 | | |
24 | 20 | | |
25 | 21 | | |
26 | 22 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | 23 | | |
31 | 24 | | |
32 | 25 | | |
| 26 | + | |
33 | 27 | | |
34 | 28 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
43 | 35 | | |
44 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
45 | 39 | | |
46 | 40 | | |
47 | 41 | | |
48 | | - | |
| 42 | + | |
49 | 43 | | |
50 | 44 | | |
51 | 45 | | |
| |||
54 | 48 | | |
55 | 49 | | |
56 | 50 | | |
57 | | - | |
| 51 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
19 | 22 | | |
20 | 23 | | |
21 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
823 | 823 | | |
824 | 824 | | |
825 | 825 | | |
| 826 | + | |
826 | 827 | | |
827 | 828 | | |
828 | 829 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
609 | 609 | | |
610 | 610 | | |
611 | 611 | | |
| 612 | + | |
612 | 613 | | |
613 | 614 | | |
614 | 615 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1173 | 1173 | | |
1174 | 1174 | | |
1175 | 1175 | | |
| 1176 | + | |
1176 | 1177 | | |
1177 | 1178 | | |
1178 | 1179 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
632 | 632 | | |
633 | 633 | | |
634 | 634 | | |
| 635 | + | |
635 | 636 | | |
636 | 637 | | |
637 | 638 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
| 152 | + | |
152 | 153 | | |
153 | 154 | | |
154 | 155 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1041 | 1041 | | |
1042 | 1042 | | |
1043 | 1043 | | |
| 1044 | + | |
1044 | 1045 | | |
1045 | 1046 | | |
1046 | 1047 | | |
| |||
0 commit comments