diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 13e1ffaacc..430796f7ce 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -91,8 +91,8 @@ jobs: run: | diff ${LOCK_FILE} ${LOCK_FILE}.bak - name: Run Sqlness + working-directory: integration_tests run: | - cd tests make run env: RUST_BACKTRACE: "1" diff --git a/Cargo.lock b/Cargo.lock index 9f9aed7ffa..6fdd38a1a2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5642,9 +5642,9 @@ dependencies = [ [[package]] name = "sqlness" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b94ee738bee88148b3226795dbd0f18076a8c48d5dd91d5dd573ebc20ed0855" +checksum = "3ffa69a2ae10018ec72a3cb7574e3a33a3fc322ed03740f6e435fd7f0c1db4a7" dependencies = [ "async-trait", "derive_builder", diff --git a/Cargo.toml b/Cargo.toml index 1ebfd5d22d..5afebddd21 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,6 +31,7 @@ members = [ "components/table_kv", "components/tracing_util", "df_operator", + "integration_tests", "interpreters", "meta_client", "proto", @@ -41,7 +42,6 @@ members = [ "sql", "system_catalog", "table_engine", - "tests/sqlness", "tools", "wal", ] diff --git a/tests/sqlness/Cargo.toml b/integration_tests/Cargo.toml similarity index 94% rename from tests/sqlness/Cargo.toml rename to integration_tests/Cargo.toml index 8bdf4a94bb..9aeb4f8edf 100644 --- a/tests/sqlness/Cargo.toml +++ b/integration_tests/Cargo.toml @@ -9,5 +9,5 @@ workspace = true anyhow = "1.0.58" async-trait = "0.1" ceresdb-client-rs = { git = "https://github.com/CeresDB/ceresdb-client-rs.git", rev = "a9d9190f4f7b55171ea2ad142fb41dc9909c19c5" } -sqlness = "0.1" +sqlness = "0.1.1" tokio = { workspace = true } diff --git a/tests/Makefile b/integration_tests/Makefile similarity index 76% rename from tests/Makefile rename to integration_tests/Makefile index 12c09919c7..08841656ff 100644 --- a/tests/Makefile +++ b/integration_tests/Makefile @@ -6,7 +6,7 @@ DATA_DIR = /tmp/ceresdb export CERESDB_BINARY_PATH ?= $(ROOT)/../target/$(MODE)/ceresdb-server export CERESDB_SERVER_ENDPOINT ?= 127.0.0.1:8831 export CERESDB_TEST_CASE_PATH ?= $(ROOT)/cases -export CERESDB_TEST_SQLNESS ?= $(ROOT)/../target/$(MODE)/ceresdb-test +export CERESDB_TEST_BINARY ?= $(ROOT)/../target/$(MODE)/ceresdb-test export CERESDB_STDOUT_FILE ?= /tmp/ceresdb-stdout.log export CERESDB_STDERR_FILE ?= /tmp/ceresdb-stderr.log @@ -16,10 +16,10 @@ clean: build-ceresdb: cd .. && cargo build --bin ceresdb-server -build-sqlness: - cd sqlness && cargo build +build-test: + cargo build -build: build-ceresdb build-sqlness +build: build-ceresdb build-test # rename ${case}.output to ${case}.result automatically. fd is required # https://github.com/sharkdp/fd @@ -27,4 +27,4 @@ fix: fd -t f output --exec mv {} {.}.result \; run: clean build - cd sqlness && $(CERESDB_TEST_SQLNESS) + $(CERESDB_TEST_BINARY) diff --git a/tests/README.md b/integration_tests/README.md similarity index 100% rename from tests/README.md rename to integration_tests/README.md diff --git a/tests/cases/local/00_dummy/select_1.result b/integration_tests/cases/local/00_dummy/select_1.result similarity index 100% rename from tests/cases/local/00_dummy/select_1.result rename to integration_tests/cases/local/00_dummy/select_1.result diff --git a/tests/cases/local/00_dummy/select_1.sql b/integration_tests/cases/local/00_dummy/select_1.sql similarity index 100% rename from tests/cases/local/00_dummy/select_1.sql rename to integration_tests/cases/local/00_dummy/select_1.sql diff --git a/tests/cases/local/01_system/system_tables.result b/integration_tests/cases/local/01_system/system_tables.result similarity index 100% rename from tests/cases/local/01_system/system_tables.result rename to integration_tests/cases/local/01_system/system_tables.result diff --git a/tests/cases/local/01_system/system_tables.sql b/integration_tests/cases/local/01_system/system_tables.sql similarity index 100% rename from tests/cases/local/01_system/system_tables.sql rename to integration_tests/cases/local/01_system/system_tables.sql diff --git a/tests/cases/local/02_function/aggregate.result b/integration_tests/cases/local/02_function/aggregate.result similarity index 100% rename from tests/cases/local/02_function/aggregate.result rename to integration_tests/cases/local/02_function/aggregate.result diff --git a/tests/cases/local/02_function/aggregate.sql b/integration_tests/cases/local/02_function/aggregate.sql similarity index 100% rename from tests/cases/local/02_function/aggregate.sql rename to integration_tests/cases/local/02_function/aggregate.sql diff --git a/tests/cases/local/02_function/thetasketch_distinct.result b/integration_tests/cases/local/02_function/thetasketch_distinct.result similarity index 100% rename from tests/cases/local/02_function/thetasketch_distinct.result rename to integration_tests/cases/local/02_function/thetasketch_distinct.result diff --git a/tests/cases/local/02_function/thetasketch_distinct.sql b/integration_tests/cases/local/02_function/thetasketch_distinct.sql similarity index 100% rename from tests/cases/local/02_function/thetasketch_distinct.sql rename to integration_tests/cases/local/02_function/thetasketch_distinct.sql diff --git a/tests/cases/local/02_function/time_bucket.result b/integration_tests/cases/local/02_function/time_bucket.result similarity index 100% rename from tests/cases/local/02_function/time_bucket.result rename to integration_tests/cases/local/02_function/time_bucket.result diff --git a/tests/cases/local/02_function/time_bucket.sql b/integration_tests/cases/local/02_function/time_bucket.sql similarity index 100% rename from tests/cases/local/02_function/time_bucket.sql rename to integration_tests/cases/local/02_function/time_bucket.sql diff --git a/tests/cases/local/03_dml/case_insensitive.result b/integration_tests/cases/local/03_dml/case_insensitive.result similarity index 100% rename from tests/cases/local/03_dml/case_insensitive.result rename to integration_tests/cases/local/03_dml/case_insensitive.result diff --git a/tests/cases/local/03_dml/case_insensitive.sql b/integration_tests/cases/local/03_dml/case_insensitive.sql similarity index 100% rename from tests/cases/local/03_dml/case_insensitive.sql rename to integration_tests/cases/local/03_dml/case_insensitive.sql diff --git a/tests/cases/local/03_dml/insert_mode.result b/integration_tests/cases/local/03_dml/insert_mode.result similarity index 92% rename from tests/cases/local/03_dml/insert_mode.result rename to integration_tests/cases/local/03_dml/insert_mode.result index ecd3cf824d..d0421c9e09 100644 --- a/tests/cases/local/03_dml/insert_mode.result +++ b/integration_tests/cases/local/03_dml/insert_mode.result @@ -195,9 +195,5 @@ FROM ORDER BY `c1` ASC; -tsid,timestamp,c1,c2,c3,c4,c5, -Int64(0),Timestamp(Timestamp(1)),Int64(10),String(StringBytes(b"123")),Int64(11),Int64(12),Int64(3), -Int64(0),Timestamp(Timestamp(2)),Int64(20),String(StringBytes(b"123")),Int64(21),Int64(22),Int64(4), -Int64(0),Timestamp(Timestamp(3)),Int64(30),String(StringBytes(b"123")),Int64(31),Int64(32),Int64(5), - +Failed to execute query, err: Server(ServerError { code: 500, msg: "Failed to convert output, query: SELECT \n * \n FROM \n `03_dml_insert_mode_table4` \n ORDER BY \n `c1` ASC;. Caused by: Rpc error, code:500, message:failed to convert record batch, cause:Failed to write avro record, err:Value does not match schema." }) diff --git a/tests/cases/local/03_dml/insert_mode.sql b/integration_tests/cases/local/03_dml/insert_mode.sql similarity index 100% rename from tests/cases/local/03_dml/insert_mode.sql rename to integration_tests/cases/local/03_dml/insert_mode.sql diff --git a/tests/cases/local/03_dml/select_filter.result b/integration_tests/cases/local/03_dml/select_filter.result similarity index 100% rename from tests/cases/local/03_dml/select_filter.result rename to integration_tests/cases/local/03_dml/select_filter.result diff --git a/tests/cases/local/03_dml/select_filter.sql b/integration_tests/cases/local/03_dml/select_filter.sql similarity index 100% rename from tests/cases/local/03_dml/select_filter.sql rename to integration_tests/cases/local/03_dml/select_filter.sql diff --git a/tests/cases/local/03_dml/select_having.result b/integration_tests/cases/local/03_dml/select_having.result similarity index 100% rename from tests/cases/local/03_dml/select_having.result rename to integration_tests/cases/local/03_dml/select_having.result diff --git a/tests/cases/local/03_dml/select_having.sql b/integration_tests/cases/local/03_dml/select_having.sql similarity index 100% rename from tests/cases/local/03_dml/select_having.sql rename to integration_tests/cases/local/03_dml/select_having.sql diff --git a/tests/cases/local/03_dml/select_order.result b/integration_tests/cases/local/03_dml/select_order.result similarity index 100% rename from tests/cases/local/03_dml/select_order.result rename to integration_tests/cases/local/03_dml/select_order.result diff --git a/tests/cases/local/03_dml/select_order.sql b/integration_tests/cases/local/03_dml/select_order.sql similarity index 100% rename from tests/cases/local/03_dml/select_order.sql rename to integration_tests/cases/local/03_dml/select_order.sql diff --git a/tests/cases/local/04_explain/explain.result b/integration_tests/cases/local/04_explain/explain.result similarity index 100% rename from tests/cases/local/04_explain/explain.result rename to integration_tests/cases/local/04_explain/explain.result diff --git a/tests/cases/local/04_explain/explain.sql b/integration_tests/cases/local/04_explain/explain.sql similarity index 100% rename from tests/cases/local/04_explain/explain.sql rename to integration_tests/cases/local/04_explain/explain.sql diff --git a/tests/cases/local/05_ddl/alter_table.result b/integration_tests/cases/local/05_ddl/alter_table.result similarity index 100% rename from tests/cases/local/05_ddl/alter_table.result rename to integration_tests/cases/local/05_ddl/alter_table.result diff --git a/tests/cases/local/05_ddl/alter_table.sql b/integration_tests/cases/local/05_ddl/alter_table.sql similarity index 100% rename from tests/cases/local/05_ddl/alter_table.sql rename to integration_tests/cases/local/05_ddl/alter_table.sql diff --git a/tests/cases/local/05_ddl/create_tables.result b/integration_tests/cases/local/05_ddl/create_tables.result similarity index 100% rename from tests/cases/local/05_ddl/create_tables.result rename to integration_tests/cases/local/05_ddl/create_tables.result diff --git a/tests/cases/local/05_ddl/create_tables.sql b/integration_tests/cases/local/05_ddl/create_tables.sql similarity index 100% rename from tests/cases/local/05_ddl/create_tables.sql rename to integration_tests/cases/local/05_ddl/create_tables.sql diff --git a/tests/cases/local/06_show/show_create_table.result b/integration_tests/cases/local/06_show/show_create_table.result similarity index 100% rename from tests/cases/local/06_show/show_create_table.result rename to integration_tests/cases/local/06_show/show_create_table.result diff --git a/tests/cases/local/06_show/show_create_table.sql b/integration_tests/cases/local/06_show/show_create_table.sql similarity index 100% rename from tests/cases/local/06_show/show_create_table.sql rename to integration_tests/cases/local/06_show/show_create_table.sql diff --git a/tests/cases/local/07_optimizer/optimizer.result b/integration_tests/cases/local/07_optimizer/optimizer.result similarity index 100% rename from tests/cases/local/07_optimizer/optimizer.result rename to integration_tests/cases/local/07_optimizer/optimizer.result diff --git a/tests/cases/local/07_optimizer/optimizer.sql b/integration_tests/cases/local/07_optimizer/optimizer.sql similarity index 100% rename from tests/cases/local/07_optimizer/optimizer.sql rename to integration_tests/cases/local/07_optimizer/optimizer.sql diff --git a/tests/cases/local/basic.result b/integration_tests/cases/local/basic.result similarity index 100% rename from tests/cases/local/basic.result rename to integration_tests/cases/local/basic.result diff --git a/tests/cases/local/basic.sql b/integration_tests/cases/local/basic.sql similarity index 100% rename from tests/cases/local/basic.sql rename to integration_tests/cases/local/basic.sql diff --git a/tests/cases/local/config.toml b/integration_tests/cases/local/config.toml similarity index 100% rename from tests/cases/local/config.toml rename to integration_tests/cases/local/config.toml diff --git a/tests/sqlness/src/database.rs b/integration_tests/src/database.rs similarity index 100% rename from tests/sqlness/src/database.rs rename to integration_tests/src/database.rs diff --git a/tests/sqlness/src/main.rs b/integration_tests/src/main.rs similarity index 100% rename from tests/sqlness/src/main.rs rename to integration_tests/src/main.rs