From 9591f26be6949a26542d8f08648631127a6920d2 Mon Sep 17 00:00:00 2001 From: Robert Detjens Date: Sun, 17 Nov 2024 16:43:29 -0800 Subject: [PATCH] Ensure envvars don't leak into parsing unit test environment Signed-off-by: Robert Detjens --- src/tests/parsing/config.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tests/parsing/config.rs b/src/tests/parsing/config.rs index d81f806..6260702 100644 --- a/src/tests/parsing/config.rs +++ b/src/tests/parsing/config.rs @@ -11,6 +11,7 @@ use crate::configparser::config::*; /// Test parsing RCDS config where all fields are specified in the yaml fn all_yaml() { figment::Jail::expect_with(|jail| { + jail.clear_env(); jail.create_file( "rcds.yaml", r#" @@ -124,6 +125,7 @@ fn all_yaml() { /// Test parsing RCDS config where some secrets are overridden by envvars fn yaml_with_env_overrides() { figment::Jail::expect_with(|jail| { + jail.clear_env(); jail.create_file( "rcds.yaml", r#" @@ -202,6 +204,7 @@ fn yaml_with_env_overrides() { /// Test parsing RCDS config where secrets are set in envvars and omitted from yaml fn partial_yaml_with_env() { figment::Jail::expect_with(|jail| { + jail.clear_env(); jail.create_file( "rcds.yaml", r#" @@ -271,6 +274,7 @@ fn partial_yaml_with_env() { /// Test attempting to parse missing config file fn bad_no_file() { figment::Jail::expect_with(|jail| { + jail.clear_env(); // don't create file let config = parse();