From 1c4d47825b0ebc6027f04b8672ccabe83cbd8cee Mon Sep 17 00:00:00 2001 From: Daniela Brozzoni Date: Fri, 9 Sep 2022 15:27:31 +0200 Subject: [PATCH 1/3] Run code coverage on every PR In this way we can check how much of a PR is covered by the tests, making the review process slightly easier. --- .github/workflows/code_coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code_coverage.yml b/.github/workflows/code_coverage.yml index 5e650459d..9f5cfd0f3 100644 --- a/.github/workflows/code_coverage.yml +++ b/.github/workflows/code_coverage.yml @@ -1,4 +1,4 @@ -on: [push] +on: [push, pull_request] name: Code Coverage From c3a7bbb3ff936031200a7b70d5d9287f7f242513 Mon Sep 17 00:00:00 2001 From: Daniela Brozzoni Date: Sat, 10 Sep 2022 15:12:59 +0200 Subject: [PATCH 2/3] codecov: slightly change the test features - Remove default and minimal, as they are redundant - Use lexicographic order --- .github/workflows/code_coverage.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/code_coverage.yml b/.github/workflows/code_coverage.yml index 9f5cfd0f3..f0408b434 100644 --- a/.github/workflows/code_coverage.yml +++ b/.github/workflows/code_coverage.yml @@ -38,7 +38,7 @@ jobs: - name: Install grcov run: if [[ ! -e ~/.cargo/bin/grcov ]]; then cargo install grcov; fi - name: Test - run: cargo test --features default,minimal,all-keys,compact_filters,key-value-db,compiler,sqlite,sqlite-bundled,test-electrum,verify,test-rpc + run: cargo test --features all-keys,compact_filters,compiler,key-value-db,sqlite,sqlite-bundled,test-electrum,test-rpc,verify - name: Run grcov run: mkdir coverage; grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore '/*' -o ./coverage/lcov.info - name: Generate HTML coverage report From aa0ea6aeff474a9934d4e9eb6e14ea1667573fc5 Mon Sep 17 00:00:00 2001 From: Daniela Brozzoni Date: Sat, 10 Sep 2022 15:19:08 +0200 Subject: [PATCH 3/3] codecov: warn about missing features --- .github/workflows/code_coverage.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/code_coverage.yml b/.github/workflows/code_coverage.yml index f0408b434..b53c47a63 100644 --- a/.github/workflows/code_coverage.yml +++ b/.github/workflows/code_coverage.yml @@ -38,6 +38,12 @@ jobs: - name: Install grcov run: if [[ ! -e ~/.cargo/bin/grcov ]]; then cargo install grcov; fi - name: Test + # WARNING: this is not testing the following features: test-esplora, test-hardware-signer, async-interface + # This is because some of our features are mutually exclusive, and generating various reports and + # merging them doesn't seem to be working very well. + # For more info, see: + # - https://github.com/bitcoindevkit/bdk/issues/696 + # - https://github.com/bitcoindevkit/bdk/pull/748#issuecomment-1242721040 run: cargo test --features all-keys,compact_filters,compiler,key-value-db,sqlite,sqlite-bundled,test-electrum,test-rpc,verify - name: Run grcov run: mkdir coverage; grcov . --binary-path ./target/debug/ -s . -t lcov --branch --ignore-not-existing --ignore '/*' -o ./coverage/lcov.info