test(server): gate PostgreSQL tests behind postgres-tests feature

Move testcontainers to optional dependency and create feature flag for database integration tests. Tests without the feature use a dummy pool and skip database operations.
This commit is contained in:
2026-01-07 00:00:29 -06:00
parent bf2a2a34e4
commit 93381ba5cb
8 changed files with 159 additions and 92 deletions
+3 -3
View File
@@ -1,11 +1,11 @@
mod common;
use pretty_assertions::assert_eq;
#[cfg(feature = "postgres-tests")]
use crate::common::{test_context, TestContext};
/// Test health endpoint functionality with real database connectivity
/// Test health endpoint with PostgreSQL (requires postgres-tests feature)
#[tokio::test]
#[cfg(feature = "postgres-tests")]
async fn test_health_endpoint() {
let TestContext { server, container, .. } = test_context().use_database(true).call().await;