Actually catch the exception when we fail

This should actually cause builds to fail when any part in the try block
fails. We still delete instances and try junit rendering, but if things
fail then they get marked on github as failed.
This commit is contained in:
William Giokas 2018-10-02 23:31:23 +02:00
parent 7fa20430f7
commit 9ef9206520
No known key found for this signature in database
GPG key ID: 690206D873CD09CF
6 changed files with 13 additions and 1 deletions

View file

@ -54,6 +54,8 @@ timeout(time: 6, unit: 'HOURS') {
archiveArtifacts artifacts: 'artifacts/logs/salt-runtests.log'
}
}
} catch (Exception e) {
currentBuild.result = 'FAILURE'
} finally {
try {
junit 'artifacts/xml-unittests-output/*.xml'

View file

@ -54,6 +54,8 @@ timeout(time: 6, unit: 'HOURS') {
archiveArtifacts artifacts: 'artifacts/logs/salt-runtests.log'
}
}
} catch (Exception e) {
currentBuild.result = 'FAILURE'
} finally {
try {
junit 'artifacts/xml-unittests-output/*.xml'

View file

@ -54,13 +54,15 @@ timeout(time: 6, unit: 'HOURS') {
archiveArtifacts artifacts: 'artifacts/logs/salt-runtests.log'
}
}
} catch (Exception e) {
currentBuild.result = 'FAILURE'
} finally {
try {
junit 'artifacts/xml-unittests-output/*.xml'
} finally {
cleanWs notFailBuild: true
def currentResult = currentBuild.result ?: 'SUCCESS'
if ( currentResult == 'SUCCESS') {
if (currentResult == 'SUCCESS') {
githubNotify credentialsId: 'test-jenkins-credentials',
description: "The ${TEST_SUITE}-${TEST_PLATFORM} job has passed",
status: 'SUCCESS',

View file

@ -54,6 +54,8 @@ timeout(time: 6, unit: 'HOURS') {
archiveArtifacts artifacts: 'artifacts/logs/salt-runtests.log'
}
}
} catch (Exception e) {
currentBuild.result = 'FAILURE'
} finally {
try {
junit 'artifacts/xml-unittests-output/*.xml'

View file

@ -54,6 +54,8 @@ timeout(time: 6, unit: 'HOURS') {
archiveArtifacts artifacts: 'artifacts/logs/salt-runtests.log'
}
}
} catch (Exception e) {
currentBuild.result = 'FAILURE'
} finally {
try {
junit 'artifacts/xml-unittests-output/*.xml'

View file

@ -54,6 +54,8 @@ timeout(time: 6, unit: 'HOURS') {
archiveArtifacts artifacts: 'artifacts/logs/salt-runtests.log'
}
}
} catch (Exception e) {
currentBuild.result = 'FAILURE'
} finally {
try {
junit 'artifacts/xml-unittests-output/*.xml'