From c03e90725ff2f2849b7f255da3e098f18bbcd72a Mon Sep 17 00:00:00 2001 From: phoenix Date: Wed, 2 Apr 2025 21:04:55 -0400 Subject: [PATCH] Commenting out code --- tests/auth_tests.rs | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/tests/auth_tests.rs b/tests/auth_tests.rs index d97ba49..7268c22 100644 --- a/tests/auth_tests.rs +++ b/tests/auth_tests.rs @@ -28,6 +28,23 @@ const DEFAULT_TEST_DATABASE_URL: &str = static SETUP: std::sync::Once = std::sync::Once::new(); +// Ensure tracing is initialized only once for all tests in this file +/* +static TRACING_INIT: Lazy<()> = Lazy::new(|| { + if std::env::var("RUST_LOG").is_err() { + // Set default log level if not provided + unsafe { + std::env::set_var("RUST_LOG", "info,tower_http=debug,your_project_name=debug"); + } + } + tracing_subscriber::fmt() + .with_env_filter(tracing_subscriber::EnvFilter::from_default_env()) + .with_test_writer() // Write logs to the test output capture + .init(); +}); +*/ + +/* async fn setup_database() -> sqlx::PgPool { let database_url = std::env::var(TEST_DATABASE_URL_ENV) .unwrap_or_else(|_| DEFAULT_TEST_DATABASE_URL.to_string()); @@ -35,17 +52,17 @@ 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(|| { @@ -54,6 +71,7 @@ async fn test_db_health() { }); }); } +*/ /* async fn setup_test(pool: sqlx::PgPool) -> Router { @@ -63,6 +81,7 @@ async fn setup_test(pool: sqlx::PgPool) -> Router { } */ +/* #[tokio::test] async fn test_hello_world() { let app = Router::new().route(callers::endpoints::ROOT, get(callers::common::root)); // Replace with your handler @@ -89,6 +108,7 @@ async fn test_hello_world() { assert_eq!(body, "Hello, World!"); } +*/ /* #[tokio::test]