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 731ce5802e [Test][Framework] add enableCacheData option for test framework (#20874) 731ce5802e is described below commit 731ce5802eca5e9892cba456506b04b19399bdc0 Author: chunping <cece_m...@163.com> AuthorDate: Fri Jun 16 14:12:21 2023 +0800 [Test][Framework] add enableCacheData option for test framework (#20874) --- .../org/apache/doris/regression/Config.groovy | 24 +++++++++++++++++++++- .../regression/action/StreamLoadAction.groovy | 2 +- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/regression-test/framework/src/main/groovy/org/apache/doris/regression/Config.groovy b/regression-test/framework/src/main/groovy/org/apache/doris/regression/Config.groovy index 5f4e4b9e15..6f21cbfaaf 100644 --- a/regression-test/framework/src/main/groovy/org/apache/doris/regression/Config.groovy +++ b/regression-test/framework/src/main/groovy/org/apache/doris/regression/Config.groovy @@ -52,6 +52,7 @@ class Config { public String dataPath public String realDataPath public String cacheDataPath + public boolean enableCacheData public String pluginPath public String sslCertificatePath @@ -89,7 +90,7 @@ class Config { Config(String defaultDb, String jdbcUrl, String jdbcUser, String jdbcPassword, String feHttpAddress, String feHttpUser, String feHttpPassword, String metaServiceHttpAddress, - String suitePath, String dataPath, String realDataPath, String cacheDataPath, + String suitePath, String dataPath, String realDataPath, String cacheDataPath, Boolean enableCacheData, String testGroups, String excludeGroups, String testSuites, String excludeSuites, String testDirectories, String excludeDirectories, String pluginPath, String sslCertificatePath) { this.defaultDb = defaultDb @@ -104,6 +105,7 @@ class Config { this.dataPath = dataPath this.realDataPath = realDataPath this.cacheDataPath = cacheDataPath + this.enableCacheData = enableCacheData this.testGroups = testGroups this.excludeGroups = excludeGroups this.testSuites = testSuites @@ -241,6 +243,7 @@ class Config { configToString(obj.dataPath), configToString(obj.realDataPath), configToString(obj.cacheDataPath), + configToBoolean(obj.enableCacheData), configToString(obj.testGroups), configToString(obj.excludeGroups), configToString(obj.testSuites), @@ -326,6 +329,11 @@ class Config { log.info("Set cacheDataPath to '${config.cacheDataPath}' because not specify.".toString()) } + if (config.enableCacheData == null) { + config.enableCacheData = true + log.info("Set enableCacheData to '${config.enableCacheData}' because not specify.".toString()) + } + if (config.pluginPath == null) { config.pluginPath = "regression-test/plugins" log.info("Set dataPath to '${config.pluginPath}' because not specify.".toString()) @@ -386,6 +394,20 @@ class Config { return (obj instanceof String || obj instanceof GString) ? obj.toString() : null } + static Boolean configToBoolean(Object obj) { + if (obj instanceof Boolean) { + return (Boolean) obj + } else if (obj instanceof String || obj instanceof GString) { + String stringValue = obj.toString().trim() + if (stringValue.equalsIgnoreCase("true")) { + return true + } else if (stringValue.equalsIgnoreCase("false")) { + return false + } + } + return null + } + void tryCreateDbIfNotExist() { tryCreateDbIfNotExist(defaultDb) } diff --git a/regression-test/framework/src/main/groovy/org/apache/doris/regression/action/StreamLoadAction.groovy b/regression-test/framework/src/main/groovy/org/apache/doris/regression/action/StreamLoadAction.groovy index cfbf961ac2..dd8b19536a 100644 --- a/regression-test/framework/src/main/groovy/org/apache/doris/regression/action/StreamLoadAction.groovy +++ b/regression-test/framework/src/main/groovy/org/apache/doris/regression/action/StreamLoadAction.groovy @@ -227,7 +227,7 @@ class StreamLoadAction implements SuiteAction { def file = new File(context.config.cacheDataPath) file.mkdirs(); - if (file.exists() && file.isDirectory()) { + if (file.exists() && file.isDirectory() && context.config.enableCacheData) { fileName = cacheHttpFile(client, fileName) } else { entity = new InputStreamEntity(httpGetStream(client, fileName)) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org