feat: bring back sqlness and integration tests (#2448)

* enable integration test

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* update sqlness result

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* disable sqlness region failover

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* enable sqlness in CI

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* sort unstable result

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* set require_lease_before_startup to true

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* fix: fix inconsistent cache

* replace windows path chars

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* ignore some integration cases in windows

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* Revert "ignore some integration cases in windows"

This reverts commit 122478b7c1.

* disable windows for now

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>

* fix: fix close region bug in RegionHeartbeatResponseHandler

* disable failover tests

---------

Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
Co-authored-by: WenyXu <wenymedia@gmail.com>
This commit is contained in:
Ruihang Xia
2023-09-20 04:17:30 -05:00
committed by GitHub
parent 567fbad647
commit 34d6288945
18 changed files with 659 additions and 195 deletions

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;
@@ -577,7 +575,12 @@ async fn test_execute_external_create_infer_format(instance: Arc<dyn MockInstanc
let instance = instance.frontend();
let tmp_dir = temp_dir::create_temp_dir("test_execute_external_create_infer_format");
let location = tmp_dir.path().to_str().unwrap();
let location = tmp_dir
.path()
.to_str()
.unwrap()
.replace(':', "")
.replace('\\', "/");
let output = execute_sql(
&instance,
@@ -1743,7 +1746,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 +1756,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 +1778,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;