diff --git a/crates/catalog/rest/Cargo.toml b/crates/catalog/rest/Cargo.toml index ff0eb9111..883f55c02 100644 --- a/crates/catalog/rest/Cargo.toml +++ b/crates/catalog/rest/Cargo.toml @@ -41,7 +41,7 @@ urlencoding = { workspace = true } uuid = { workspace = true, features = ["v4"] } [dev-dependencies] -iceberg_test_utils = { path = "../../test_utils" } +iceberg_test_utils = { path = "../../test_utils", features = ["tests"] } mockito = { workspace = true } port_scanner = { workspace = true } tokio = { workspace = true } diff --git a/crates/test_utils/Cargo.toml b/crates/test_utils/Cargo.toml index 178ec5ec0..91210c50f 100644 --- a/crates/test_utils/Cargo.toml +++ b/crates/test_utils/Cargo.toml @@ -23,3 +23,6 @@ edition = "2021" [dependencies] env_logger = { workspace = true } log = "0.4.20" + +[features] +tests = [] diff --git a/crates/test_utils/src/lib.rs b/crates/test_utils/src/lib.rs index c320f8540..4f63b8dd7 100644 --- a/crates/test_utils/src/lib.rs +++ b/crates/test_utils/src/lib.rs @@ -19,16 +19,23 @@ //! //! It's not intended for use outside of `iceberg-rust`. -use std::sync::Once; - +#[cfg(feature = "tests")] mod cmd; +#[cfg(feature = "tests")] pub mod docker; -static INIT: Once = Once::new(); +#[cfg(feature = "tests")] +pub use common::*; -pub fn set_up() { - INIT.call_once(env_logger::init); -} -pub fn normalize_test_name(s: impl ToString) -> String { - s.to_string().replace("::", "__").replace('.', "_") +#[cfg(feature = "tests")] +mod common { + use std::sync::Once; + + static INIT: Once = Once::new(); + pub fn set_up() { + INIT.call_once(env_logger::init); + } + pub fn normalize_test_name(s: impl ToString) -> String { + s.to_string().replace("::", "__").replace('.', "_") + } }