-
Notifications
You must be signed in to change notification settings - Fork 551
Closed
Description
Description
The Jenkins pipelines defined in .jenkins/pipelines/ currently run tests but do not publish the JUnit/Surefire test results. This means the Jenkins dashboard cannot display a proper visualization of test results, including:
- Test trend graphs over time
- Failing test breakdowns with stack traces
- Test duration analysis
- Test stability metrics
Publishing these results would significantly improve the developer experience when investigating build failures and tracking test health.
Background
The following pipelines run Maven builds with tests:
| Pipeline | Runs Tests | Publishes Results |
|---|---|---|
java-8.Jenkinsfile |
✅ ./mvnw install |
❌ No |
sonar.Jenkinsfile |
✅ ./mvnw -Pjacoco,sonar install |
❌ No |
release-snapshots.Jenkinsfile |
❌ -DskipTests implied via deploy |
N/A |
Expected Behavior
After a build completes (success or failure), the Jenkins dashboard should:
- Display the total number of tests run, passed, failed, and skipped
- Show a test trend graph across builds
- Allow drilling down into individual failing tests with stack traces
- Preserve test history for regression analysis
Proposed Solution
Add a post block to the relevant Jenkinsfiles to archive and publish test results using the junit step:
post {
always {
junit testResults: '**/target/surefire-reports/*.xml', allowEmptyResults: true
}
}For the pipelines that may also run Failsafe integration tests, consider:
post {
always {
junit testResults: '**/target/surefire-reports/*.xml,**/target/failsafe-reports/*.xml', allowEmptyResults: true
}
}Affected Pipelines
-
.jenkins/pipelines/java-8.Jenkinsfile -
.jenkins/pipelines/sonar.Jenkinsfile
Additional Information
- Jenkins JUnit plugin documentation: https://plugins.jenkins.io/junit/
- The
allowEmptyResults: trueflag prevents build failure if some modules don't produce test reports - The Eclipse Project Handbook should be checked to see if the Common Build Infrastructure (CBI) has the relevant plugins for the Jenkins instance (ci.eclipse.org)
Acceptance Criteria
- Test results are published after each build in
java-8.Jenkinsfile - Test results are published after each build in
sonar.Jenkinsfile - Jenkins dashboard shows test trends for affected pipelines
- Failing tests are visible with stack traces in the Jenkins UI
- Test results are preserved even when the build fails
Tests
- Trigger a build with a failing test and verify the failure is visible in Jenkins UI
- Verify test trend graphs appear after multiple builds
- Confirm stack traces are accessible for failed tests
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request
Type
Projects
Status
Done