Skip to content

Commit

Permalink
test: enable sandbox build with --no-default-features
Browse files Browse the repository at this point in the history
  • Loading branch information
delta1 committed Mar 14, 2024
1 parent 49a7180 commit 3720b7d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,7 @@ jobs:
run: cargo test

- name: Tests (Liquid mode, REST)
run: cargo test --features liquid
run: cargo test --features liquid

- name: Tests (no default features)
run: cargo test --no-default-features
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ readme = "README.md"
edition = "2018"

[features]
default = [ "dev" ]
liquid = [ "elements" ]
electrum-discovery = [ "electrum-client"]
dev = [ "bitcoind/25_0", "electrumd/4_1_5", "elementsd/22_1_1" ]

[dependencies]
arraydeque = "0.5.1"
Expand Down Expand Up @@ -58,9 +60,9 @@ electrum-client = { version = "0.8", optional = true }


[dev-dependencies]
bitcoind = { version = "0.34", features = [ "25_0" ] }
elementsd = { version = "0.9", features = [ "22_1_1" ] }
electrumd = { version = "0.1.0", features = [ "4_1_5" ] }
bitcoind = { version = "0.34" }
elementsd = { version = "0.9" }
electrumd = { version = "0.1.0" }
ureq = { version = "2.9", default-features = false, features = [ "json" ] }
tempfile = "3.10"

Expand Down
4 changes: 2 additions & 2 deletions tests/electrum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use bitcoin::address;

/// Test the Electrum RPC server using an headless Electrum wallet
/// This only runs on Bitcoin (non-Liquid) mode.
#[cfg_attr(not(feature = "liquid"), test)]
#[cfg_attr(feature = "liquid", allow(dead_code))]
#[cfg_attr(all(feature = "dev", not(feature = "liquid")), test)]
#[cfg_attr(any(feature = "liquid", not(feature = "dev")), allow(dead_code))]
fn test_electrum() -> Result<()> {
// Spawn an Electrs Electrum RPC server
let (electrum_server, electrum_addr, mut tester) = common::init_electrum_tester().unwrap();
Expand Down
3 changes: 2 additions & 1 deletion tests/rest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ pub mod common;

use common::Result;

#[test]
#[cfg_attr(feature = "dev", test)]
#[cfg_attr(not(feature = "dev"), allow(dead_code))]
fn test_rest() -> Result<()> {
let (rest_handle, rest_addr, mut tester) = common::init_rest_tester().unwrap();

Expand Down

0 comments on commit 3720b7d

Please sign in to comment.