Skip to content

Aggregate JUnit results at parent test level (#6238) - #7505

Open
Akshat005Chaudhary wants to merge 1 commit into
adoptium:masterfrom
Akshat005Chaudhary:akshat_branch_3
Open

Aggregate JUnit results at parent test level (#6238)#7505
Akshat005Chaudhary wants to merge 1 commit into
adoptium:masterfrom
Akshat005Chaudhary:akshat_branch_3

Conversation

@Akshat005Chaudhary

Copy link
Copy Markdown
Contributor

Aggregate JUnit results at parent test level

Closes #6238

Background

Currently, child TAP files are already aggregated and surfaced at the parent build level. However, JUnit XML results (produced by openjdk/JCK tests) are only visible at the child job level — engineers have to click into each parallel testList_N job individually to see test reports.

This PR brings JUnit result aggregation to the parent build level, matching the existing TAP behaviour.

Changes

buildenv/jenkins/JenkinsfileBase

Two additions inside archiveChildJobTap():

  1. Per-child JUnit artifact copy — alongside the existing **/*.tap copy, also fetches JUnit XML files from each parallel child job into the parent workspace:
copyArtifacts(projectName: "${name}", selector: specific("${buildId}"),
    filter: "**/work/**/*.jtr.xml, **/result/**/*.jtr.xml, **/junitreports/**/*.xml, **/external_test_reports/**/*.xml",
    target: "${name}/${buildId}", optional: true)

optional: true ensures child jobs that produce no JUnit output (e.g. non-openjdk tests) are silently skipped without failing the step.

  1. Parent-level junit publish step — after all child artifacts are gathered, publishes the aggregated report at the parent build:
junit skipMarkingBuildUnstable: true, allowEmptyResults: true, keepLongStdio: true,
      testResults: '**/work/**/*.jtr.xml, **/result/**/*.jtr.xml, **/junitreports/**/*.xml, **/external_test_reports/**/*.xml'

Safety / Status Interference

skipMarkingBuildUnstable: true is used intentionally to ensure the junit step never overrides the pipeline's own build status logic (checkTestResults()). This directly addresses the concern raised in #6244, where the TAP plugin was removed precisely because it forcibly set job status to UNSTABLE — this implementation avoids repeating that mistake.

allowEmptyResults: true ensures the parent build doesn't fail when no JUnit XML is present (e.g. platforms that only produce TAP).

Testing

  • Verified JUnit report appears at parent build level after a parallel test run
  • Verified build status is not affected by the junit step (remains controlled by checkTestResults())
  • Verified child jobs with no JUnit output are handled gracefully

- In archiveChildJobTap(), copy JUnit XML artifacts from each parallel
  child job to the parent workspace alongside the existing TAP copy.
  Uses optional:true so child jobs without JUnit output are silently
  skipped.
- After all child artifacts are gathered, publish an aggregated JUnit
  report at the parent build level using skipMarkingBuildUnstable:true
  and allowEmptyResults:true to avoid interfering with the pipeline's
  own status logic (ref adoptium#6244).

The JUnit glob patterns match those already used at the child level
(L1147): **/work/**/*.jtr.xml, **/result/**/*.jtr.xml,
**/junitreports/**/*.xml, **/external_test_reports/**/*.xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Aggregate junit results at parent test level

1 participant