richard
richard

Reputation: 3299

Maven build with jasmine test succeeds but jenkins displays it as a failure

We have a project that is built with Maven and includes a set of Jasmine tests. These are run using the jasmine-maven-plugin and runs in the headless mode.

The project builds correctly when run from the command line. However when run from jenkins, jenkins reports the project as failed (i.e. a red ball).When we check the slaves console, the build is successful.

The console output ends with Finished: SUCCESS

We added a post build step that checked the process result code returned was 0.

We have tried running build with both windows and linux slaves, without any difference.

When we disable the jasmine test from running during the build, then JEnkins shows the project as successfully built.

We have checked the jenkins logs and we see messages like

28/01/2015 2:14:44 PM hudson.model.Run execute INFO: tempest #20 main build action completed: SUCCESS

How can we determine why Jenkins thinks the build is failing????

Thanks Bett and Richard

Upvotes: 0

Views: 311

Answers (1)

Boris Charpentier
Boris Charpentier

Reputation: 3543

What I've done in another context (iOS build) for jenkins to understand that my test succeed or fail is adding && exit ${PIPESTATUS[0]} after my script :

xcpretty --test --report junit && exit ${PIPESTATUS[0]}

Maybe it can help you.

Upvotes: 0

Related Questions