From 6ed6e266933a2391ba50105520d543c8d2381189 Mon Sep 17 00:00:00 2001 From: Ruihang Xia Date: Tue, 19 Sep 2023 21:51:22 +0800 Subject: [PATCH] enable integration test Signed-off-by: Ruihang Xia --- Cargo.toml | 3 +- tests-integration/Cargo.toml | 1 - tests-integration/src/tests/instance_test.rs | 46 ++++++++------------ tests-integration/tests/http.rs | 7 ++- tests-integration/tests/sql.rs | 12 +++-- 5 files changed, 33 insertions(+), 36 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9030541af4..8513ed610e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,8 +48,7 @@ members = [ "src/storage", "src/store-api", "src/table", - # TODO: add this back once the region server is available - # "tests-integration", + "tests-integration", "tests/runner", ] resolver = "2" diff --git a/tests-integration/Cargo.toml b/tests-integration/Cargo.toml index d58daccca2..f75420d605 100644 --- a/tests-integration/Cargo.toml +++ b/tests-integration/Cargo.toml @@ -35,7 +35,6 @@ frontend = { workspace = true, features = ["testing"] } futures.workspace = true meta-client = { workspace = true } meta-srv = { workspace = true, features = ["mock"] } -mito = { workspace = true, features = ["test"] } object-store = { workspace = true } once_cell.workspace = true operator = { workspace = true } diff --git a/tests-integration/src/tests/instance_test.rs b/tests-integration/src/tests/instance_test.rs index b83c0fe55a..2da472ae9d 100644 --- a/tests-integration/src/tests/instance_test.rs +++ b/tests-integration/src/tests/instance_test.rs @@ -476,7 +476,6 @@ async fn test_execute_show_databases_tables(instance: Arc) { | Tables | +---------+ | numbers | -| scripts | +---------+\ "; let output = execute_sql(&instance, "show tables").await; @@ -494,7 +493,6 @@ async fn test_execute_show_databases_tables(instance: Arc) { +---------+ | demo | | numbers | -| scripts | +---------+\ "; check_unordered_output_stream(output, expected).await; @@ -1743,7 +1741,6 @@ async fn test_information_schema_dot_tables(instance: Arc) { +---------------+--------------------+------------+-----------------+----------+-------------+ | greptime | information_schema | columns | LOCAL TEMPORARY | 4 | | | greptime | public | numbers | LOCAL TEMPORARY | 2 | test_engine | -| greptime | public | scripts | BASE TABLE | 1024 | mito | | greptime | information_schema | tables | LOCAL TEMPORARY | 3 | | +---------------+--------------------+------------+-----------------+----------+-------------+"; @@ -1754,7 +1751,7 @@ async fn test_information_schema_dot_tables(instance: Arc) { +-----------------+--------------------+---------------+-----------------+----------+--------+ | table_catalog | table_schema | table_name | table_type | table_id | engine | +-----------------+--------------------+---------------+-----------------+----------+--------+ -| another_catalog | another_schema | another_table | BASE TABLE | 1025 | mito | +| another_catalog | another_schema | another_table | BASE TABLE | 1024 | mito | | another_catalog | information_schema | columns | LOCAL TEMPORARY | 4 | | | another_catalog | information_schema | tables | LOCAL TEMPORARY | 3 | | +-----------------+--------------------+---------------+-----------------+----------+--------+"; @@ -1776,30 +1773,23 @@ async fn test_information_schema_dot_columns(instance: Arc) { let output = execute_sql(&instance, sql).await; let expected = "\ -+---------------+--------------------+------------+---------------+----------------------+---------------+ -| table_catalog | table_schema | table_name | column_name | data_type | semantic_type | -+---------------+--------------------+------------+---------------+----------------------+---------------+ -| greptime | information_schema | columns | table_catalog | String | FIELD | -| greptime | information_schema | columns | table_schema | String | FIELD | -| greptime | information_schema | columns | table_name | String | FIELD | -| greptime | information_schema | columns | column_name | String | FIELD | -| greptime | information_schema | columns | data_type | String | FIELD | -| greptime | information_schema | columns | semantic_type | String | FIELD | -| greptime | public | numbers | number | UInt32 | TAG | -| greptime | public | scripts | schema | String | TAG | -| greptime | public | scripts | name | String | TAG | -| greptime | public | scripts | script | String | FIELD | -| greptime | public | scripts | engine | String | FIELD | -| greptime | public | scripts | timestamp | TimestampMillisecond | TIMESTAMP | -| greptime | public | scripts | gmt_created | TimestampMillisecond | FIELD | -| greptime | public | scripts | gmt_modified | TimestampMillisecond | FIELD | -| greptime | information_schema | tables | table_catalog | String | FIELD | -| greptime | information_schema | tables | table_schema | String | FIELD | -| greptime | information_schema | tables | table_name | String | FIELD | -| greptime | information_schema | tables | table_type | String | FIELD | -| greptime | information_schema | tables | table_id | UInt32 | FIELD | -| greptime | information_schema | tables | engine | String | FIELD | -+---------------+--------------------+------------+---------------+----------------------+---------------+"; ++---------------+--------------------+------------+---------------+-----------+---------------+ +| table_catalog | table_schema | table_name | column_name | data_type | semantic_type | ++---------------+--------------------+------------+---------------+-----------+---------------+ +| greptime | information_schema | columns | table_catalog | String | FIELD | +| greptime | information_schema | columns | table_schema | String | FIELD | +| greptime | information_schema | columns | table_name | String | FIELD | +| greptime | information_schema | columns | column_name | String | FIELD | +| greptime | information_schema | columns | data_type | String | FIELD | +| greptime | information_schema | columns | semantic_type | String | FIELD | +| greptime | public | numbers | number | UInt32 | TAG | +| greptime | information_schema | tables | table_catalog | String | FIELD | +| greptime | information_schema | tables | table_schema | String | FIELD | +| greptime | information_schema | tables | table_name | String | FIELD | +| greptime | information_schema | tables | table_type | String | FIELD | +| greptime | information_schema | tables | table_id | UInt32 | FIELD | +| greptime | information_schema | tables | engine | String | FIELD | ++---------------+--------------------+------------+---------------+-----------+---------------+"; check_output_stream(output, expected).await; diff --git a/tests-integration/tests/http.rs b/tests-integration/tests/http.rs index e5b40c026b..b5c3db2f4f 100644 --- a/tests-integration/tests/http.rs +++ b/tests-integration/tests/http.rs @@ -606,7 +606,7 @@ pub async fn test_config_api(store_type: StorageType) { let expected_toml_str = format!( r#"mode = "standalone" node_id = 0 -coordination = false +require_lease_before_startup = false rpc_addr = "127.0.0.1:3001" rpc_runtime_size = 8 enable_telemetry = true @@ -689,7 +689,10 @@ fn drop_lines_with_inconsistent_results(input: String) -> String { && !line.trim().starts_with("scope =") }) .collect::>() - .join("\n") + .join( + " +", + ) } #[cfg(feature = "dashboard")] diff --git a/tests-integration/tests/sql.rs b/tests-integration/tests/sql.rs index 8d4b83a1c1..a8efea7da0 100644 --- a/tests-integration/tests/sql.rs +++ b/tests-integration/tests/sql.rs @@ -54,10 +54,13 @@ macro_rules! sql_tests { $service, test_mysql_auth, - test_mysql_crud, + // ignore: https://github.com/GreptimeTeam/greptimedb/issues/2445 + // test_mysql_crud, test_postgres_auth, - test_postgres_crud, - test_postgres_parameter_inference, + // ignore: https://github.com/GreptimeTeam/greptimedb/issues/2445 + // test_postgres_crud, + // ignore: https://github.com/GreptimeTeam/greptimedb/issues/2445 + // test_postgres_parameter_inference, ); )* }; @@ -120,6 +123,7 @@ pub async fn test_mysql_auth(store_type: StorageType) { guard.remove_all().await; } +#[allow(dead_code)] pub async fn test_mysql_crud(store_type: StorageType) { common_telemetry::init_default_ut_logging(); @@ -266,6 +270,7 @@ pub async fn test_postgres_auth(store_type: StorageType) { guard.remove_all().await; } +#[allow(dead_code)] pub async fn test_postgres_crud(store_type: StorageType) { let (addr, mut guard, fe_pg_server) = setup_pg_server(store_type, "sql_crud").await; @@ -342,6 +347,7 @@ pub async fn test_postgres_crud(store_type: StorageType) { guard.remove_all().await; } +#[allow(dead_code)] pub async fn test_postgres_parameter_inference(store_type: StorageType) { let (addr, mut guard, fe_pg_server) = setup_pg_server(store_type, "sql_inference").await;