From 4704f481903ff1a41e3b87a31804c8012a34b3a6 Mon Sep 17 00:00:00 2001 From: Warm Beer Date: Fri, 10 Jan 2025 18:02:56 +0100 Subject: [PATCH] fix(test): run tests in series --- Cargo.lock | 41 +++++++++++++++++++++++++++++++++++++++++ autonomi/Cargo.toml | 1 + autonomi/tests/fs.rs | 3 +++ 3 files changed, 45 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 2601b8fca5..5c7b7b3f53 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1593,6 +1593,7 @@ dependencies = [ "rmp-serde", "self_encryption", "serde", + "serial_test", "sha2", "test-utils", "thiserror 1.0.69", @@ -7966,6 +7967,15 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "scc" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28e1c91382686d21b5ac7959341fcb9780fa7c03773646995a87c950fa7be640" +dependencies = [ + "sdd", +] + [[package]] name = "schnellru" version = "0.2.3" @@ -8009,6 +8019,12 @@ dependencies = [ "untrusted 0.9.0", ] +[[package]] +name = "sdd" +version = "3.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "478f121bb72bbf63c52c93011ea1791dca40140dfe13f8336c4c5ac952c33aa9" + [[package]] name = "sec1" version = "0.7.3" @@ -8192,6 +8208,31 @@ dependencies = [ "unsafe-libyaml", ] +[[package]] +name = "serial_test" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b258109f244e1d6891bf1053a55d63a5cd4f8f4c30cf9a1280989f80e7a1fa9" +dependencies = [ + "futures", + "log", + "once_cell", + "parking_lot", + "scc", + "serial_test_derive", +] + +[[package]] +name = "serial_test_derive" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d69265a08751de7844521fd15003ae0a888e035773ba05695c5c759a6f89eef" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.90", +] + [[package]] name = "service-manager" version = "0.7.1" diff --git a/autonomi/Cargo.toml b/autonomi/Cargo.toml index 40f3a2fabb..89c132cb20 100644 --- a/autonomi/Cargo.toml +++ b/autonomi/Cargo.toml @@ -58,6 +58,7 @@ xor_name = "5.0.0" alloy = { version = "0.7.3", default-features = false, features = ["contract", "json-rpc", "network", "node-bindings", "provider-http", "reqwest-rustls-tls", "rpc-client", "rpc-types", "signer-local", "std"] } ant-logging = { path = "../ant-logging", version = "0.2.44" } eyre = "0.6.5" +serial_test = "3.2.0" sha2 = "0.10.6" # Do not specify the version field. Release process expects even the local dev deps to be published. # Removing the version field is a workaround. diff --git a/autonomi/tests/fs.rs b/autonomi/tests/fs.rs index 88198c4cc6..487db39c43 100644 --- a/autonomi/tests/fs.rs +++ b/autonomi/tests/fs.rs @@ -9,6 +9,7 @@ use ant_logging::LogBuilder; use autonomi::Client; use eyre::Result; +use serial_test::serial; use sha2::{Digest, Sha256}; use std::fs::File; use std::io::{BufReader, Read}; @@ -20,6 +21,7 @@ use walkdir::WalkDir; // With a local evm network, and local network, run: // EVM_NETWORK=local cargo test --features="local" --package autonomi --test fs #[tokio::test] +#[serial] async fn dir_upload_download() -> Result<()> { let _log_appender_guard = LogBuilder::init_single_threaded_tokio_test("dir_upload_download", false); @@ -75,6 +77,7 @@ fn compute_dir_sha256(dir: &str) -> Result { } #[tokio::test] +#[serial] async fn file_into_vault() -> Result<()> { let _log_appender_guard = LogBuilder::init_single_threaded_tokio_test("file", false);