Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion .github/workflows/rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,19 @@ jobs:
- name: "Run integration tests"
env:
BITCOIND_DOWNLOAD_DIR: ${{ github.workspace }}/.cache/corepc/bitcoind
run: cd integration_test && cargo test --features=${{ matrix.version }},download
run: |
set -o pipefail
test_output="${{ runner.temp }}/integration-test-${{ matrix.version }}.out"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a test CI run on my branch, failing the new integration test with assert!(false). The test does not fail on the integration test; it keeps going to verify, which fails loudly because all subsequent outputs after the failed integration test were not produced and did not fail fast so they are all missing at verify time. The solution is simple:

Suggested change
test_output="${{ runner.temp }}/integration-test-${{ matrix.version }}.out"
set -o pipefail
test_output="${{ runner.temp }}/integration-test-${{ matrix.version }}.out"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I added the fix.

cd integration_test
cargo test --features=${{ matrix.version }},download 2>&1 | tee "$test_output"
- name: "Verify integration test coverage"
run: |
test_output="${{ runner.temp }}/integration-test-${{ matrix.version }}.out"
verify_version="${{ matrix.version }}"
verify_version="${verify_version#0_}"
verify_version="${verify_version%%_*}"
cd verify
cargo run -- --tests "$test_output" "$verify_version"

# The jobs below copied from electrsd repo during import. Not too
# much further thought given to it.
Expand Down
25 changes: 20 additions & 5 deletions integration_test/tests/raw_transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -717,10 +717,25 @@ fn raw_transactions__get_private_broadcast_info__modelled() {

#[test]
#[cfg(not(feature = "v30_and_below"))]
fn raw_transactions__abort_private_broadcast() {
let node = BitcoinD::with_wallet(Wallet::None, &[]);
fn raw_transactions__abort_private_broadcast__modelled() {
let node =
BitcoinD::with_wallet(Wallet::Default, &["-privatebroadcast=1", "-proxy=127.0.0.1:1"]);
node.fund_wallet();

// Create a signed transaction and send it via private broadcast.
let tx = create_a_raw_transaction(&node);
let signed: SignRawTransactionWithWallet =
node.client.sign_raw_transaction_with_wallet(&tx).expect("signrawtransactionwithwallet");
let signed_tx = signed.into_model().expect("SignRawTransaction into model").tx;
let send_raw_transaction: SendRawTransaction =
node.client.send_raw_transaction(&signed_tx).expect("sendrawtransaction");

let json: AbortPrivateBroadcast = node
.client
.abort_private_broadcast(&send_raw_transaction.0)
.expect("abortprivatebroadcast");
let model: Result<mtype::AbortPrivateBroadcast, encode::FromHexError> = json.into_model();
let abort_private_broadcast = model.unwrap();

// Aborting a transaction that is not in the private broadcast queue returns an error in regtest.
let txid = "0000000000000000000000000000000000000000000000000000000000000001";
assert!(node.client.abort_private_broadcast(txid).is_err());
assert_eq!(abort_private_broadcast.removed_transactions, vec![signed_tx]);
}
2 changes: 1 addition & 1 deletion types/src/v26/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
//! | joinpsbts | version + model | |
//! | sendrawtransaction | version + model | |
//! | signrawtransactionwithkey | version + model | UNTESTED |
//! | submitpackage | version + model | |
//! | submitpackage | version + model | UNTESTED |
//! | testmempoolaccept | version + model | |
//! | utxoupdatepsbt | version + model | |
//!
Expand Down
Loading