Skip to content

Commit e4b05d5

Browse files
committed
feat(test): roll a custom TestEnv and drop lazy_static
Implement a custom `TestEnv`, which is instantiated per-test and fixes the un-dropped `bitcoind` issue. This also allows running tests with more than 1 thread, since they no longer share `bitcoind` and `electrsd` instances. Also adds helpers to fetch externally sourced addresses, fixing the issue where `bitcoind`'s wallet would send change outputs to it's own wallet address, which would mess with `test_get_scripthash_stats`. The `test` recipe and CI job are updated to now use 16 threads.
1 parent 7138749 commit e4b05d5

4 files changed

Lines changed: 330 additions & 346 deletions

File tree

.github/workflows/cont_integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
- name: Build
5454
run: cargo build --features ${{ matrix.features }} --no-default-features
5555
- name: Test
56-
run: cargo test --features ${{ matrix.features }} --no-default-features -- --test-threads=1
56+
run: cargo test --features ${{ matrix.features }} --no-default-features -- --test-threads=16
5757

5858
fmt:
5959
name: Rust Formatting

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ tokio = { version = "1", features = ["time"], optional = true }
3434
[dev-dependencies]
3535
tokio = { version = "1.20.1", features = ["full"] }
3636
electrsd = { version = "0.36.1", features = ["legacy", "esplora_a33e97e1", "corepc-node_29_0"] }
37-
lazy_static = "1.4.0"
3837

3938
[features]
4039
default = ["blocking", "async", "async-https", "tokio"]

justfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ fmt:
3030
msrv:
3131
bash ci/pin-msrv.sh
3232
cargo +1.75.0 build --all-features
33-
cargo +1.75.0 test --all-features -- --test-threads=1
33+
cargo +1.75.0 test --all-features -- --test-threads=16
3434

3535
# Run pre-push suite: format, check, and test
3636
pre-push: fmt check test
3737

3838
# Run all tests on the workspace with all features
3939
test:
40-
cargo test --all-features -- --test-threads=1
40+
cargo test --all-features -- --test-threads=16

0 commit comments

Comments
 (0)