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 2db28fc0da - Show all commits

View File

@@ -2,7 +2,7 @@ extern crate icarus_auth;
use crate::icarus_auth::callers;
use axum::Extension;
// use axum::Extension;
use axum::body::Body;
// use axum::response::Response;
use axum::{
@@ -10,10 +10,10 @@ use axum::{
http::{Request, StatusCode},
routing::get,
};
use hyper::client::conn;
use sqlx::PgPool;
// use hyper::client::conn;
// use sqlx::PgPool;
use sqlx::postgres::PgPoolOptions;
use testcontainers_modules::{postgres, testcontainers::runners::AsyncRunner};
use testcontainers_modules::{testcontainers::runners::AsyncRunner};
// use hyper::client;
// use sqlx::postgres;
// use http::{Request, StatusCode};
@@ -22,11 +22,13 @@ use testcontainers_modules::{postgres, testcontainers::runners::AsyncRunner};
use tower::util::ServiceExt;
// use testcontainers_modules::testcontainers::core::client::
/*
async fn setup_test(pool: sqlx::PgPool) -> Router {
Router::new()
.route(callers::endpoints::DBTEST, get(callers::common::db_ping))
.layer(Extension(pool))
}
*/
#[tokio::test]
async fn test_hello_world() {
@@ -61,7 +63,7 @@ async fn test_db_health_check() {
.start()
.await
.unwrap();
let host_ip = container.get_host().await.unwrap();
let _host_ip = container.get_host().await.unwrap();
let host_port = container.get_host_port_ipv4(5432).await.unwrap();
let conn_string = &format!(
"postgres://postgres:postgres@localhost:{}/postgres",
@@ -70,5 +72,5 @@ async fn test_db_health_check() {
println!("Test Database: {}", conn_string);
let test_pool = PgPoolOptions::new().connect(conn_string).await.unwrap();
let _test_pool = PgPoolOptions::new().connect(conn_string).await.unwrap();
}