Skip to content

Commit

Permalink
Add an integration-tests feature flag, use it for tests that require …
Browse files Browse the repository at this point in the history
…bitcoind
  • Loading branch information
djordon committed May 14, 2024
1 parent 96cd0da commit 74e9e23
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ build: install | emily-client
&& pnpm --recursive build

test: install | emily-client
cargo test --lib \
cargo test \
&& pnpm --recursive test

integration-test: install | emily-client
docker compose --file docker-compose.test.yml up --detach
cargo test \
cargo test --all-features \
&& pnpm --recursive test
docker compose --file docker-compose.test.yml down

Expand Down
3 changes: 3 additions & 0 deletions signer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ name = "signer"
path = "src/main.rs"
bench = false

[features]
integration-tests = []

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
Expand Down
2 changes: 2 additions & 0 deletions signer/tests/utxo_construction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ fn make_deposit(
/// This test just checks that many of the methods on the Recipient struct
/// work as advertised.
#[test]
#[cfg_attr(not(feature = "integration-tests"), ignore)]
fn helper_struct_methods_work() {
let (rpc, faucet) = regtest::initialize_blockchain();
let fee = regtest::BITCOIN_CORE_FALLBACK_FEE.to_sat();
Expand Down Expand Up @@ -151,6 +152,7 @@ fn helper_struct_methods_work() {
/// Check that deposits, when sent with the expected format, are
/// spent using the transactions generated in the utxo module.
#[test]
#[cfg_attr(not(feature = "integration-tests"), ignore)]
fn deposits_add_to_controlled_amounts() {
let (rpc, faucet) = regtest::initialize_blockchain();
let fee = regtest::BITCOIN_CORE_FALLBACK_FEE.to_sat();
Expand Down

0 comments on commit 74e9e23

Please sign in to comment.