From 4fc15810f4c210bf0533cda58050a742a26e76f6 Mon Sep 17 00:00:00 2001 From: KD Date: Wed, 2 Apr 2025 18:52:00 -0400 Subject: [PATCH] Saving changes --- migrations/20250402221858_init_migrate.sql | 1 + tests/auth_tests.rs | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 migrations/20250402221858_init_migrate.sql diff --git a/migrations/20250402221858_init_migrate.sql b/migrations/20250402221858_init_migrate.sql new file mode 100644 index 0000000..8ddc1d3 --- /dev/null +++ b/migrations/20250402221858_init_migrate.sql @@ -0,0 +1 @@ +-- Add migration script here diff --git a/tests/auth_tests.rs b/tests/auth_tests.rs index 538b79b..d97ba49 100644 --- a/tests/auth_tests.rs +++ b/tests/auth_tests.rs @@ -35,15 +35,26 @@ async fn setup_database() -> sqlx::PgPool { .await .expect("Failed to connect to test database"); + /* let migrator = sqlx::migrate::Migrator::new(std::path::Path::new("./migrations")) .await .expect("Failed to create migrator"); migrator.run(&pool).await.expect("Failed to run migrations"); + */ // Seed here if needed pool } +#[tokio::test] +async fn test_db_health() { + SETUP.call_once(|| { + tokio::runtime::Runtime::new().unwrap().block_on(async { + setup_database().await; + }); + }); +} + /* async fn setup_test(pool: sqlx::PgPool) -> Router { Router::new()