Answers: <p>By default Jenkins assumes whether the build is <code>SUCCESS</code> or not from build process exit code.</p>
  
  <p>Which means that build exit with <code>code 0</code> considered as SUCCESS, rest all are considered as FAILURE.</p>
  
  <p>If your build step/process exit with <code>code 0</code>, even during the failure case then Jenkins will report the build is <code>SUCCESS</code>.</p>
  
  <p>So I my suggestion is to run the all build steps manually and try to get the exit code on each step (for both PASS and FAIL case).</p>
  
Answers: CC BY-SA 3.0
Answers: 2017-04-12T09:29:26.250Z
Answers: 2017-04-12T12:32:52.557Z
Answers: 2017-04-12T12:32:52.557Z
Answers: HamTheAstroChimp
Body: <p>I created a project in Jenkins and set it to run tests on every pushes. but even when one of the pushes does not pass the tests, Jenkins build returns success. How can define failure situation if tests do not pass in Jenkins?</p>
  
Comments: CC BY-SA 3.0
Comments: 2017-04-12T09:35:07.037Z
Comments: Could you [edit] with information on your tests? There are hundreds of testing frameworks which all behave differently, so it's hard to answer definitively without more information on how you're testing your code.
Comments: Aurora0001
Comments: CC BY-SA 3.0
Comments: 2017-04-13T04:06:22.787Z
Comments: @Aurora0001 ThanQ for your comment, the test framework is written by me in "jsx" for test aftereffect scripts. The problem has been solved by the exit codes.
Comments: Mohammad Rezaei
Tags: <jenkins><continuous-integration><continuous-delivery>
Title: How to define failure situation on jenkins
UserDisplayName: Mohammad Rezaei
ThreadText: # How to define failure situation on jenkins
  
  (Asked by: username_0 on 2017-04-12)
  
  I created a project in Jenkins and set it to run tests on every pushes. but even when one of the pushes does not pass the tests, Jenkins build returns success. How can define failure situation if tests do not pass in Jenkins?
  
  **Tags:** jenkins, continuous-integration, continuous-delivery
  
  > **Comments:**
  > **username_1**: Could you [edit] with information on your tests? There are hundreds of testing frameworks which all behave differently, so it's hard to answer definitively without more information on how you're testing your code.  
  > **username_0**: @username_1 ThanQ for your comment, the test framework is written by me in "jsx" for test aftereffect scripts. The problem has been solved by the exit codes.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2017-04-12. Score: 6 | Accepted answer
  
  By default Jenkins assumes whether the build is `SUCCESS` or not from build process exit code.
  
  Which means that build exit with `code 0` considered as SUCCESS, rest all are considered as FAILURE.
  
  If your build step/process exit with `code 0`, even during the failure case then Jenkins will report the build is `SUCCESS`.
  
  So I my suggestion is to run the all build steps manually and try to get the exit code on each step (for both PASS and FAIL case).
  
  
  ---
  
  