Skip to content

Commit

Permalink
Change flaky test to using with_env_vars (#2434)
Browse files Browse the repository at this point in the history
  • Loading branch information
gememma authored May 9, 2024
1 parent 9b9ec7d commit 853be85
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions changelog.d/2163.internal.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Use `with_env_vars` in flaky `fs_config_default` test
15 changes: 9 additions & 6 deletions mirrord/config/src/feature/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,20 +126,23 @@ mod tests {
use rstest::rstest;

use super::*;
use crate::config::MirrordConfig;
use crate::{config::MirrordConfig, util::testing::with_env_vars};

#[rstest]
fn fs_config_default() {
let mut cfg_context = ConfigContext::default();
let expect = FsConfig {
mode: FsModeConfig::Read,
..Default::default()
};

let fs_config = FsUserConfig::default()
.generate_config(&mut cfg_context)
.unwrap();
with_env_vars(vec![], || {
let mut cfg_context = ConfigContext::default();

assert_eq!(fs_config, expect);
let fs_config = FsUserConfig::default()
.generate_config(&mut cfg_context)
.unwrap();

assert_eq!(fs_config, expect);
});
}
}

0 comments on commit 853be85

Please sign in to comment.