diff --git a/crates/iceberg/Cargo.toml b/crates/iceberg/Cargo.toml index 6ae17d21fd..d6e00e4e93 100644 --- a/crates/iceberg/Cargo.toml +++ b/crates/iceberg/Cargo.toml @@ -67,7 +67,6 @@ expect-test = { workspace = true } fnv = { workspace = true } futures = { workspace = true } itertools = { workspace = true } -mockall = { workspace = true } moka = { version = "0.12.10", features = ["future"] } murmur3 = { workspace = true } num-bigint = { workspace = true } @@ -97,6 +96,7 @@ zstd = { workspace = true } ctor = { workspace = true } expect-test = { workspace = true } iceberg_test_utils = { path = "../test_utils", features = ["tests"] } +mockall = { workspace = true } pretty_assertions = { workspace = true } rand = { workspace = true } regex = { workspace = true } diff --git a/crates/iceberg/src/catalog/mod.rs b/crates/iceberg/src/catalog/mod.rs index a9b92d47e9..bbc2508744 100644 --- a/crates/iceberg/src/catalog/mod.rs +++ b/crates/iceberg/src/catalog/mod.rs @@ -29,6 +29,7 @@ use std::sync::Arc; use _serde::deserialize_snapshot; use async_trait::async_trait; pub use memory::MemoryCatalog; +#[cfg(test)] use mockall::automock; use serde_derive::{Deserialize, Serialize}; use typed_builder::TypedBuilder; @@ -44,7 +45,7 @@ use crate::{Error, ErrorKind, Result}; /// The catalog API for Iceberg Rust. #[async_trait] -#[automock] +#[cfg_attr(test, automock)] pub trait Catalog: Debug + Sync + Send { /// List namespaces inside the catalog. async fn list_namespaces(&self, parent: Option<&NamespaceIdent>)