i_trope
i_trope

Reputation: 1604

Fail Jenkins job when nosetests fail

I am managing deployment / CI of a Flask app through Jenkins. I have a build step in the form of an executed shell which runs a shell script in the host that in turns runs nosetests.

The Jenkins shell command looks like so:

$WORKSPACE/ops/test_integration.sh

integration.sh looks like so:

SETTINGS_FILE="settings/integration.py" nosetests $@

How do I have the jenkins job fail and discontinue the build if the nosetests in the above shell script fail? Thanks.

Upvotes: 1

Views: 621

Answers (1)

KeepCalmAndCarryOn
KeepCalmAndCarryOn

Reputation: 9075

I suspect nosetests will return a non zero value on failure

so you can set the shell to auto fail with

set -e

or any of the other options in here

Upvotes: 2

Related Questions