Skip to content

Commit 36af3f7

Browse files
authored
fix: Fix mock dependency (#1507)
## What changes are included in this PR? `mockall` dependency is introduced in #1484, which is used for unit test on retry. But it's only used in unit tests, but not production code; so it should be placed under dev section, and completely disabled in production code path. Current implementation unnecessarily increases crate size for production usage. ## Are these changes tested? N/A, a no-op change, a passed compilation should be enough
1 parent e47b268 commit 36af3f7

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

crates/iceberg/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ expect-test = { workspace = true }
6767
fnv = { workspace = true }
6868
futures = { workspace = true }
6969
itertools = { workspace = true }
70-
mockall = { workspace = true }
7170
moka = { version = "0.12.10", features = ["future"] }
7271
murmur3 = { workspace = true }
7372
num-bigint = { workspace = true }
@@ -97,6 +96,7 @@ zstd = { workspace = true }
9796
ctor = { workspace = true }
9897
expect-test = { workspace = true }
9998
iceberg_test_utils = { path = "../test_utils", features = ["tests"] }
99+
mockall = { workspace = true }
100100
pretty_assertions = { workspace = true }
101101
rand = { workspace = true }
102102
regex = { workspace = true }

crates/iceberg/src/catalog/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ use std::sync::Arc;
2929
use _serde::deserialize_snapshot;
3030
use async_trait::async_trait;
3131
pub use memory::MemoryCatalog;
32+
#[cfg(test)]
3233
use mockall::automock;
3334
use serde_derive::{Deserialize, Serialize};
3435
use typed_builder::TypedBuilder;
@@ -44,7 +45,7 @@ use crate::{Error, ErrorKind, Result};
4445

4546
/// The catalog API for Iceberg Rust.
4647
#[async_trait]
47-
#[automock]
48+
#[cfg_attr(test, automock)]
4849
pub trait Catalog: Debug + Sync + Send {
4950
/// List namespaces inside the catalog.
5051
async fn list_namespaces(&self, parent: Option<&NamespaceIdent>)

0 commit comments

Comments
 (0)