def reset_build_result() {
def result = ''
AbstractTestResultAction testResultAction = currentBuild.rawBuild.getAction(AbstractTestResultAction.class)
if (null != testResultAction) {
def total = testResultAction.totalCount
def failed = testResultAction.failCount
def skipped = testResultAction.skipCount
def passed = total - failed - skipped
if (failed > 0) {
result = 'FAILURE'
}
if (0 == passed) {
currentBuild.result = 'FAILURE'
} else {
if (failed > 0) {
currentBuild.result = 'UNSTABLE'
} else {
currentBuild.result = 'SUCCESS'
}
}
}
return result
}
07-16
4244