Jenkins execute shell – how to continue on error

In case can you are using Jenkins shell commands to run tests and are running multiple commands, by default Jenkins exits the comment one shell command fails. To avoid failing on error and continue to next shell command, you can use “set +e” as shown below:

set +e
py.test --junitxml=result_abc.xml test_abc.py
py.test --junitxml=result_ih.xml test_ih.py

Here is screenshot from Jenkin’s configuration interface.
jenkins-multiple-shell-commands-continue-on-error-set-plus-e

Share this article: share on Google+ share on facebook share on linkedin tweet this submit to reddit

Comments

Click here to write/view comments