From 0f3bf764b617f22a3759871e41350f0a6f32dc40 Mon Sep 17 00:00:00 2001 From: Aravinth Manivannan Date: Thu, 11 Jul 2024 02:25:23 +0530 Subject: [PATCH 1/2] fix: override cookie settings in tests in a separate thread to not delete its value for other tests --- src/settings/server.rs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/settings/server.rs b/src/settings/server.rs index ad3967d..c7f7612 100644 --- a/src/settings/server.rs +++ b/src/settings/server.rs @@ -58,11 +58,16 @@ mod tests { server.hostname ); env_helper!(init_settings, "VANIKAM_server_IP", "1.1.1.1", server.ip); - env_helper!( - init_settings, - "VANIKAM_server_COOKIE_SECRET", - "asdfasdflkjhasdlkfhalksdf", - server.cookie_secret - ); + std::thread::spawn(move || { + env_helper!( + init_settings, + "VANIKAM_server_COOKIE_SECRET", + "asdfasdflkjhasdlkfhalksdf", + server.cookie_secret + ); + assert!(true); + }) + .join() + .unwrap(); } } From 222c23c4d8c1130e36b46194104e20fe13355699 Mon Sep 17 00:00:00 2001 From: Aravinth Manivannan Date: Thu, 11 Jul 2024 02:41:27 +0530 Subject: [PATCH 2/2] fix: run src/settings/server.rs tests separately --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ce60493..5329bf1 100644 --- a/Makefile +++ b/Makefile @@ -89,7 +89,8 @@ run: default ## Run debug build test: ## Run tests #$(call cache_bust) - cargo test --all-features --no-fail-fast + cargo test --all-features --no-fail-fast -- --skip test_server_env_override + cargo test --all-features --no-fail-fast -- test_server_env_override #test.coverage.xml: ## Generate cobertura.xml test coverage # #$(call cache_bust)