Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(cubestore): Expose parts of Config::test for customization #8930

Merged
merged 1 commit into from
Nov 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions rust/cubestore/cubestore/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1547,10 +1547,24 @@ impl Config {
}

pub fn test(name: &str) -> Config {
let query_timeout = 15;
Self::make_test_config(Self::test_config_obj(name))
}

/// Possibly there is nothing test-specific about this; its purpose is to be publicly used by Config::test.
pub fn make_test_config(config_obj_impl: ConfigObjImpl) -> Config {
Config {
injector: Injector::new(),
config_obj: Arc::new(ConfigObjImpl {
config_obj: Arc::new(config_obj_impl),
}
}

/// Constructs the underlying ConfigObjImpl used in `Config::test`, so that you can modify it
/// before passing it to Config::make_test_config.
pub fn test_config_obj(name: &str) -> ConfigObjImpl {
let query_timeout = 15;
// Git blame history preserving block
{
ConfigObjImpl {
data_dir: env::current_dir()
.unwrap()
.join(format!("{}-local-store", name)),
Expand Down Expand Up @@ -1654,7 +1668,7 @@ impl Config {
remote_files_cleanup_delay_secs: 3600,
remote_files_cleanup_batch_size: 50000,
create_table_max_retries: 3,
}),
}
}
}

Expand Down
Loading