Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion buildenv/jenkins/JenkinsfileBase
Original file line number Diff line number Diff line change
Expand Up @@ -982,9 +982,22 @@ def post(output_name) {
addFailedTestsGrinderLink()

try {
junit allowEmptyResults: true, keepLongStdio: true, testResults: '**/work/**/*.jtr.xml, **/result/**/*.jtr.xml, **/junitreports/**/*.xml, **/external_test_reports/**/*.xml'
def testResults = junit allowEmptyResults: true, keepLongStdio: true, testResults: '**/work/**/*.jtr.xml, **/result/**/*.jtr.xml, **/junitreports/**/*.xml, **/external_test_reports/**/*.xml'
echo "JUnit Test Results: ${testResults}"
echo "Total Tests: ${testResults.getTotalCount()}"
echo "Passed: ${testResults.getPassCount()}"
echo "Failed: ${testResults.getFailCount()}"
echo "Skipped: ${testResults.getSkipCount()}"

if (testResults.getFailCount() > 0) {
echo "Found ${testResults.getFailCount()} failed tests. Marking build as UNSTABLE."
currentBuild.result = 'UNSTABLE'
} else {
echo "No failed tests found."
}
} catch (Exception e) {
echo "Caught exception: ${e.message}"
currentBuild.result = 'FAILURE' // Set the build result to FAILURE in case of an error
}
}
}
Expand Down