Skip to content

Commit

Permalink
Use a different config for tests updating the file (#3708)
Browse files Browse the repository at this point in the history
  • Loading branch information
matheus-consoli authored Nov 16, 2023
1 parent 1fc1195 commit 84d95d0
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 15 deletions.
10 changes: 6 additions & 4 deletions crates/fluvio/src/config/cluster.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,9 @@ type = "local"
typ: String,
}

let mut config_file = ConfigFile::load(Some("test-data/profiles/config.toml".to_owned()))
.expect("could not parse config file");
let mut config_file =
ConfigFile::load(Some("test-data/profiles/updatable_config.toml".to_owned()))
.expect("could not parse config file");
let config = config_file.mut_config();

let cluster = config
Expand Down Expand Up @@ -321,8 +322,9 @@ type = "local"

config_file.save().expect("failed to save config file");

let mut config_file = ConfigFile::load(Some("test-data/profiles/config.toml".to_owned()))
.expect("could not parse config file");
let mut config_file =
ConfigFile::load(Some("test-data/profiles/updatable_config.toml".to_owned()))
.expect("could not parse config file");
let config = config_file.mut_config();
let cluster = config
.cluster_mut("updated")
Expand Down
2 changes: 1 addition & 1 deletion crates/fluvio/src/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ pub mod test {
fn test_config() {
// test read & parse
let mut conf_file = ConfigFile::load(Some("test-data/profiles/config.toml".to_owned()))
.expect("parse failed");
.expect("failed to parse file");
let config = conf_file.mut_config();

assert_eq!(config.version(), "1.0");
Expand Down
10 changes: 0 additions & 10 deletions crates/fluvio/test-data/profiles/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,6 @@ cluster = "local"
cluster = "local"
topic = "test3"

[cluster.updated]
endpoint = "127.0.0.1"
use_spu_local_address = false

[cluster.updated.tls]
tls_policy = "disabled"

[cluster.updated.metadata.installation]
type = "local"

[cluster.extra]
endpoint = "127.0.0.1:9003"
use_spu_local_address = false
Expand Down
15 changes: 15 additions & 0 deletions crates/fluvio/test-data/profiles/updatable_config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version = "1.0"
current_profile = "local"

[profile.local]
cluster = "updated"

[cluster.updated]
endpoint = "127.0.0.1"
use_spu_local_address = false

[cluster.updated.tls]
tls_policy = "disabled"

[cluster.updated.metadata.installation]
type = "local"

0 comments on commit 84d95d0

Please sign in to comment.