refactor: Consolidate cluster creation in end to end tests (#4373)
parent
cc9205024c
commit
abd005e0c2
|
@ -4,7 +4,7 @@ use predicates::prelude::*;
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
use tempfile::tempdir;
|
use tempfile::tempdir;
|
||||||
use test_helpers_end_to_end_ng::{
|
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
|
/// Tests CLI commands
|
||||||
|
@ -14,16 +14,8 @@ use test_helpers_end_to_end_ng::{
|
||||||
async fn remote_partition_and_get_from_store() {
|
async fn remote_partition_and_get_from_store() {
|
||||||
let database_url = maybe_skip_integration!();
|
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 ====================================
|
// Set up the cluster ====================================
|
||||||
let mut cluster = MiniCluster::new()
|
let mut cluster = MiniCluster::create_quickly_peristing(database_url).await;
|
||||||
.with_router2(router2_config)
|
|
||||||
.await
|
|
||||||
.with_ingester(ingester_config)
|
|
||||||
.await;
|
|
||||||
|
|
||||||
StepTest::new(
|
StepTest::new(
|
||||||
&mut cluster,
|
&mut cluster,
|
||||||
|
|
|
@ -3,7 +3,7 @@ use std::collections::BTreeMap;
|
||||||
use generated_types::influxdata::iox::ingester::v1::PartitionStatus;
|
use generated_types::influxdata::iox::ingester::v1::PartitionStatus;
|
||||||
use http::StatusCode;
|
use http::StatusCode;
|
||||||
use test_helpers_end_to_end_ng::{
|
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;
|
use arrow_util::assert_batches_sorted_eq;
|
||||||
|
@ -15,15 +15,8 @@ async fn ingester_flight_api() {
|
||||||
|
|
||||||
let table_name = "mytable";
|
let table_name = "mytable";
|
||||||
|
|
||||||
let router2_config = TestConfig::new_router2(&database_url);
|
|
||||||
let ingester_config = TestConfig::new_ingester(&router2_config);
|
|
||||||
|
|
||||||
// Set up cluster
|
// Set up cluster
|
||||||
let cluster = MiniCluster::new()
|
let cluster = MiniCluster::create_standard(database_url).await;
|
||||||
.with_router2(router2_config)
|
|
||||||
.await
|
|
||||||
.with_ingester(ingester_config)
|
|
||||||
.await;
|
|
||||||
|
|
||||||
// Write some data into the v2 HTTP API ==============
|
// Write some data into the v2 HTTP API ==============
|
||||||
let lp = format!("{},tag1=A,tag2=B val=42i 123456", table_name);
|
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";
|
let table_name = "mytable";
|
||||||
|
|
||||||
// Set up cluster
|
// Set up cluster
|
||||||
let router2_config = TestConfig::new_router2(&database_url);
|
let cluster = MiniCluster::create_standard(database_url).await;
|
||||||
let ingester_config = TestConfig::new_ingester(&router2_config);
|
|
||||||
let cluster = MiniCluster::new().with_ingester(ingester_config).await;
|
|
||||||
|
|
||||||
let mut querier_flight = influxdb_iox_client::flight::Client::<
|
let mut querier_flight = influxdb_iox_client::flight::Client::<
|
||||||
influxdb_iox_client::flight::generated_types::IngesterQueryRequest,
|
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!();
|
let database_url = maybe_skip_integration!();
|
||||||
|
|
||||||
// Set up cluster
|
// Set up cluster
|
||||||
let router2_config = TestConfig::new_router2(&database_url);
|
let cluster = MiniCluster::create_standard(database_url).await;
|
||||||
let ingester_config = TestConfig::new_ingester(&router2_config);
|
|
||||||
let cluster = MiniCluster::new()
|
|
||||||
.with_router2(router2_config)
|
|
||||||
.await
|
|
||||||
.with_ingester(ingester_config)
|
|
||||||
.await;
|
|
||||||
|
|
||||||
// Write some data into the v2 HTTP API ==============
|
// Write some data into the v2 HTTP API ==============
|
||||||
let lp = String::from("my_table,tag1=A,tag2=B val=42i 123456");
|
let lp = String::from("my_table,tag1=A,tag2=B val=42i 123456");
|
||||||
|
|
|
@ -12,18 +12,8 @@ async fn basic_ingester() {
|
||||||
|
|
||||||
let table_name = "the_table";
|
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 ====================================
|
// Set up the cluster ====================================
|
||||||
let mut cluster = MiniCluster::new()
|
let mut cluster = MiniCluster::create_standard(database_url).await;
|
||||||
.with_router2(router2_config)
|
|
||||||
.await
|
|
||||||
.with_ingester(ingester_config)
|
|
||||||
.await
|
|
||||||
.with_querier(querier_config)
|
|
||||||
.await;
|
|
||||||
|
|
||||||
StepTest::new(
|
StepTest::new(
|
||||||
&mut cluster,
|
&mut cluster,
|
||||||
|
@ -58,19 +48,8 @@ async fn basic_on_parquet() {
|
||||||
|
|
||||||
let table_name = "the_table";
|
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 ====================================
|
// Set up the cluster ====================================
|
||||||
let mut cluster = MiniCluster::new()
|
let mut cluster = MiniCluster::create_quickly_peristing(database_url).await;
|
||||||
.with_router2(router2_config)
|
|
||||||
.await
|
|
||||||
.with_ingester(ingester_config)
|
|
||||||
.await
|
|
||||||
.with_querier(querier_config)
|
|
||||||
.await;
|
|
||||||
|
|
||||||
StepTest::new(
|
StepTest::new(
|
||||||
&mut cluster,
|
&mut cluster,
|
||||||
|
@ -145,19 +124,8 @@ async fn table_not_found_on_ingester() {
|
||||||
|
|
||||||
let table_name = "the_table";
|
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 ====================================
|
// Set up the cluster ====================================
|
||||||
let mut cluster = MiniCluster::new()
|
let mut cluster = MiniCluster::create_quickly_peristing(database_url).await;
|
||||||
.with_router2(router2_config)
|
|
||||||
.await
|
|
||||||
.with_ingester(ingester_config)
|
|
||||||
.await
|
|
||||||
.with_querier(querier_config)
|
|
||||||
.await;
|
|
||||||
|
|
||||||
StepTest::new(
|
StepTest::new(
|
||||||
&mut cluster,
|
&mut cluster,
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use futures::FutureExt;
|
use futures::FutureExt;
|
||||||
use test_helpers_end_to_end_ng::{
|
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;
|
use assert_cmd::Command;
|
||||||
|
@ -11,10 +11,7 @@ use predicates::prelude::*;
|
||||||
async fn ingester_schema_client() {
|
async fn ingester_schema_client() {
|
||||||
let database_url = maybe_skip_integration!();
|
let database_url = maybe_skip_integration!();
|
||||||
|
|
||||||
let router2_config = TestConfig::new_router2(&database_url);
|
let mut cluster = MiniCluster::create_standard(database_url).await;
|
||||||
|
|
||||||
// Set up router2 ====================================
|
|
||||||
let mut cluster = MiniCluster::new().with_router2(router2_config).await;
|
|
||||||
|
|
||||||
StepTest::new(
|
StepTest::new(
|
||||||
&mut cluster,
|
&mut cluster,
|
||||||
|
@ -60,10 +57,7 @@ async fn ingester_schema_client() {
|
||||||
async fn ingester_schema_cli() {
|
async fn ingester_schema_cli() {
|
||||||
let database_url = maybe_skip_integration!();
|
let database_url = maybe_skip_integration!();
|
||||||
|
|
||||||
let router2_config = TestConfig::new_router2(&database_url);
|
let mut cluster = MiniCluster::create_standard(database_url).await;
|
||||||
|
|
||||||
// Set up router2 ====================================
|
|
||||||
let mut cluster = MiniCluster::new().with_router2(router2_config).await;
|
|
||||||
|
|
||||||
StepTest::new(
|
StepTest::new(
|
||||||
&mut cluster,
|
&mut cluster,
|
||||||
|
|
|
@ -64,7 +64,7 @@ impl MiniCluster {
|
||||||
|
|
||||||
/// return a "standard" MiniCluster that has a router, ingester,
|
/// return a "standard" MiniCluster that has a router, ingester,
|
||||||
/// querier and quickly persists files to parquet
|
/// 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);
|
let router2_config = TestConfig::new_router2(&database_url);
|
||||||
// fast parquet
|
// fast parquet
|
||||||
let ingester_config =
|
let ingester_config =
|
||||||
|
|
Loading…
Reference in New Issue