diff --git a/tests-integration/src/cluster.rs b/tests-integration/src/cluster.rs index 6df84a5ec5f1..a41f13127c26 100644 --- a/tests-integration/src/cluster.rs +++ b/tests-integration/src/cluster.rs @@ -59,7 +59,7 @@ pub struct GreptimeDbClusterBuilder { cluster_name: String, kv_backend: KvBackendRef, store_config: Option, - custom_store_types: Option>, + store_providers: Option>, datanodes: Option, } @@ -69,7 +69,7 @@ impl GreptimeDbClusterBuilder { cluster_name: cluster_name.to_string(), kv_backend: Arc::new(MemoryKvBackend::new()), store_config: None, - custom_store_types: None, + store_providers: None, datanodes: None, } } @@ -79,8 +79,8 @@ impl GreptimeDbClusterBuilder { self } - pub fn with_custom_store_types(mut self, store_types: Vec) -> Self { - self.custom_store_types = Some(store_types); + pub fn with_store_providers(mut self, store_providers: Vec) -> Self { + self.store_providers = Some(store_providers); self } @@ -163,7 +163,7 @@ impl GreptimeDbClusterBuilder { } else { let (opts, guard) = create_tmp_dir_and_datanode_opts( StorageType::File, - self.custom_store_types.clone().unwrap_or_default(), + self.store_providers.clone().unwrap_or_default(), &format!("{}-dn-{}", self.cluster_name, datanode_id), ); diff --git a/tests-integration/src/standalone.rs b/tests-integration/src/standalone.rs index b472941bca3f..b1fb514f7506 100644 --- a/tests-integration/src/standalone.rs +++ b/tests-integration/src/standalone.rs @@ -37,7 +37,7 @@ pub struct GreptimeDbStandalone { pub struct GreptimeDbStandaloneBuilder { instance_name: String, - custom_store_types: Option>, + store_providers: Option>, default_store: Option, plugin: Option, } @@ -46,7 +46,7 @@ impl GreptimeDbStandaloneBuilder { pub fn new(instance_name: &str) -> Self { Self { instance_name: instance_name.to_string(), - custom_store_types: None, + store_providers: None, plugin: None, default_store: None, } @@ -60,9 +60,9 @@ impl GreptimeDbStandaloneBuilder { } #[cfg(test)] - pub fn with_custom_store_types(self, store_types: Vec) -> Self { + pub fn with_store_providers(self, store_providers: Vec) -> Self { Self { - custom_store_types: Some(store_types), + store_providers: Some(store_providers), ..self } } @@ -77,7 +77,7 @@ impl GreptimeDbStandaloneBuilder { pub async fn build(self) -> GreptimeDbStandalone { let default_store_type = self.default_store.unwrap_or(StorageType::File); - let store_types = self.custom_store_types.unwrap_or_default(); + let store_types = self.store_providers.unwrap_or_default(); let (opts, guard) = create_tmp_dir_and_datanode_opts(default_store_type, store_types, &self.instance_name); diff --git a/tests-integration/src/test_util.rs b/tests-integration/src/test_util.rs index 4b0572fc32a6..ad69c40ada33 100644 --- a/tests-integration/src/test_util.rs +++ b/tests-integration/src/test_util.rs @@ -295,26 +295,26 @@ impl TestGuard { pub fn create_tmp_dir_and_datanode_opts( default_store_type: StorageType, - custom_store_types: Vec, + store_provider_types: Vec, name: &str, ) -> (DatanodeOptions, TestGuard) { let home_tmp_dir = create_temp_dir(&format!("gt_data_{name}")); let home_dir = home_tmp_dir.path().to_str().unwrap().to_string(); // Excludes the default object store. - let mut providers = Vec::with_capacity(custom_store_types.len()); + let mut store_providers = Vec::with_capacity(store_provider_types.len()); // Includes the default object store. - let mut storage_guards = Vec::with_capacity(custom_store_types.len() + 1); + let mut storage_guards = Vec::with_capacity(store_provider_types.len() + 1); let (default_store, data_tmp_dir) = get_test_store_config(&default_store_type); storage_guards.push(StorageGuard(data_tmp_dir)); - for store_type in custom_store_types { + for store_type in store_provider_types { let (store, data_tmp_dir) = get_test_store_config(&store_type); - providers.push(store); + store_providers.push(store); storage_guards.push(StorageGuard(data_tmp_dir)) } - let opts = create_datanode_opts(default_store, providers, home_dir); + let opts = create_datanode_opts(default_store, store_providers, home_dir); ( opts, diff --git a/tests-integration/src/tests/test_util.rs b/tests-integration/src/tests/test_util.rs index 4265e1fb1cf3..23bec64a701f 100644 --- a/tests-integration/src/tests/test_util.rs +++ b/tests-integration/src/tests/test_util.rs @@ -68,7 +68,7 @@ pub(crate) async fn standalone_with_multiple_object_stores() -> Arc Arc Arc { let _ = dotenv::dotenv(); let test_name = uuid::Uuid::new_v4().to_string(); - let custom_storage_types = StorageType::build_storage_types_based_on_env(); + let providers = StorageType::build_storage_types_based_on_env(); let cluster = GreptimeDbClusterBuilder::new(&test_name) - .with_custom_store_types(custom_storage_types) + .with_store_providers(providers) .build() .await; Arc::new(MockDistributedInstance(cluster))