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
py.test --junitxml=result_ih.xml

Here is screenshot from Jenkin’s configuration interface.

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


Click here to write/view comments