diff --git a/packages/backend/crates/macros/src/tests.rs b/packages/backend/crates/macros/src/tests.rs index 021443eb7d..cf548db163 100644 --- a/packages/backend/crates/macros/src/tests.rs +++ b/packages/backend/crates/macros/src/tests.rs @@ -4,8 +4,21 @@ macro_rules! setup_test_config { () => { #[cfg(test)] - config::init_config(Path::new( - &env::var("CK_TEST_CONFIG").expect("CK_TEST_CONFIG environment variable not set"), - )).expect("Could not initialize test config"); + { + let path = std::env::var("CK_TEST_CONFIG") + .expect("CK_TEST_CONFIG environment variable not set"); + let path = std::path::Path::new(&path); + + config::init_config(&path).expect("Could not initialize test config"); + } + }; +} + +#[cfg(test)] +#[allow(clippy::module_inception)] +mod tests { + #[test] + fn can_parse_test_config() { + setup_test_config!(); } } diff --git a/packages/backend/crates/server/src/lib.rs b/packages/backend/crates/server/src/lib.rs index 1c603fd4b6..c09eac9dfb 100644 --- a/packages/backend/crates/server/src/lib.rs +++ b/packages/backend/crates/server/src/lib.rs @@ -2,7 +2,6 @@ use axum::Router; use tokio::runtime; - use config::get_config; pub mod api { @@ -39,8 +38,8 @@ pub fn init() -> anyhow::Result<()> { #[cfg(test)] mod tests { - #[test] - fn test() { - macros::test_setup_config!(); - } +// #[test] +// fn test() { +// macros::setup_test_config!(); +// } } diff --git a/packages/backend/package.json b/packages/backend/package.json index d32be74efc..c65e04c358 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -10,6 +10,6 @@ "build": "cargo build --profile ${NODE_ENV:=development}", "revertmigration": "typeorm migration:revert -d ormconfig.js", "lint": "cargo check", - "test": "CK_TEST_CONFIG='../../.config/test.yml' cargo test --workspace" + "test": "CK_TEST_CONFIG=\"$(pwd)/../../.config/ci.yml\" cargo test --workspace" } }