mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-23 08:20:36 +00:00
enable integration test
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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 }
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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")]
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user