This is an automated email from the ASF dual-hosted git repository.
dataroaring pushed a commit to branch branch-2.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-2.1 by this push:
new 4f00b417969 [chore](suites) Allow change db name in get_ccr_body
(#37424)
4f00b417969 is described below
commit 4f00b4179696185314adbf11ce051979e1a0b661
Author: walter <[email protected]>
AuthorDate: Mon Jul 8 17:47:43 2024 +0800
[chore](suites) Allow change db name in get_ccr_body (#37424)
Cherry-pick #37324.
---
.../groovy/org/apache/doris/regression/suite/Suite.groovy | 12 ++++++++----
.../org/apache/doris/regression/suite/SuiteContext.groovy | 14 ++++++++++----
2 files changed, 18 insertions(+), 8 deletions(-)
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 c67fcd88616..55137932d74 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
@@ -306,17 +306,21 @@ class Suite implements GroovyInterceptable {
}
}
- String get_ccr_body(String table) {
+ String get_ccr_body(String table, String db = null) {
+ if (db == null) {
+ db = context.dbName
+ }
+
Gson gson = new Gson()
- Map<String, String> srcSpec = context.getSrcSpec()
+ Map<String, String> srcSpec = context.getSrcSpec(db)
srcSpec.put("table", table)
- Map<String, String> destSpec = context.getDestSpec()
+ Map<String, String> destSpec = context.getDestSpec(db)
destSpec.put("table", table)
Map<String, Object> body = Maps.newHashMap()
- body.put("name", context.suiteName + "_" + context.dbName + "_" +
table)
+ body.put("name", context.suiteName + "_" + db + "_" + table)
body.put("src", srcSpec)
body.put("dest", destSpec)
diff --git
a/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/SuiteContext.groovy
b/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/SuiteContext.groovy
index 1cf6d021de9..906e90fcee0 100644
---
a/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/SuiteContext.groovy
+++
b/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/SuiteContext.groovy
@@ -222,20 +222,26 @@ class SuiteContext implements Closeable {
return spec
}
- Map<String, String> getSrcSpec() {
+ Map<String, String> getSrcSpec(String db = null) {
+ if (db == null) {
+ db = dbName
+ }
String[] jdbc = getJdbcNetInfo().split(":")
Map<String, String> spec = getSpec(jdbc)
spec.put("thrift_port",
config.feSourceThriftNetworkAddress.port.toString())
- spec.put("database", dbName)
+ spec.put("database", db)
return spec
}
- Map<String, String> getDestSpec() {
+ Map<String, String> getDestSpec(String db = null) {
+ if (db == null) {
+ db = dbName
+ }
String[] jdbc = getDownstreamJdbcNetInfo().split(":")
Map<String, String> spec = getSpec(jdbc)
spec.put("thrift_port",
config.feTargetThriftNetworkAddress.port.toString())
- spec.put("database", "TEST_" + dbName)
+ spec.put("database", "TEST_" + db)
return spec
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]