Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Prevent "Publish JUnit test result report" changes build result

Tags:

junit

jenkins

Currently the build step Publish JUnit test result report changes build result to UNSTABLE.

Build step 'Publish JUnit test result report' changed build result to UNSTABLE

But I don't want it makes any change to my build status. I try to set

  • Health report amplification factor = 0.0
  • Allow empty results. Do not fail the build on empty test results (checked)

But the plugin still changes the build status. How can I disable updating build results by the plugin?

like image 677
Tuan Avatar asked Sep 15 '17 06:09

Tuan


People also ask

How do I use JUnit in Jenkins pipeline?

To use this feature, first set up your build to run tests, then specify the path to JUnit XML files in the Ant glob syntax, such as **/build/test-reports/*. xml. Be sure not to include any non-report files into this pattern. You can specify multiple patterns of files separated by commas.

Which Jenkins plugin helps to process test reports?

The JUnit plugin provides a publisher that consumes XML test reports generated during the builds and provides some graphical visualization of the historical test results (see JUnit graph for a sample) as well as a web UI for viewing test reports, tracking failures, and so on.

Where are JUnit results stored?

This data is stored within JENKINS_HOME , and the current storage format requires huge overheads when retrieving statistics and, especially, trends. In order to display trends, each report has to be loaded and then processed in-memory.


1 Answers

You can add the parameter:

skipMarkingBuildUnstable:true

in your jenkins pipeline. For me it works fine after this:

junit testResults: 'target/surefire-reports/junitreports/TEST-RunCucumberTest.xml', skipPublishingChecks: true, skipMarkingBuildUnstable:true

This info is not actually visible in plugin website: https://plugins.jenkins.io/junit/

But this change is merged and available: https://github.com/jenkinsci/junit-plugin/pull/282

like image 119
Juris Kreilis Avatar answered Oct 05 '22 07:10

Juris Kreilis