0

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?

  • 3
    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. – Aurora0001 Apr 12 '17 at 9:35
  • @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. – Mohammad Rezaei Apr 13 '17 at 4:06
6

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).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.