This is an automated email from the ASF dual-hosted git repository.
dataroaring 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 5c28114464d [chore](suites) Allow change db name in get_ccr_body
(#37426)
5c28114464d is described below
commit 5c28114464dd0cfb2a16a0b597797a86c87c1520
Author: walter <[email protected]>
AuthorDate: Mon Jul 8 17:41:37 2024 +0800
[chore](suites) Allow change db name in get_ccr_body (#37426)
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 9c37ddb0542..9a9b5a779a6 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
@@ -278,17 +278,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 ede1de4ff40..c958a8be75d 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
@@ -180,20 +180,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]