fix: bootstrap log directives, empty DATABASE_URL test
This commit is contained in:
@@ -410,3 +410,13 @@ fn malformed_config_file_reports_the_file_not_a_missing_database_url() {
|
|||||||
Ok(())
|
Ok(())
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn empty_database_url_is_reported_missing() {
|
||||||
|
Jail::expect_with(|jail| {
|
||||||
|
jail_with(jail, &[("DATABASE_URL", "")]);
|
||||||
|
let err = load().expect_err("empty DATABASE_URL is unset");
|
||||||
|
assert!(matches!(err, ConfigError::Missing("DATABASE_URL")), "{err}");
|
||||||
|
Ok(())
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ use tokio::net::TcpListener;
|
|||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() -> anyhow::Result<()> {
|
async fn main() -> anyhow::Result<()> {
|
||||||
dotenvy::dotenv().ok();
|
dotenvy::dotenv().ok();
|
||||||
bootstrap::init_tracing("server=debug,tower_http=debug");
|
bootstrap::init_tracing("server=debug,bootstrap=debug,tower_http=debug");
|
||||||
|
|
||||||
let config = config::load().context("Failed to load configuration")?;
|
let config = config::load().context("Failed to load configuration")?;
|
||||||
let app = bootstrap::build_server(&config).await?;
|
let app = bootstrap::build_server(&config).await?;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ use anyhow::Context;
|
|||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() -> anyhow::Result<()> {
|
async fn main() -> anyhow::Result<()> {
|
||||||
dotenvy::dotenv().ok();
|
dotenvy::dotenv().ok();
|
||||||
bootstrap::init_tracing("worker=info,application=info,k_ap=info");
|
bootstrap::init_tracing("worker=info,bootstrap=info,application=info,k_ap=info");
|
||||||
|
|
||||||
let config = config::load().context("Failed to load configuration")?;
|
let config = config::load().context("Failed to load configuration")?;
|
||||||
let app = bootstrap::build_worker(&config).await?;
|
let app = bootstrap::build_worker(&config).await?;
|
||||||
|
|||||||
Reference in New Issue
Block a user