Skip to content

Commit

Permalink
Simplify NodeConfig serialize
Browse files Browse the repository at this point in the history
  • Loading branch information
rdettai committed Aug 26, 2024
1 parent 4e45cba commit 162f744
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
5 changes: 4 additions & 1 deletion quickwit/quickwit-config/src/node_config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,9 +480,12 @@ impl NodeConfig {
self.storage_configs.redact();
}

/// Creates a config with defaults suitable for testing.
///
/// Uses the default ports without ensuring that they are available.
#[cfg(any(test, feature = "testsuite"))]
pub fn for_test() -> Self {
serialize::node_config_for_tests()
serialize::node_config_for_tests_from_ports(7280, 7281)
}

#[cfg(any(test, feature = "testsuite"))]
Expand Down
9 changes: 0 additions & 9 deletions quickwit/quickwit-config/src/node_config/serialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,15 +467,6 @@ pub fn node_config_for_tests_from_ports(
}
}

/// Creates a config with defaults that are suitable for testing.
///
/// Uses the default ports without ensuring that they are available.
#[cfg(any(test, feature = "testsuite"))]
pub fn node_config_for_tests() -> NodeConfig {
let default_rest = default_rest_listen_port();
node_config_for_tests_from_ports(default_rest, default_rest + 1)
}

#[cfg(test)]
mod tests {
use std::env;
Expand Down

0 comments on commit 162f744

Please sign in to comment.