You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2022/07/18 00:53:23 UTC
[doris] branch master updated: [improvement] add an option to let regression stop when a failure happen (#10939)
This is an automated email from the ASF dual-hosted git repository.
yiguolei 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 2b6cdcf599 [improvement] add an option to let regression stop when a failure happen (#10939)
2b6cdcf599 is described below
commit 2b6cdcf5996a235c4139795c2ef3e89ac9dc1a1c
Author: Yongqiang YANG <98...@users.noreply.github.com>
AuthorDate: Mon Jul 18 08:53:17 2022 +0800
[improvement] add an option to let regression stop when a failure happen (#10939)
For community pipeline, it is a waste of resource to run tests with errors.
---
.../src/main/groovy/org/apache/doris/regression/Config.groovy | 7 +++++++
.../main/groovy/org/apache/doris/regression/ConfigOptions.groovy | 7 +++++++
.../groovy/org/apache/doris/regression/suite/ScriptContext.groovy | 3 +++
3 files changed, 17 insertions(+)
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 6758389ae9..c465f204d3 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
@@ -58,6 +58,7 @@ class Config {
public boolean generateOutputFile
public boolean forceGenerateOutputFile
public boolean randomOrder
+ public boolean stopWhenFail
public Properties otherConfigs = new Properties()
@@ -176,6 +177,7 @@ class Config {
config.actionParallel = Integer.parseInt(cmd.getOptionValue(actionParallelOpt, "10"))
config.times = Integer.parseInt(cmd.getOptionValue(timesOpt, "1"))
config.randomOrder = cmd.hasOption(randomOrderOpt)
+ config.stopWhenFail = cmd.hasOption(stopWhenFail)
config.withOutLoadData = cmd.hasOption(withOutLoadDataOpt)
Properties props = cmd.getOptionProperties("conf")
@@ -333,6 +335,11 @@ class Config {
log.info("set randomOrder to false because not specify.".toString())
}
+ if (config.stopWhenFail == null) {
+ config.stopWhenFail = false
+ log.info("set stopWhenFail to false because not specify.".toString())
+ }
+
if (config.withOutLoadData == null) {
config.withOutLoadData = false
log.info("set withOutLoadData to false because not specify.".toString())
diff --git a/regression-test/framework/src/main/groovy/org/apache/doris/regression/ConfigOptions.groovy b/regression-test/framework/src/main/groovy/org/apache/doris/regression/ConfigOptions.groovy
index ed1dcd115c..9aaaede605 100644
--- a/regression-test/framework/src/main/groovy/org/apache/doris/regression/ConfigOptions.groovy
+++ b/regression-test/framework/src/main/groovy/org/apache/doris/regression/ConfigOptions.groovy
@@ -53,6 +53,7 @@ class ConfigOptions {
static Option suiteParallelOpt
static Option actionParallelOpt
static Option randomOrderOpt
+ static Option stopWhenFail
static Option timesOpt
static Option withOutLoadDataOpt
@@ -270,6 +271,11 @@ class ConfigOptions {
.hasArg(false)
.desc("run tests in random order")
.build()
+ stopWhenFail = Option.builder("stopWhenFail")
+ .required(false)
+ .hasArg(false)
+ .desc("stop when a failure happens")
+ .build()
timesOpt = Option.builder("times")
.argName("times")
.required(false)
@@ -312,6 +318,7 @@ class ConfigOptions {
.addOption(suiteParallelOpt)
.addOption(actionParallelOpt)
.addOption(randomOrderOpt)
+ .addOption(stopWhenFail)
.addOption(timesOpt)
.addOption(withOutLoadDataOpt)
diff --git a/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/ScriptContext.groovy b/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/ScriptContext.groovy
index 84ad7ff6f8..dd706c3d96 100644
--- a/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/ScriptContext.groovy
+++ b/regression-test/framework/src/main/groovy/org/apache/doris/regression/suite/ScriptContext.groovy
@@ -121,6 +121,9 @@ class ScriptContext implements Closeable {
log.info("Run ${suiteName} in ${file.absolutePath} succeed".toString())
} catch (Throwable t) {
log.error("Run ${suiteName} in ${file.absolutePath} failed".toString(), t)
+ if (config.stopWhenFail) {
+ System.exit(-1);
+ }
try {
// fail
if (suite != null) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org