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

kxiao pushed a commit to branch branch-2.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-2.0 by this push:
     new c98a3b8a607  [fix](regression test) fix miss function getFeConfig 
(#32167)
c98a3b8a607 is described below

commit c98a3b8a60768d5cf94b5fe02becfa8c621c7476
Author: yujun <[email protected]>
AuthorDate: Wed Mar 13 23:12:04 2024 +0800

     [fix](regression test) fix miss function getFeConfig (#32167)
---
 .../org/apache/doris/regression/suite/Suite.groovy | 27 ++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git 
a/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/Suite.groovy
 
b/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/Suite.groovy
index f347a6cc941..9ba50881b88 100644
--- 
a/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/Suite.groovy
+++ 
b/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/Suite.groovy
@@ -745,5 +745,32 @@ class Suite implements GroovyInterceptable {
     DebugPoint GetDebugPoint() {
         return debugPoint
     }
+
+    boolean isCloudMode() {
+        return !getFeConfig("cloud_unique_id").isEmpty()
+    }
+
+    String getFeConfig(String key) {
+        return sql_return_maparray("SHOW FRONTEND CONFIG LIKE 
'${key}'")[0].Value
+    }
+
+    void setFeConfig(String key, Object value) {
+        sql "ADMIN SET FRONTEND CONFIG ('${key}' = '${value}')"
+    }
+
+    void setFeConfigTemporary(Map<String, Object> tempConfig, Closure 
actionSupplier) {
+        def oldConfig = tempConfig.keySet().collectEntries { [it, 
getFeConfig(it)] }
+
+        def updateConfig = { conf ->
+            conf.each { key, value -> setFeConfig(key, value) }
+        }
+
+        try {
+            updateConfig tempConfig
+            actionSupplier()
+        } finally {
+            updateConfig oldConfig
+        }
+    }
 }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to