Reputation: 12616
I'd like to configure jasmine-maven-plugin to make jenkins unstable if a test fails but the only options appear to be:
Is there a way to check the logs post-test and mark the build unstable?
Upvotes: 2
Views: 1104
Reputation: 67287
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
<haltOnFailure>false</haltOnFailure>
<jasmineTargetDir>${project.build.directory}/surefire-reports</jasmineTargetDir>
Now our build jobs are yellow (unstable) as expected, no longer red (failed).
Upvotes: 1
Reputation: 12616
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
Upvotes: 1