This is an automated email from the ASF dual-hosted git repository.

dataroaring pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new c098b0393a6 [test](regression) Add backup/restore DB case (#26312)
c098b0393a6 is described below

commit c098b0393a6c3bcacc41353c82e32f55304086d2
Author: walter <w41te...@gmail.com>
AuthorDate: Thu Nov 2 20:18:45 2023 +0800

    [test](regression) Add backup/restore DB case (#26312)
---
 .../suites/backup_restore/test_backup_restore.groovy        |  2 +-
 .../suites/backup_restore/test_backup_restore_alias.groovy  |  2 +-
 ...re_multi_tables.groovy => test_backup_restore_db.groovy} | 13 +++++--------
 .../backup_restore/test_backup_restore_exclude.groovy       |  2 +-
 .../backup_restore/test_backup_restore_multi_tables.groovy  |  2 +-
 .../test_backup_restore_multi_tables_overwrite.groovy       |  2 +-
 .../test_restore_mix_exists_and_new_table.groovy            |  2 +-
 .../suites/backup_restore/test_restore_to_new_table.groovy  |  2 +-
 8 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/regression-test/suites/backup_restore/test_backup_restore.groovy 
b/regression-test/suites/backup_restore/test_backup_restore.groovy
index 0fccd42befd..68f73f6892f 100644
--- a/regression-test/suites/backup_restore/test_backup_restore.groovy
+++ b/regression-test/suites/backup_restore/test_backup_restore.groovy
@@ -56,7 +56,7 @@ suite("test_backup_restore", "backup_restore") {
         Thread.sleep(3000)
     }
 
-    snapshot = syncer.getSnapshotTimestamp(repoName, snapshotName)
+    def snapshot = syncer.getSnapshotTimestamp(repoName, snapshotName)
     assertTrue(snapshot != null)
 
     sql "TRUNCATE TABLE ${dbName}.${tableName}"
diff --git 
a/regression-test/suites/backup_restore/test_backup_restore_alias.groovy 
b/regression-test/suites/backup_restore/test_backup_restore_alias.groovy
index 532d04ed13d..57851fa8244 100644
--- a/regression-test/suites/backup_restore/test_backup_restore_alias.groovy
+++ b/regression-test/suites/backup_restore/test_backup_restore_alias.groovy
@@ -57,7 +57,7 @@ suite("test_backup_restore_alias", "backup_restore") {
         Thread.sleep(3000)
     }
 
-    snapshot = syncer.getSnapshotTimestamp(repoName, snapshotName)
+    def snapshot = syncer.getSnapshotTimestamp(repoName, snapshotName)
     assertTrue(snapshot != null)
 
     sql "INSERT INTO ${dbName}.${tableName} VALUES (20, 21), (123, 341)"
diff --git 
a/regression-test/suites/backup_restore/test_backup_restore_multi_tables.groovy 
b/regression-test/suites/backup_restore/test_backup_restore_db.groovy
similarity index 87%
copy from 
regression-test/suites/backup_restore/test_backup_restore_multi_tables.groovy
copy to regression-test/suites/backup_restore/test_backup_restore_db.groovy
index 109a4a13042..7f3c6e5f83e 100644
--- 
a/regression-test/suites/backup_restore/test_backup_restore_multi_tables.groovy
+++ b/regression-test/suites/backup_restore/test_backup_restore_db.groovy
@@ -15,9 +15,9 @@
 // specific language governing permissions and limitations
 // under the License.
 
-suite("test_backup_restore_multi_tables", "backup_restore") {
-    String dbName = "backup_restore_multi_tables_db"
-    String suiteName = "test_backup_restore_multi_tables"
+suite("test_backup_restore_db", "backup_restore") {
+    String dbName = "backup_restore_db_1"
+    String suiteName = "test_backup_restore_db"
     String repoName = "${suiteName}_repo"
     String snapshotName = "${suiteName}_snapshot"
     String tableNamePrefix = "${suiteName}_tables"
@@ -54,28 +54,25 @@ suite("test_backup_restore_multi_tables", "backup_restore") 
{
         assertEquals(result.size(), numRows);
     }
 
-    def backupTables = tables[0..5]
     sql """
         BACKUP SNAPSHOT ${dbName}.${snapshotName}
         TO `${repoName}`
-        ON (${backupTables.join(",")})
     """
 
     while (!syncer.checkSnapshotFinish(dbName)) {
         Thread.sleep(3000)
     }
 
-    snapshot = syncer.getSnapshotTimestamp(repoName, snapshotName)
+    def snapshot = syncer.getSnapshotTimestamp(repoName, snapshotName)
     assertTrue(snapshot != null)
 
-    for (def tableName in backupTables) {
+    for (def tableName in tables) {
         sql "TRUNCATE TABLE ${dbName}.${tableName}"
     }
 
     sql """
         RESTORE SNAPSHOT ${dbName}.${snapshotName}
         FROM `${repoName}`
-        ON (${backupTables.join(",")})
         PROPERTIES
         (
             "backup_timestamp" = "${snapshot}",
diff --git 
a/regression-test/suites/backup_restore/test_backup_restore_exclude.groovy 
b/regression-test/suites/backup_restore/test_backup_restore_exclude.groovy
index 6d248bb47ff..012d77cc75d 100644
--- a/regression-test/suites/backup_restore/test_backup_restore_exclude.groovy
+++ b/regression-test/suites/backup_restore/test_backup_restore_exclude.groovy
@@ -65,7 +65,7 @@ suite("test_backup_restore_exclude", "backup_restore") {
         Thread.sleep(3000)
     }
 
-    snapshot = syncer.getSnapshotTimestamp(repoName, snapshotName)
+    def snapshot = syncer.getSnapshotTimestamp(repoName, snapshotName)
     assertTrue(snapshot != null)
 
     // Overwrite exists table.
diff --git 
a/regression-test/suites/backup_restore/test_backup_restore_multi_tables.groovy 
b/regression-test/suites/backup_restore/test_backup_restore_multi_tables.groovy
index 109a4a13042..a795ae0dedf 100644
--- 
a/regression-test/suites/backup_restore/test_backup_restore_multi_tables.groovy
+++ 
b/regression-test/suites/backup_restore/test_backup_restore_multi_tables.groovy
@@ -65,7 +65,7 @@ suite("test_backup_restore_multi_tables", "backup_restore") {
         Thread.sleep(3000)
     }
 
-    snapshot = syncer.getSnapshotTimestamp(repoName, snapshotName)
+    def snapshot = syncer.getSnapshotTimestamp(repoName, snapshotName)
     assertTrue(snapshot != null)
 
     for (def tableName in backupTables) {
diff --git 
a/regression-test/suites/backup_restore/test_backup_restore_multi_tables_overwrite.groovy
 
b/regression-test/suites/backup_restore/test_backup_restore_multi_tables_overwrite.groovy
index e7e2a7f3fe4..67cf37bc6e0 100644
--- 
a/regression-test/suites/backup_restore/test_backup_restore_multi_tables_overwrite.groovy
+++ 
b/regression-test/suites/backup_restore/test_backup_restore_multi_tables_overwrite.groovy
@@ -65,7 +65,7 @@ suite("test_backup_restore_multi_tables_overwrite", 
"backup_restore") {
         Thread.sleep(3000)
     }
 
-    snapshot = syncer.getSnapshotTimestamp(repoName, snapshotName)
+    def snapshot = syncer.getSnapshotTimestamp(repoName, snapshotName)
     assertTrue(snapshot != null)
 
     // Overwrite exists table.
diff --git 
a/regression-test/suites/backup_restore/test_restore_mix_exists_and_new_table.groovy
 
b/regression-test/suites/backup_restore/test_restore_mix_exists_and_new_table.groovy
index 2c9b0b31aed..7bb6c91c193 100644
--- 
a/regression-test/suites/backup_restore/test_restore_mix_exists_and_new_table.groovy
+++ 
b/regression-test/suites/backup_restore/test_restore_mix_exists_and_new_table.groovy
@@ -64,7 +64,7 @@ suite("test_restore_mix_exists_and_new_table", 
"backup_restore") {
         Thread.sleep(3000)
     }
 
-    snapshot = syncer.getSnapshotTimestamp(repoName, snapshotName)
+    def snapshot = syncer.getSnapshotTimestamp(repoName, snapshotName)
     assertTrue(snapshot != null)
 
     def dropTables = tables[0..5]
diff --git 
a/regression-test/suites/backup_restore/test_restore_to_new_table.groovy 
b/regression-test/suites/backup_restore/test_restore_to_new_table.groovy
index 74d2ec08bb1..76f82eb8c9c 100644
--- a/regression-test/suites/backup_restore/test_restore_to_new_table.groovy
+++ b/regression-test/suites/backup_restore/test_restore_to_new_table.groovy
@@ -56,7 +56,7 @@ suite("test_restore_to_new_table", "backup_restore") {
         Thread.sleep(3000)
     }
 
-    snapshot = syncer.getSnapshotTimestamp(repoName, snapshotName)
+    def snapshot = syncer.getSnapshotTimestamp(repoName, snapshotName)
     assertTrue(snapshot != null)
 
     sql "DROP TABLE ${dbName}.${tableName} FORCE"


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to