Skip to content

Commit

Permalink
perhaps try catch should be in node as well
Browse files Browse the repository at this point in the history
  • Loading branch information
definite committed Mar 6, 2017
1 parent 10c514f commit 6552b4a
Showing 1 changed file with 28 additions and 27 deletions.
55 changes: 28 additions & 27 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ def failsafeTestReports='target/failsafe-reports/TEST-*.xml'
* Failed and stop the build
* Yet able to create report
*/
try {
timestamps {
timestamps {
ansicolor {
node {
ansicolor {
try {
stage('Checkout') {
info.printNode()
notify.started()
Expand Down Expand Up @@ -63,40 +63,41 @@ try {
// Continue building even when test failure
// Thus -Dmaven.test.failure.ignore is required
sh """./run-clean.sh ./mvnw -e clean package jxr:aggregate\
--batch-mode \
--settings .travis-settings.xml \
--update-snapshots \
-DstaticAnalysis \
-Dchromefirefox \
-DskipFuncTests \
-DskipArqTests \
-Dmaven.test.failure.ignore \
"""
setJUnitPrefix("UNIT", surefireTestReports)

// notify if compile+unit test successful
notify.testResults("UNIT")
archive "**/${jarFiles},**/${warFiles}"
currentBuild.result = 'SUCCESS'
--batch-mode \
--settings .travis-settings.xml \
--update-snapshots \
-DstaticAnalysis \
-Dchromefirefox \
-DskipFuncTests \
-DskipArqTests \
-Dmaven.test.failure.ignore \
"""
setJUnitPrefix("UNIT", surefireTestReports)

// notify if compile+unit test successful
notify.testResults("UNIT")
archive "**/${jarFiles},**/${warFiles}"
currentBuild.result = 'SUCCESS'
}

stage('stash') {
stash name: 'workspace', includes: '**'
}
} catch (e) {
notify.failed()
currentBuild.result = 'FAILURE'
throw e
} finally {
junit allowEmptyResults: true,
keepLongStdio: true,
testDataPublishers: [[$class: 'StabilityTestDataPublisher']],
testResults: "**/${surefireTestReports}"
}
}
}
} catch (e) {
notify.failed()
currentBuild.result = 'FAILURE'
throw e
} finally {
junit allowEmptyResults: true,
keepLongStdio: true,
testDataPublishers: [[$class: 'StabilityTestDataPublisher']],
testResults: "**/${surefireTestReports}"
}


if (currentBuild.result.equals('FAILURE')){
return 1
}
Expand Down

0 comments on commit 6552b4a

Please sign in to comment.