diff --git a/lib/apps/fabro-server/tests/it/api/cli_auth_token.rs b/lib/apps/fabro-server/tests/it/api/cli_auth_token.rs index 4a79d4e21..4094f7133 100644 --- a/lib/apps/fabro-server/tests/it/api/cli_auth_token.rs +++ b/lib/apps/fabro-server/tests/it/api/cli_auth_token.rs @@ -8,7 +8,7 @@ use fabro_server::jwt_auth::resolve_auth_mode_with_lookup; use fabro_server::server::{AppState, RouterOptions, build_router_with_options}; use fabro_server::test_support::test_app_state_with_store_and_runtime_settings; use fabro_store::auth_session_store::{AuthSessionRecord, InitialRefreshToken}; -use fabro_store::{ArtifactStore, Database, PendingCliAuthorization}; +use fabro_store::{ArtifactStore, PendingCliAuthorization}; use object_store::memory::InMemory; use sha2::{Digest, Sha256}; use tower::ServiceExt; diff --git a/lib/components/fabro-store/src/blob_store.rs b/lib/components/fabro-store/src/blob_store.rs index e5d0dc128..592305c7b 100644 --- a/lib/components/fabro-store/src/blob_store.rs +++ b/lib/components/fabro-store/src/blob_store.rs @@ -31,6 +31,7 @@ impl Record for Blob { const PREFIX: &'static str = "blobs/sha256"; + #[cfg(test)] fn id(&self) -> Self::Id { BlobHash::new(&self.0) } diff --git a/lib/components/fabro-store/src/record/mod.rs b/lib/components/fabro-store/src/record/mod.rs index 61d9e5435..daecabb7a 100644 --- a/lib/components/fabro-store/src/record/mod.rs +++ b/lib/components/fabro-store/src/record/mod.rs @@ -27,6 +27,7 @@ pub(crate) trait Record: Sized + Send + Sync + 'static { const PREFIX: &'static str; + #[cfg(test)] fn id(&self) -> Self::Id; } diff --git a/lib/components/fabro-store/src/record/repository.rs b/lib/components/fabro-store/src/record/repository.rs index f69b3a5aa..6713e2190 100644 --- a/lib/components/fabro-store/src/record/repository.rs +++ b/lib/components/fabro-store/src/record/repository.rs @@ -93,6 +93,7 @@ impl Repository { } } + #[cfg(test)] pub(crate) async fn get(&self, id: &R::Id) -> Result> { self.db .get(key_for_id::(id)?) @@ -101,6 +102,7 @@ impl Repository { .transpose() } + #[cfg(test)] pub(crate) async fn put(&self, record: &R) -> Result<()> { let id = record.id(); self.put_at(&id, record).await diff --git a/lib/components/fabro-store/src/slate/run_catalog_index.rs b/lib/components/fabro-store/src/slate/run_catalog_index.rs index 33efce158..cfaae3a98 100644 --- a/lib/components/fabro-store/src/slate/run_catalog_index.rs +++ b/lib/components/fabro-store/src/slate/run_catalog_index.rs @@ -16,6 +16,7 @@ impl Record for RunCatalogEntry { const PREFIX: &'static str = "runs/_index/by-start"; + #[cfg(test)] fn id(&self) -> Self::Id { unreachable!("marker records must use put_at") }