fix(drive): correct integration test

This commit is contained in:
Edouard Vanbelle
2026-06-24 02:44:25 +02:00
parent 338915a912
commit 754e6239da
4 changed files with 28 additions and 4 deletions
+7 -1
View File
@@ -291,7 +291,13 @@ impl DedupService {
}
/// Creates a stub instance for testing — never hits PG or the filesystem.
#[cfg(any(test, feature = "integration_tests"))]
///
/// Gated for both build modes integration tests are reachable from:
/// the raw `cfg(integration_tests)` flag used by CI / justfile
/// (`RUSTFLAGS='--cfg integration_tests'`) and the
/// `feature = "integration_tests"` form for callers that flip the
/// cargo feature instead. Standard `cfg(test)` keeps unit-test use.
#[cfg(any(test, integration_tests, feature = "integration_tests"))]
pub fn new_stub() -> Self {
use crate::infrastructure::services::local_blob_backend::LocalBlobBackend;
let stub_pool = Arc::new(
+7 -1
View File
@@ -201,7 +201,13 @@ impl PgAclEngine {
/// without a real PostgreSQL pool. Connecting to the lazy pool will
/// fail at runtime — only safe in tests that exercise types, not actual
/// authz queries.
#[cfg(test)]
///
/// Visible under both `cfg(test)` (the standard unit-test build) and
/// `cfg(integration_tests)` (the gated-by-RUSTFLAGS integration
/// build). The `SubjectGroupService` integration tests construct the
/// service with a stub engine, since they only exercise the engine's
/// in-memory cache invalidation calls — never its SQL paths.
#[cfg(any(test, integration_tests))]
pub fn new_stub() -> Self {
let pool = sqlx::pool::PoolOptions::<sqlx::Postgres>::new()
.max_connections(1)