Skip to content

Commit 5fb500d

Browse files
authored
[opt](regression) ./run-regression.sh -d parameter accept "regression-test/suites/" as prefix (#37942)
## Proposed changes ./run-regression.sh accept -d parameter with "./regression-test/suites/" or “regression-test/suites/" prefix for example: ./run-regression-test.sh --run -d regression-test/suites/nereids_tpch_shape_sf1000_p0/shape -s q1 with the prefix, we could use command completion (supported by shell) to indicate with directory to run Issue Number: close #xxx <!--Describe your changes.-->
1 parent 1344fcb commit 5fb500d

File tree

3 files changed

+27
-12
lines changed

3 files changed

+27
-12
lines changed

regression-test/framework/src/main/groovy/org/apache/doris/regression/Config.groovy

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,17 @@ class Config {
253253
this.cloudVersion = cloudVersion
254254
}
255255

256+
static String removeDirectoryPrefix(String str) {
257+
def prefixes = ["./regression-test/suites/", "regression-test/suites/"]
258+
259+
def prefix = prefixes.find { str.startsWith(it) }
260+
if (prefix) {
261+
return str.substring(prefix.length())
262+
}
263+
264+
return str
265+
}
266+
256267
static Config fromCommandLine(CommandLine cmd) {
257268
String confFilePath = cmd.getOptionValue(confFileOpt, "")
258269
File confFile = new File(confFilePath)
@@ -295,7 +306,9 @@ class Config {
295306
.toSet()
296307
config.directories = cmd.getOptionValue(directoriesOpt, config.testDirectories)
297308
.split(",")
298-
.collect({d -> d.trim()})
309+
.collect({d ->
310+
d.trim()
311+
removeDirectoryPrefix(d)})
299312
.findAll({d -> d != null && d.length() > 0})
300313
.toSet()
301314
config.excludeSuiteWildcard = cmd.getOptionValue(excludeSuiteOpt, config.excludeSuites)

regression-test/framework/src/main/groovy/org/apache/doris/regression/RegressionTest.groovy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ class RegressionTest {
279279
static Recorder runScripts(Config config) {
280280
def recorder = new Recorder()
281281
def directoryFilter = config.getDirectoryFilter()
282+
log.info("run scripts in directories: " + config.directories)
282283
if (!config.withOutLoadData) {
283284
log.info('Start to run load scripts')
284285
runScripts(config, recorder, directoryFilter,

run-regression-test.sh

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,18 @@ Usage: $0 <shell_options> <framework_options>
4848
-times rum tests {times} times
4949
5050
Eg.
51-
$0 build regression test framework and run all suite which in default group
52-
$0 --run test_select run a suite which named as test_select
53-
$0 --compile only compile regression framework
54-
$0 --run -s test_select run a suite which named as test_select
55-
$0 --run test_select -genOut generate output file for test_select if not exist
56-
$0 --run -g default run all suite in the group which named as default
57-
$0 --run -d demo,correctness/tmp run all suite in the directories which named as demo and correctness/tmp
58-
$0 --clean clean output of regression test framework
59-
$0 --clean --run test_select clean output and build regression test framework and run a suite which named as test_select
60-
$0 --run -h print framework options
61-
$0 --teamcity --run test_select print teamcity service messages and build regression test framework and run test_select
51+
$0 build regression test framework and run all suite which in default group
52+
$0 --run test_select run a suite which named as test_select
53+
$0 --compile only compile regression framework
54+
$0 --run -s test_select run a suite which named as test_select
55+
$0 --run test_select -genOut generate output file for test_select if not exist
56+
$0 --run -g default run all suite in the group which named as default
57+
$0 --run -d demo,correctness/tmp run all suite in the directories which named as demo and correctness/tmp
58+
$0 --run -d regression-test/suites/demo specify the suite directories path from repo root
59+
$0 --clean clean output of regression test framework
60+
$0 --clean --run test_select clean output and build regression test framework and run a suite which named as test_select
61+
$0 --run -h print framework options
62+
$0 --teamcity --run test_select print teamcity service messages and build regression test framework and run test_select
6263
6364
Log path: \${DORIS_HOME}/output/regression-test/log
6465
Default config file: \${DORIS_HOME}/regression-test/conf/regression-conf.groovy

0 commit comments

Comments
 (0)