# How do I make Jenkins build fail when Newman tests fail

**URL:** <https://community.postman.com/t/how-do-i-make-jenkins-build-fail-when-newman-tests-fail/5104>\
**Category:** Help Hub\
**Tags:** newman-project, tests, collections, jenkins\
**Created:** [April 23, 2019, 3:56pm UTC](https://community.postman.com/t/how-do-i-make-jenkins-build-fail-when-newman-tests-fail/5104 "2019-04-23T15:56:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jain.shweta0105](https://avatars.discourse-cdn.com/v4/letter/j/a183cd/32.png) [@jain.shweta0105](https://community.postman.com/u/jain.shweta0105)\
**Post date:** [April 23, 2019, 3:56pm UTC](https://community.postman.com/t/how-do-i-make-jenkins-build-fail-when-newman-tests-fail/5104/1 "2019-04-23T15:56:53Z")

</div>

I am stuck with this issue -  
eg- I have 2 collections one passes and one fails , both are fired by two separate newman commands.

newman run col1.json this contains failure test case  
newman run col2.json this passes

when integrated with jenkins as last executed is col2 and it successfull the build result is success, but it should be failure, do have any idea

This also has been raised at [https://github.com/postmanlabs/newman/issues/853](https://github.com/postmanlabs/newman/issues/853). I donot know how can I resolve this issue. Could someone please advise.

---

<div class="post-metadata">

**Author:** ![tmccann](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/tmccann/32/3550_2.png) [@tmccann](https://community.postman.com/u/tmccann)\
**Post date:** [April 25, 2019, 2:23pm UTC](https://community.postman.com/t/how-do-i-make-jenkins-build-fail-when-newman-tests-fail/5104/2 "2019-04-25T14:23:30Z")

</div>

It looks like you have a solution for this already based on the GitHub issue you raised.

However I will mention a solution that I have used and seems to work for me.  
I simply use a bash script and put my Newman runs in there.

I add `set -e` at the first of my script. This will tell it to exit on error if there is an issue, this in my case results in a failure on the Jenkins job.

Hopefully this helps you and others that have an issue.
