refactor: Consolidate cluster creation in end to end tests (#4373)

pull/24376/head
Andrew Lamb 2022-04-21 14:03:17 -04:00 committed by GitHub
parent cc9205024c
commit abd005e0c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 74 deletions

View File

@ -4,7 +4,7 @@ use predicates::prelude::*;
use serde_json::Value;
use tempfile::tempdir;
use test_helpers_end_to_end_ng::{
maybe_skip_integration, MiniCluster, Step, StepTest, StepTestState, TestConfig,
maybe_skip_integration, MiniCluster, Step, StepTest, StepTestState,
};
/// Tests CLI commands
@ -14,16 +14,8 @@ use test_helpers_end_to_end_ng::{
async fn remote_partition_and_get_from_store() {
let database_url = maybe_skip_integration!();
let router2_config = TestConfig::new_router2(&database_url);
// generate parquet files quickly
let ingester_config = TestConfig::new_ingester(&router2_config).with_fast_parquet_generation();
// Set up the cluster ====================================
let mut cluster = MiniCluster::new()
.with_router2(router2_config)
.await
.with_ingester(ingester_config)
.await;
let mut cluster = MiniCluster::create_quickly_peristing(database_url).await;
StepTest::new(
&mut cluster,

View File

@ -3,7 +3,7 @@ use std::collections::BTreeMap;
use generated_types::influxdata::iox::ingester::v1::PartitionStatus;
use http::StatusCode;
use test_helpers_end_to_end_ng::{
get_write_token, maybe_skip_integration, wait_for_readable, MiniCluster, TestConfig,
get_write_token, maybe_skip_integration, wait_for_readable, MiniCluster,
};
use arrow_util::assert_batches_sorted_eq;
@ -15,15 +15,8 @@ async fn ingester_flight_api() {
let table_name = "mytable";
let router2_config = TestConfig::new_router2(&database_url);
let ingester_config = TestConfig::new_ingester(&router2_config);
// Set up cluster
let cluster = MiniCluster::new()
.with_router2(router2_config)
.await
.with_ingester(ingester_config)
.await;
let cluster = MiniCluster::create_standard(database_url).await;
// Write some data into the v2 HTTP API ==============
let lp = format!("{},tag1=A,tag2=B val=42i 123456", table_name);
@ -99,9 +92,7 @@ async fn ingester_flight_api_namespace_not_found() {
let table_name = "mytable";
// Set up cluster
let router2_config = TestConfig::new_router2(&database_url);
let ingester_config = TestConfig::new_ingester(&router2_config);
let cluster = MiniCluster::new().with_ingester(ingester_config).await;
let cluster = MiniCluster::create_standard(database_url).await;
let mut querier_flight = influxdb_iox_client::flight::Client::<
influxdb_iox_client::flight::generated_types::IngesterQueryRequest,
@ -130,13 +121,7 @@ async fn ingester_flight_api_table_not_found() {
let database_url = maybe_skip_integration!();
// Set up cluster
let router2_config = TestConfig::new_router2(&database_url);
let ingester_config = TestConfig::new_ingester(&router2_config);
let cluster = MiniCluster::new()
.with_router2(router2_config)
.await
.with_ingester(ingester_config)
.await;
let cluster = MiniCluster::create_standard(database_url).await;
// Write some data into the v2 HTTP API ==============
let lp = String::from("my_table,tag1=A,tag2=B val=42i 123456");

View File

@ -12,18 +12,8 @@ async fn basic_ingester() {
let table_name = "the_table";
let router2_config = TestConfig::new_router2(&database_url);
let ingester_config = TestConfig::new_ingester(&router2_config);
let querier_config = TestConfig::new_querier(&ingester_config);
// Set up the cluster ====================================
let mut cluster = MiniCluster::new()
.with_router2(router2_config)
.await
.with_ingester(ingester_config)
.await
.with_querier(querier_config)
.await;
let mut cluster = MiniCluster::create_standard(database_url).await;
StepTest::new(
&mut cluster,
@ -58,19 +48,8 @@ async fn basic_on_parquet() {
let table_name = "the_table";
let router2_config = TestConfig::new_router2(&database_url);
// fast parquet
let ingester_config = TestConfig::new_ingester(&router2_config).with_fast_parquet_generation();
let querier_config = TestConfig::new_querier(&ingester_config);
// Set up the cluster ====================================
let mut cluster = MiniCluster::new()
.with_router2(router2_config)
.await
.with_ingester(ingester_config)
.await
.with_querier(querier_config)
.await;
let mut cluster = MiniCluster::create_quickly_peristing(database_url).await;
StepTest::new(
&mut cluster,
@ -145,19 +124,8 @@ async fn table_not_found_on_ingester() {
let table_name = "the_table";
let router2_config = TestConfig::new_router2(&database_url);
// fast parquet
let ingester_config = TestConfig::new_ingester(&router2_config).with_fast_parquet_generation();
let querier_config = TestConfig::new_querier(&ingester_config);
// Set up the cluster ====================================
let mut cluster = MiniCluster::new()
.with_router2(router2_config)
.await
.with_ingester(ingester_config)
.await
.with_querier(querier_config)
.await;
let mut cluster = MiniCluster::create_quickly_peristing(database_url).await;
StepTest::new(
&mut cluster,

View File

@ -1,6 +1,6 @@
use futures::FutureExt;
use test_helpers_end_to_end_ng::{
maybe_skip_integration, MiniCluster, Step, StepTest, StepTestState, TestConfig,
maybe_skip_integration, MiniCluster, Step, StepTest, StepTestState,
};
use assert_cmd::Command;
@ -11,10 +11,7 @@ use predicates::prelude::*;
async fn ingester_schema_client() {
let database_url = maybe_skip_integration!();
let router2_config = TestConfig::new_router2(&database_url);
// Set up router2 ====================================
let mut cluster = MiniCluster::new().with_router2(router2_config).await;
let mut cluster = MiniCluster::create_standard(database_url).await;
StepTest::new(
&mut cluster,
@ -60,10 +57,7 @@ async fn ingester_schema_client() {
async fn ingester_schema_cli() {
let database_url = maybe_skip_integration!();
let router2_config = TestConfig::new_router2(&database_url);
// Set up router2 ====================================
let mut cluster = MiniCluster::new().with_router2(router2_config).await;
let mut cluster = MiniCluster::create_standard(database_url).await;
StepTest::new(
&mut cluster,

View File

@ -64,7 +64,7 @@ impl MiniCluster {
/// return a "standard" MiniCluster that has a router, ingester,
/// querier and quickly persists files to parquet
pub async fn ccreate_quickly_peristing(database_url: String) -> MiniCluster {
pub async fn create_quickly_peristing(database_url: String) -> MiniCluster {
let router2_config = TestConfig::new_router2(&database_url);
// fast parquet
let ingester_config =