feat(tests): update default credentials for test db

This commit is contained in:
perf3ct 2025-07-21 20:31:07 +00:00
parent 74f9e0484c
commit 80c4aec5e6
No known key found for this signature in database
GPG Key ID: 569C4EEC436F5232
1 changed files with 4 additions and 4 deletions

View File

@ -175,15 +175,15 @@ impl TestContext {
pub async fn with_config(config_builder: TestConfigBuilder) -> Self { pub async fn with_config(config_builder: TestConfigBuilder) -> Self {
let postgres_image = Postgres::default() let postgres_image = Postgres::default()
.with_tag("15") // Use PostgreSQL 15 which has gen_random_uuid() built-in .with_tag("15") // Use PostgreSQL 15 which has gen_random_uuid() built-in
.with_env_var("POSTGRES_USER", "test") .with_env_var("POSTGRES_USER", "readur")
.with_env_var("POSTGRES_PASSWORD", "test") .with_env_var("POSTGRES_PASSWORD", "readur")
.with_env_var("POSTGRES_DB", "test"); .with_env_var("POSTGRES_DB", "readur");
let container = postgres_image.start().await.expect("Failed to start postgres container"); let container = postgres_image.start().await.expect("Failed to start postgres container");
let port = container.get_host_port_ipv4(5432).await.expect("Failed to get postgres port"); let port = container.get_host_port_ipv4(5432).await.expect("Failed to get postgres port");
let database_url = std::env::var("TEST_DATABASE_URL") let database_url = std::env::var("TEST_DATABASE_URL")
.unwrap_or_else(|_| format!("postgresql://test:test@localhost:{}/test", port)); .unwrap_or_else(|_| format!("postgresql://readur:readur@localhost:{}/readur", port));
let db = crate::db::Database::new(&database_url).await.unwrap(); let db = crate::db::Database::new(&database_url).await.unwrap();
// Run proper SQLx migrations (PostgreSQL 15+ has gen_random_uuid() built-in) // Run proper SQLx migrations (PostgreSQL 15+ has gen_random_uuid() built-in)