Skip to content

Commit

Permalink
use unique global data dir
Browse files Browse the repository at this point in the history
  • Loading branch information
pront committed Jan 12, 2024
1 parent e3fdf66 commit 29b0d29
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -556,14 +556,22 @@ mod tests {

use crate::{config, topology};
use indoc::indoc;
use tempfile::tempdir;

use super::{builder::ConfigBuilder, format, load_from_str, ComponentKey, ConfigDiff, Format};

async fn load(config: &str, format: config::Format) -> Result<Vec<String>, Vec<String>> {
let temp_global_dir = tempdir().unwrap();
let temp_global_dir_str = temp_global_dir.path().to_str().unwrap();
let config_with_unique_global_dir = format!(
r#"
"data_dir = "{temp_global_dir_str}"
{config}"#
);
match config::load_from_str(config, format) {
Ok(c) => {
let diff = ConfigDiff::initial(&c);
let c2 = config::load_from_str(config, format).unwrap();
let c2 = config::load_from_str(&config_with_unique_global_dir, format).unwrap();
match (
config::warnings(&c2),
topology::TopologyPieces::build(&c, &diff, HashMap::new(), Default::default())
Expand Down

0 comments on commit 29b0d29

Please sign in to comment.