[Jenkinsfile] Mark build as unstable if tests fail on *nix or get interrupted (incl. timeout).

This commit is contained in:
/dev/urandom 2017-06-01 22:52:02 +02:00
parent 3189c55642
commit ad3ba4b6e2
No known key found for this signature in database
GPG Key ID: 41322B973E0F295E

10
Jenkinsfile vendored
View File

@ -159,6 +159,16 @@ def doUnitTests(name) {
}
}
}
} catch (org.jenkinsci.plugins.workflow.steps.FlowInterruptedException e) {
currentBuild.result = 'UNSTABLE'
println("${name} unit test interrupted (ran too long?)")
} catch (Exception e) {
println("${name} unit test failed.")
if (isUnix()) {
currentBuild.result = 'UNSTABLE'
} else {
throw e
}
} finally {
// In all cases make sure to at least remove the directory junctions!
if (!isUnix()) {