Skip to content

Commit

Permalink
Use Network::Isolated for all dockertest instances
Browse files Browse the repository at this point in the history
  • Loading branch information
kayabaNerve committed Oct 23, 2023
1 parent fbca6e5 commit e5159c9
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions substrate/client/tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ macro_rules! serai_test {
source: LogSource::Both,
}));

let mut test = DockerTest::new();
test.provide_container(composition);
let mut test = DockerTest::new().with_network(dockertest::Network::Isolated);
test.add_composition(composition);
test.run_async(|ops| async move {
// Sleep until the Substrate RPC starts
let serai_rpc = ops.handle(handle).host_port(9944).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion tests/coordinator/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub(crate) static ONE_AT_A_TIME: OnceLock<Mutex<()>> = OnceLock::new();

pub(crate) fn new_test() -> (Vec<(Handles, <Ristretto as Ciphersuite>::F)>, DockerTest) {
let mut coordinators = vec![];
let mut test = DockerTest::new();
let mut test = DockerTest::new().with_network(dockertest::Network::Isolated);
for i in 0 .. COORDINATORS {
let (handles, coord_key, compositions) = coordinator_stack(match i {
0 => "Alice",
Expand Down
2 changes: 1 addition & 1 deletion tests/full-stack/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub(crate) static ONE_AT_A_TIME: OnceLock<Mutex<()>> = OnceLock::new();

pub(crate) fn new_test() -> (Vec<Handles>, DockerTest) {
let mut validators = vec![];
let mut test = DockerTest::new();
let mut test = DockerTest::new().with_network(dockertest::Network::Isolated);
for i in 0 .. VALIDATORS {
let (handles, compositions) = full_stack(match i {
0 => "Alice",
Expand Down
2 changes: 1 addition & 1 deletion tests/message-queue/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ fn basic_functionality() {

use serai_message_queue::{Service, Metadata, client::MessageQueue};

let mut test = DockerTest::new();
let mut test = DockerTest::new().with_network(dockertest::Network::Isolated);
let (coord_key, priv_keys, composition) = instance();
test.provide_container(composition);
test.run(|ops| async move {
Expand Down
2 changes: 1 addition & 1 deletion tests/processor/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub(crate) const THRESHOLD: usize = ((COORDINATORS * 2) / 3) + 1;

fn new_test(network: NetworkId) -> (Vec<(Handles, <Ristretto as Ciphersuite>::F)>, DockerTest) {
let mut coordinators = vec![];
let mut test = DockerTest::new();
let mut test = DockerTest::new().with_network(dockertest::Network::Isolated);
for _ in 0 .. COORDINATORS {
let (handles, coord_key, compositions) = processor_stack(network);
coordinators.push((handles, coord_key));
Expand Down
2 changes: 1 addition & 1 deletion tests/reproducible-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub fn reproducibly_builds() {
OsRng.fill_bytes(id);
}

let mut test = DockerTest::new();
let mut test = DockerTest::new().with_network(dockertest::Network::Isolated);
for id in &ids {
test.provide_container(
TestBodySpecification::with_image(
Expand Down

0 comments on commit e5159c9

Please sign in to comment.