Skip to content
Open
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
16 changes: 16 additions & 0 deletions buildenv/jenkins/JenkinsfileBase
Original file line number Diff line number Diff line change
Expand Up @@ -1789,6 +1789,15 @@ def archiveChildJobTap(childJobs, originalStatus = 'SUCCESS') {
echo 'Exception: ' + e.toString()
echo "Cannot copy *.tap or AQACert.log from ${name} with buildid ${buildId} . Skipping copyArtifacts..."
}
// Aggregate JUnit XML results from child job to parent level (see #6238)
try {
timeout(time: 1, unit: 'HOURS') {
copyArtifacts (projectName: "${name}", selector: specific("${buildId}"), filter: "**/work/**/*.jtr.xml, **/result/**/*.jtr.xml, **/junitreports/**/*.xml, **/external_test_reports/**/*.xml", target:"${name}/${buildId}", optional: true)
}
} catch (Exception e) {
echo 'Exception: ' + e.toString()
echo "Cannot copy JUnit XML from ${name} with buildid ${buildId} . Skipping..."
}
def childBuildUrl = "${env.JENKINS_URL}job/${name}/${buildId}"
def badgeUrl = "${childBuildUrl}/badge/icon"
def duration = cjob.getDuration() ?: ""
Expand All @@ -1810,6 +1819,13 @@ def archiveChildJobTap(childJobs, originalStatus = 'SUCCESS') {
childJobStatus += "</table>"
currentBuild.description = (currentBuild.description) ? currentBuild.description + "<br>" + childJobStatus : childJobStatus

// Publish aggregated JUnit results from all child jobs at the parent level (see #6238)
try {
junit skipMarkingBuildUnstable: true, allowEmptyResults: true, keepLongStdio: true, testResults: '**/work/**/*.jtr.xml, **/result/**/*.jtr.xml, **/junitreports/**/*.xml, **/external_test_reports/**/*.xml'
} catch (Exception e) {
echo "Caught exception when aggregating JUnit results at parent level: ${e.message}"
}

// In case rerun job status be worse than original job status
if ( originalStatus != "SUCCESS" && isWorseThan( currentStatus, originalStatus)) {
currentStatus = originalStatus
Expand Down