From 243558b950a1a5ea0e5cab46fa963b00a95d7f18 Mon Sep 17 00:00:00 2001 From: oabrivard Date: Thu, 26 Mar 2026 11:13:48 +0100 Subject: [PATCH] debug: add full_app_health_check test with logging --- backend/tests/minimal_test.rs | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/backend/tests/minimal_test.rs b/backend/tests/minimal_test.rs index 8d8f804..9cbe5ad 100644 --- a/backend/tests/minimal_test.rs +++ b/backend/tests/minimal_test.rs @@ -1,4 +1,6 @@ -/// Minimal test to debug oneshot() hanging issue. +/// Minimal tests to debug oneshot() hanging issue. +mod common; + use axum::body::Body; use axum::http::{Request, StatusCode}; use axum::{routing::get, Router}; @@ -24,3 +26,26 @@ async fn minimal_oneshot_works() { let body = response.into_body().collect().await.unwrap().to_bytes(); assert_eq!(&body[..], b"ok"); } + +#[tokio::test] +async fn full_app_health_check() { + if std::env::var("TEST_DATABASE_URL").is_err() { + eprintln!("SKIPPED: TEST_DATABASE_URL not set"); + return; + } + + eprintln!("Creating TestApp..."); + let app = common::TestApp::new().await; + eprintln!("TestApp created. Sending request..."); + + let req: Request = Request::builder() + .uri("/api/v1/health") + .body(Body::empty()) + .unwrap(); + + eprintln!("Calling oneshot..."); + let response = app.router.clone().oneshot(req).await.unwrap(); + eprintln!("Got response: {}", response.status()); + + assert_eq!(response.status(), StatusCode::OK); +}