Added config file for db #9

Merged
phoenix merged 32 commits from db into devel 2025-04-03 13:59:56 +00:00
Showing only changes of commit 2252ff8ec6 - Show all commits

View File

@@ -12,7 +12,7 @@ use axum::{
};
// use hyper::client::conn;
// use sqlx::PgPool;
use sqlx::postgres::PgPoolOptions;
use sqlx::postgres::{self, PgPoolOptions};
use testcontainers_modules::testcontainers::runners::AsyncRunner;
// use hyper::client;
// use sqlx::postgres;
@@ -57,8 +57,9 @@ async fn test_hello_world() {
assert_eq!(body, "Hello, World!");
}
/*
#[tokio::test]
async fn test_db_health_check() {
async fn _test_db_health_check() {
let container = testcontainers_modules::postgres::Postgres::default()
.start()
.await
@@ -73,6 +74,20 @@ async fn test_db_health_check() {
println!("Test Database: {}", conn_string);
let app = Router::new().route(callers::endpoints::DBTEST, get(callers::common::db_ping)); // Replace with your handler
let response = app
.oneshot(
Request::builder()
.uri(callers::endpoints::DBTEST)
.body(Body::empty())
.unwrap(),
)
.await
.unwrap();
assert_eq!(response.status(), StatusCode::OK);
match PgPoolOptions::new().connect(conn_string).await {
Ok(_) => {
assert!(true, "Success");
@@ -82,3 +97,4 @@ async fn test_db_health_check() {
}
};
}
*/