Reputation: 915
I am using gitlab CI to test my application, and I am using gradle to run the tests.
However, even when my test fail, the job yields passed wrongly, as you can see of part of console output below.
BUILD FAILED
Total time: 2 mins 29.452 secs
Build succeeded
Upvotes: 0
Views: 754
Reputation: 7879
GitLab CI uses the process exit code to determine if a job passes or fails. If your tests print "BUILD FAILED" but exits with an exit code of zero then GitLab thinks your tests passed.
You need to configure your tests to return a non-zero exit code on failure.
Upvotes: 3