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
+7 -5
View File
@@ -1,12 +1,14 @@
mod common;
use crate::common::test_context;
use cookie::Cookie;
use pacman_server::{data::user as user_repo, session};
use pretty_assertions::assert_eq;
/// Test session management (requires postgres-tests feature)
#[tokio::test]
#[cfg(feature = "postgres-tests")]
async fn test_session_management() {
use crate::common::test_context;
use cookie::Cookie;
use pacman_server::{data::user as user_repo, session};
use pretty_assertions::assert_eq;
let context = test_context().use_database(true).call().await;
// 1. Create a user and link a provider account