Skip to content

Commit 86ce50e

Browse files
basiljglick
andauthored
Display JUnit test results as they appear (#6091)
Co-authored-by: Jesse Glick <[email protected]>
1 parent 502383a commit 86ce50e

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Jenkinsfile

+3-6
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77

88
def buildNumber = BUILD_NUMBER as int; if (buildNumber > 1) milestone(buildNumber - 1); milestone(buildNumber) // JENKINS-43353 / JENKINS-58625
99

10-
// TEST FLAG - to make it easier to turn on/off unit tests for speeding up access to later stuff.
11-
def runTests = true
1210
def failFast = false
1311
// Same memory sizing for both builds and ATH
1412
def javaOpts = ["JAVA_OPTS=-Xmx1536m -Xms512m","MAVEN_OPTS=-Xmx1536m -Xms512m"]
@@ -48,21 +46,21 @@ for(j = 0; j < jdks.size(); j++) {
4846
// Now run the actual build.
4947
stage("${buildType} Build / Test") {
5048
timeout(time: 300, unit: 'MINUTES') {
49+
realtimeJUnit(healthScaleFactor: 20.0, testResults: '*/target/surefire-reports/*.xml,war/junit.xml') {
5150
// -Dmaven.repo.local=… tells Maven to create a subdir in the temporary directory for the local Maven repository
5251
// -ntp requires Maven >= 3.6.1
53-
def mvnCmd = "mvn -Pdebug -Pjapicmp -U -Dset.changelist help:evaluate -Dexpression=changelist -Doutput=$changelistF clean install ${runTests ? '-Dmaven.test.failure.ignore' : '-DskipTests'} -V -B -ntp -Dmaven.repo.local=$m2repo -Dspotbugs.failOnError=false -Dcheckstyle.failOnViolation=false -e"
52+
def mvnCmd = "mvn -Pdebug -Pjapicmp -U -Dset.changelist help:evaluate -Dexpression=changelist -Doutput=$changelistF clean install -Dmaven.test.failure.ignore -V -B -ntp -Dmaven.repo.local=$m2repo -Dspotbugs.failOnError=false -Dcheckstyle.failOnViolation=false -e"
5453
infra.runWithMaven(mvnCmd, jdk.toString(), javaOpts, true)
5554

5655
if(isUnix()) {
5756
sh 'git add . && git diff --exit-code HEAD'
5857
}
58+
}
5959
}
6060
}
6161

6262
// Once we've built, archive the artifacts and the test results.
6363
stage("${buildType} Publishing") {
64-
if (runTests) {
65-
junit healthScaleFactor: 20.0, testResults: '*/target/surefire-reports/*.xml,war/junit.xml'
6664
archiveArtifacts allowEmptyArchive: true, artifacts: '**/target/surefire-reports/*.dumpstream'
6765
if (! fileExists('core/target/surefire-reports/TEST-jenkins.Junit4TestsRanTest.xml') ) {
6866
error 'junit 4 tests are no longer being run for the core package'
@@ -73,7 +71,6 @@ for(j = 0; j < jdks.size(); j++) {
7371
if (failFast && currentBuild.result == 'UNSTABLE') {
7472
error 'There were test failures; halting early'
7573
}
76-
}
7774
if (buildType == 'Linux' && jdk == jdks[0]) {
7875
def folders = env.JOB_NAME.split('/')
7976
if (folders.length > 1) {

0 commit comments

Comments
 (0)