Setting up jasmine-maven-plugin failures to make jenkins unstable

I'd like to configure jasmine-maven-plugin to make jenkins unstable if a test fails but the only options appear to be:

  1. set haltOnFailure true and have failures break the build
  2. set haltOnFailure false and have failures reported in the logs but the build succeeds.

Is there a way to check the logs post-test and mark the build unstable?

Answers


Sam Hasler's answer only works for freestyle Jenkins jobs. We use Maven jobs and this configuration option of the JUnit Jenkins plugin is unavailable for Maven jobs. So I was looking for a more universal solution.

What we did in order to get it working is to reconfigure the Jasmine Maven plugin so as to

  • no longer halt the build upon test failures and
  • write the Jasmine test reports to target/surefire-reports where Jenkins expects to find them. This has the additional advantage that we now also see the failed Jasmine test in the build job alongside our Java tests.
<haltOnFailure>false</haltOnFailure>
<jasmineTargetDir>${project.build.directory}/surefire-reports</jasmineTargetDir>

Now our build jobs are yellow (unstable) as expected, no longer red (failed).


Found the answer myself!

I had to configure jenkins to also look at the jasmine junit report:

under Publish JUnit test result report add **/TEST-jasmine.xml to Test report XMLs, comma separated if there is something there already:

**/TESTS-TestSuites.xml,**/TEST-jasmine.xml


Need Your Help

How to add 'Pull to refresh'/ 'Load more' in UICollectionView using swift? (for both vertical and horizontal)

ios objective-c iphone swift

How to add 'Pull to refresh'/ 'Load more' functionality in UICollectionView using swift? (for both vertical and horizontal)

jqPlot Pie Chart Tooltips Not Appearing

javascript jquery jqplot

My pie charts are rendering properly, however tooltips are not appearing when hovering over the slices when attempting to use the highlighter plugin for the tooltips.