Skip to content

Commit ee248f8

Browse files
committed
[#] Jenkinsfile: Update with parallelTests flag
1 parent 2219a93 commit ee248f8

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Jenkinsfile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ pipeline {
4545
choice(name: 'nodeLabel', choices: ['ubuntu', 's390x', 'arm', 'Windows'])
4646
choice(name: 'jdkVersion', choices: ['jdk_17_latest', 'jdk_21_latest', 'jdk_24_latest', 'jdk_17_latest_windows', 'jdk_21_latest_windows', 'jdk_24_latest_windows'])
4747
booleanParam(name: 'deployEnabled', defaultValue: false)
48+
booleanParam(name: 'parallelTestsEnabled', defaultValue: true)
4849
booleanParam(name: 'sonarEnabled', defaultValue: false)
4950
booleanParam(name: 'testsEnabled', defaultValue: true)
5051
}
@@ -131,7 +132,15 @@ pipeline {
131132
sh 'mvn -version'
132133
// all tests is very very long (10 hours on Apache Jenkins)
133134
// sh 'mvn -B -e test -pl activemq-unit-tests -Dactivemq.tests=all'
134-
sh 'mvn -B -e -fae test -Dsurefire.rerunFailingTestsCount=3'
135+
136+
def parallelBuild=params.parallelTestsEnabled
137+
if (parallelBuild == null || parallelBuild.isEmpty()) {
138+
echo 'starting tests ...'
139+
sh 'mvn -B -e -fae test -Dsurefire.rerunFailingTestsCount=3'
140+
} else {
141+
echo 'starting parallel tests ...'
142+
sh 'mvn -B -e -fae -Pparallel-tests test -Dsurefire.rerunFailingTestsCount=3'
143+
}
135144
}
136145
post {
137146
always {

0 commit comments

Comments
 (0)