Skip to content

Commit

Permalink
Use tests features
Browse files Browse the repository at this point in the history
  • Loading branch information
liurenjie1024 committed Dec 7, 2023
1 parent d14b687 commit 8aa2f8f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion crates/catalog/rest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
3 changes: 3 additions & 0 deletions crates/test_utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,6 @@ edition = "2021"
[dependencies]
env_logger = { workspace = true }
log = "0.4.20"

[features]
tests = []
23 changes: 15 additions & 8 deletions crates/test_utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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('.', "_")
}
}

0 comments on commit 8aa2f8f

Please sign in to comment.