From e71854ff98348c01f67e77a2351c3d020ec85760 Mon Sep 17 00:00:00 2001 From: Noel Kwan Date: Tue, 26 Sep 2023 15:31:20 +0800 Subject: [PATCH] interim commit: add recovery tests --- ci/scripts/backfill-test.sh | 5 +- ci/scripts/run-backfill-tests.sh | 101 ++++++++++++++++-- ci/scripts/run-e2e-test.sh | 2 +- .../foreground/create_base_table.slt | 5 + e2e_test/background_ddl/foreground/drop.slt | 2 + .../background_ddl/foreground/validate.slt | 4 + .../foreground/validate_restart.slt | 4 + e2e_test/background_ddl/recovery/create.slt | 11 ++ e2e_test/background_ddl/recovery/drop.slt | 5 + e2e_test/background_ddl/recovery/validate.slt | 4 + .../recovery/validate_finished.slt | 4 + 11 files changed, 134 insertions(+), 13 deletions(-) create mode 100644 e2e_test/background_ddl/foreground/create_base_table.slt create mode 100644 e2e_test/background_ddl/foreground/drop.slt create mode 100644 e2e_test/background_ddl/foreground/validate.slt create mode 100644 e2e_test/background_ddl/foreground/validate_restart.slt create mode 100644 e2e_test/background_ddl/recovery/create.slt create mode 100644 e2e_test/background_ddl/recovery/drop.slt create mode 100644 e2e_test/background_ddl/recovery/validate.slt create mode 100644 e2e_test/background_ddl/recovery/validate_finished.slt diff --git a/ci/scripts/backfill-test.sh b/ci/scripts/backfill-test.sh index 039e8bee94865..1a4ed37fb9d7f 100755 --- a/ci/scripts/backfill-test.sh +++ b/ci/scripts/backfill-test.sh @@ -30,12 +30,9 @@ git config --global --add safe.directory /risingwave download_and_prepare_rw "$profile" common -echo "--- e2e, ci-backfill, build" -cargo make ci-start ci-backfill - ################ TESTS -echo "--- e2e, ci-backfill, run backfill test" +echo "--- Run backfill tests" ./ci/scripts/run-backfill-tests.sh echo "--- Kill cluster" diff --git a/ci/scripts/run-backfill-tests.sh b/ci/scripts/run-backfill-tests.sh index 77a6ef1a5510c..cf00dfe3dd0a9 100755 --- a/ci/scripts/run-backfill-tests.sh +++ b/ci/scripts/run-backfill-tests.sh @@ -16,6 +16,7 @@ set -euo pipefail PARENT_PATH=$(dirname "${BASH_SOURCE[0]}") +TEST_DIR=$PWD/e2e_test run_sql_file() { psql -h localhost -p 4566 -d dev -U root -f "$@" @@ -29,15 +30,99 @@ flush() { run_sql "FLUSH;" } -run_sql_file "$PARENT_PATH"/sql/backfill/create_base_table.sql +# Test snapshot and upstream read. +test_snapshot_and_upstream_read() { + echo "--- e2e, ci-backfill, test_snapshot_and_upstream_read" + cargo make ci-start ci-backfill -# Provide snapshot -run_sql_file "$PARENT_PATH"/sql/backfill/insert.sql -run_sql_file "$PARENT_PATH"/sql/backfill/insert.sql & -run_sql_file "$PARENT_PATH"/sql/backfill/create_mv.sql & + run_sql_file "$PARENT_PATH"/sql/backfill/create_base_table.sql -wait + # Provide snapshot + run_sql_file "$PARENT_PATH"/sql/backfill/insert.sql -run_sql_file "$PARENT_PATH"/sql/backfill/select.sql