Skip to content

Commit 2d56a77

Browse files
committed
Merge #644: Run verify --tests in CI
0b63ee8 Add verify --tests to CI (Jamil Lambert, PhD) 1ede106 Fix remaining verify --tests problems (Jamil Lambert, PhD) Pull request description: Fix the two problems highlighted when adding `verify --tests` to CI: `submitpackage` is untested for v26 - Add `UNTESTED` label to the types table. `abortprivatebroadcast` test did not check the model - Fix the test. Add `verify --tests` to CI: For every version `integration_tests` capture the output and run `verify --tests` with the output generated. Run in the same job as the tests since they are needed to generate the file. Closes #639 ACKs for top commit: satsfy: reACK 0b63ee8 tcharding: ACK 0b63ee8 Tree-SHA512: 69cc7dfc548c30b7fa48f1e3d9ec7d734759a357877696f595127408422f6dc0c3f5d3bfa002d14f0ba5de988af6c3f6b7fafbe47444d61ba31410e0e983b559
2 parents 4bfe47a + 0b63ee8 commit 2d56a77

3 files changed

Lines changed: 35 additions & 7 deletions

File tree

.github/workflows/rust.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,19 @@ jobs:
160160
- name: "Run integration tests"
161161
env:
162162
BITCOIND_DOWNLOAD_DIR: ${{ github.workspace }}/.cache/corepc/bitcoind
163-
run: cd integration_test && cargo test --features=${{ matrix.version }},download
163+
run: |
164+
set -o pipefail
165+
test_output="${{ runner.temp }}/integration-test-${{ matrix.version }}.out"
166+
cd integration_test
167+
cargo test --features=${{ matrix.version }},download 2>&1 | tee "$test_output"
168+
- name: "Verify integration test coverage"
169+
run: |
170+
test_output="${{ runner.temp }}/integration-test-${{ matrix.version }}.out"
171+
verify_version="${{ matrix.version }}"
172+
verify_version="${verify_version#0_}"
173+
verify_version="${verify_version%%_*}"
174+
cd verify
175+
cargo run -- --tests "$test_output" "$verify_version"
164176
165177
# The jobs below copied from electrsd repo during import. Not too
166178
# much further thought given to it.

integration_test/tests/raw_transactions.rs

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -717,10 +717,26 @@ fn raw_transactions__get_private_broadcast_info__modelled() {
717717

718718
#[test]
719719
#[cfg(not(feature = "v30_and_below"))]
720-
fn raw_transactions__abort_private_broadcast() {
721-
let node = BitcoinD::with_wallet(Wallet::None, &[]);
720+
fn raw_transactions__abort_private_broadcast__modelled() {
721+
let node =
722+
BitcoinD::with_wallet(Wallet::Default, &["-privatebroadcast=1", "-proxy=127.0.0.1:1"]);
723+
node.fund_wallet();
724+
725+
// Create a signed transaction and send it via private broadcast.
726+
let tx = create_a_raw_transaction(&node);
727+
let signed = node
728+
.client
729+
.sign_raw_transaction_with_wallet(&tx)
730+
.expect("signrawtransactionwithwallet")
731+
.into_model()
732+
.expect("SignRawTransaction into model")
733+
.tx;
734+
let send = node.client.send_raw_transaction(&signed).expect("sendrawtransaction");
735+
736+
let json: AbortPrivateBroadcast =
737+
node.client.abort_private_broadcast(&send.0).expect("abortprivatebroadcast");
738+
let model: Result<mtype::AbortPrivateBroadcast, encode::FromHexError> = json.into_model();
739+
let abort = model.unwrap();
722740

723-
// Aborting a transaction that is not in the private broadcast queue returns an error in regtest.
724-
let txid = "0000000000000000000000000000000000000000000000000000000000000001";
725-
assert!(node.client.abort_private_broadcast(txid).is_err());
741+
assert_eq!(abort.removed_transactions, &[signed]);
726742
}

types/src/v26/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@
134134
//! | joinpsbts | version + model | |
135135
//! | sendrawtransaction | version + model | |
136136
//! | signrawtransactionwithkey | version + model | UNTESTED |
137-
//! | submitpackage | version + model | |
137+
//! | submitpackage | version + model | UNTESTED |
138138
//! | testmempoolaccept | version + model | |
139139
//! | utxoupdatepsbt | version + model | |
140140
//!

0 commit comments

Comments
 (0)