enable integration test

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
Ruihang Xia
2023-09-19 21:51:22 +08:00
parent 0f79ccab31
commit 6ed6e26693
5 changed files with 33 additions and 36 deletions

View File

@@ -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"

View File

@@ -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 }

View File

@@ -476,7 +476,6 @@ async fn test_execute_show_databases_tables(instance: Arc<dyn MockInstance>) {
| Tables |
+---------+
| numbers |
| scripts |
+---------+\
";
let output = execute_sql(&instance, "show tables").await;
@@ -494,7 +493,6 @@ async fn test_execute_show_databases_tables(instance: Arc<dyn MockInstance>) {
+---------+
| demo |
| numbers |
| scripts |
+---------+\
";
check_unordered_output_stream(output, expected).await;
@@ -1743,7 +1741,6 @@ async fn test_information_schema_dot_tables(instance: Arc<dyn MockInstance>) {
+---------------+--------------------+------------+-----------------+----------+-------------+
| 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<dyn MockInstance>) {
+-----------------+--------------------+---------------+-----------------+----------+--------+
| 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<dyn MockInstance>) {
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;

View File

@@ -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::<Vec<&str>>()
.join("\n")
.join(
"
",
)
}
#[cfg(feature = "dashboard")]

View File

@@ -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;