fix: override cookie settings in tests in a separate thread to not delete its value for other tests #21

Merged
realaravinth merged 2 commits from fix-cookie-secret into master 2024-07-11 02:46:37 +05:30
2 changed files with 13 additions and 7 deletions

View file

@ -89,7 +89,8 @@ run: default ## Run debug build
test: ## Run tests test: ## Run tests
#$(call cache_bust) #$(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 #test.coverage.xml: ## Generate cobertura.xml test coverage
# #$(call cache_bust) # #$(call cache_bust)

View file

@ -58,11 +58,16 @@ mod tests {
server.hostname server.hostname
); );
env_helper!(init_settings, "VANIKAM_server_IP", "1.1.1.1", server.ip); env_helper!(init_settings, "VANIKAM_server_IP", "1.1.1.1", server.ip);
std::thread::spawn(move || {
env_helper!( env_helper!(
init_settings, init_settings,
"VANIKAM_server_COOKIE_SECRET", "VANIKAM_server_COOKIE_SECRET",
"asdfasdflkjhasdlkfhalksdf", "asdfasdflkjhasdlkfhalksdf",
server.cookie_secret server.cookie_secret
); );
assert!(true);
})
.join()
.unwrap();
} }
} }