user6398734
user6398734

Reputation:

Build passes even on failing test cases in Jenkins

Some of the steps that i have done are described below:

  1. Setup Jenkins on remote linux server.

  2. Used own mac as a slave to run Xcode build

  3. I have setup a Web hook on bitbucket that runs a build on Jenkins server.

  4. Build gets triggered when i push code to repo.

  5. I have shared scheme in the Xcode project.

But whenever i push failing tests on my repo the build passes..Shouldn't CI server fail the build..I dont know where am i missing..I have posted some screenshots for clear reference

enter image description here

enter image description here

EDIT: with more research i came to know that build fails but you need to see the test results/reports that fails.How can i see the reports? I cant see any xml files under reports section

Upvotes: 0

Views: 1311

Answers (3)

Genki
Genki

Reputation: 3195

In your execute shell phase, you might need to add set -exo pipefail at the top.

Upvotes: 0

Shoaib Mohammad
Shoaib Mohammad

Reputation: 3

The jenkins runs in a step by step fashion.Build succeeds means your build step is correct and there's no issue with that but it does not mean your test cases have also passed.You need to check that with Junit if your test cases pass or not.

Upvotes: 0

Rohith
Rohith

Reputation: 106

Even I have faced the same issue where build was successful even though test cases were getting failed. You can use Log Parser plugin to parse the console output and mark your build as either stable or failed based on the output.

Upvotes: 0

Related Questions