diff --git a/.github/workflows/merge.yml b/.github/workflows/merge.yml index bc5d0d26e7..ef7edc55ac 100644 --- a/.github/workflows/merge.yml +++ b/.github/workflows/merge.yml @@ -125,11 +125,11 @@ jobs: - name: Run autonomi tests timeout-minutes: 25 - run: cargo test --release --package autonomi --features full,local --lib + run: cargo test --release --package autonomi --features local --lib - name: Run autonomi doc tests timeout-minutes: 25 - run: cargo test --release --package autonomi --features full,local --doc + run: cargo test --release --package autonomi --features local --doc - name: Run bootstrap tests timeout-minutes: 25 diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 5c9553034d..cc9e6f690d 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -246,7 +246,7 @@ jobs: - name: Run autonomi tests timeout-minutes: 25 - run: cargo test --release --package autonomi --lib --features="full,fs" + run: cargo test --release --package autonomi --lib --features="full" - name: Run bootstrap tests timeout-minutes: 25 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/ant-cli/Cargo.toml b/ant-cli/Cargo.toml index 23408b7d1e..2258850fc5 100644 --- a/ant-cli/Cargo.toml +++ b/ant-cli/Cargo.toml @@ -29,9 +29,6 @@ ant-build-info = { path = "../ant-build-info", version = "0.1.23" } ant-logging = { path = "../ant-logging", version = "0.2.44" } ant-protocol = { path = "../ant-protocol", version = "0.3.3" } autonomi = { path = "../autonomi", version = "0.3.3", features = [ - "fs", - "vault", - "registers", "loud", ] } clap = { version = "4.2.1", features = ["derive"] } @@ -60,7 +57,7 @@ tracing = { version = "~0.1.26" } walkdir = "2.5.0" [dev-dependencies] -autonomi = { path = "../autonomi", version = "0.3.3", features = ["fs"]} +autonomi = { path = "../autonomi", version = "0.3.3" } criterion = "0.5.1" eyre = "0.6.8" rand = { version = "~0.8.5", features = ["small_rng"] } diff --git a/ant-node/Cargo.toml b/ant-node/Cargo.toml index 6134e207dc..d8a7feab8e 100644 --- a/ant-node/Cargo.toml +++ b/ant-node/Cargo.toml @@ -90,7 +90,7 @@ xor_name = "5.0.0" ant-protocol = { path = "../ant-protocol", version = "0.3.3", features = ["rpc"] } assert_fs = "1.0.0" evmlib = { path = "../evmlib", version = "0.1.8" } -autonomi = { path = "../autonomi", version = "0.3.3", features = ["registers"] } +autonomi = { path = "../autonomi", version = "0.3.3" } reqwest = { version = "0.12.2", default-features = false, features = [ "rustls-tls-manual-roots", ] } diff --git a/autonomi/Cargo.toml b/autonomi/Cargo.toml index b75cc213f6..89c132cb20 100644 --- a/autonomi/Cargo.toml +++ b/autonomi/Cargo.toml @@ -15,22 +15,16 @@ crate-type = ["cdylib", "rlib"] [[example]] name = "data_and_archive" -required-features = ["full"] [[example]] name = "put_and_dir_upload" -required-features = ["full"] [features] -default = ["vault"] +default = [] external-signer = ["ant-evm/external-signer"] extension-module = ["pyo3/extension-module"] -fs = ["tokio/fs"] -full = ["vault", "fs"] local = ["ant-networking/local", "ant-evm/local"] loud = [] -registers = [] -vault = [] [dependencies] ant-bootstrap = { path = "../ant-bootstrap", version = "0.1.3" } @@ -55,7 +49,7 @@ self_encryption = "~0.30.0" serde = { version = "1.0.133", features = ["derive", "rc"] } sha2 = "0.10.6" thiserror = "1.0.23" -tokio = { version = "1.35.0", features = ["sync"] } +tokio = { version = "1.35.0", features = ["sync", "fs"] } tracing = { version = "~0.1.26" } walkdir = "2.5.0" xor_name = "5.0.0" @@ -64,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/src/client/files/mod.rs b/autonomi/src/client/files/mod.rs index a419ecfa04..e53be148bf 100644 --- a/autonomi/src/client/files/mod.rs +++ b/autonomi/src/client/files/mod.rs @@ -1,16 +1,10 @@ -#[cfg(feature = "fs")] use std::path::{Path, PathBuf}; pub mod archive; pub mod archive_public; -#[cfg(feature = "fs")] -#[cfg_attr(docsrs, doc(cfg(feature = "fs")))] pub mod fs; -#[cfg(feature = "fs")] -#[cfg_attr(docsrs, doc(cfg(feature = "fs")))] pub mod fs_public; -#[cfg(feature = "fs")] pub(crate) fn get_relative_file_path_from_abs_file_and_folder_path( abs_file_pah: &Path, abs_folder_path: &Path, diff --git a/autonomi/src/client/mod.rs b/autonomi/src/client/mod.rs index 459b29674c..d34658ed15 100644 --- a/autonomi/src/client/mod.rs +++ b/autonomi/src/client/mod.rs @@ -21,11 +21,7 @@ pub mod pointer; #[cfg(feature = "external-signer")] #[cfg_attr(docsrs, doc(cfg(feature = "external-signer")))] pub mod external_signer; -#[cfg(feature = "registers")] -#[cfg_attr(docsrs, doc(cfg(feature = "registers")))] pub mod registers; -#[cfg(feature = "vault")] -#[cfg_attr(docsrs, doc(cfg(feature = "vault")))] pub mod vault; // private module with utility functions diff --git a/autonomi/tests/fs.rs b/autonomi/tests/fs.rs index 926baeb4fd..487db39c43 100644 --- a/autonomi/tests/fs.rs +++ b/autonomi/tests/fs.rs @@ -6,11 +6,10 @@ // KIND, either express or implied. Please review the Licences for the specific language governing // permissions and limitations relating to use of the SAFE Network Software. -#![cfg(feature = "fs")] - 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,8 +19,9 @@ use tokio::time::sleep; use walkdir::WalkDir; // With a local evm network, and local network, run: -// EVM_NETWORK=local cargo test --features="fs,local" --package autonomi --test file +// 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); @@ -76,8 +76,8 @@ fn compute_dir_sha256(dir: &str) -> Result { Ok(format!("{:x}", hasher.finalize())) } -#[cfg(feature = "vault")] #[tokio::test] +#[serial] async fn file_into_vault() -> Result<()> { let _log_appender_guard = LogBuilder::init_single_threaded_tokio_test("file", false); diff --git a/autonomi/tests/register.rs b/autonomi/tests/register.rs index 0709779d5c..1ef2658b9c 100644 --- a/autonomi/tests/register.rs +++ b/autonomi/tests/register.rs @@ -6,7 +6,6 @@ // KIND, either express or implied. Please review the Licences for the specific language governing // permissions and limitations relating to use of the SAFE Network Software. -#![cfg(feature = "registers")] #![allow(deprecated)] use ant_logging::LogBuilder;