I changed the configuration in Jenkins to execute multiple build steps (Shell), the steps are:
1 - executes some prereq for my scripts
2 - the first part of the script
//I had to separate the executions to not consume all the resources from the VM I use to execute
3 - the rest of scripts
4 - the merge of all my xml files for the Reports.
An example of the step is:
export AUTOTEST_HOME="${WORKSPACE}"
export AUTOTEST_ADDRESS= IPaDD
cd "${AUTOTEST_HOME}/e2e_ui_tests/development_new_ui/"
ls -lah
if [ -L lib/node_modules ]; then
unlink lib/node_modules
fi
if [ -L node_modules/node_modules ]; then
unlink node_modules/node_modules
fi
#Running just install, without the post install scripts
npm install --ignore-scripts
#Library access symlink
ln -s ../node_modules/ lib/node_modules
cd "${AUTOTEST_HOME}/e2e_ui_tests/development_new_ui/sharding/"
#Run the Prereq script to prepare the portal
./../lib/node_modules/protractor/bin/protractor 1_Conf_prereq.js
The problem is that since the step number 2 contains some failures (bugs found by the validations), Jenkins stops the build steps after its execution, ignoring the rest of it.
Is there a way to make it run till the very final step and then if it is the case, failing the job?
I tried to add the set +e at the top of the step to try to avoid the exit of the step, but didn't work (https://support.cloudbees.com/hc/en-us/articles/218517228-How-to-Ignore-Failures-in-a-Shell-Step)
" [12:02:55] E/launcher - Process exited with error code 1 Build step 'Conditional steps (multiple)' marked build as failure
[htmlpublisher] Archiving HTML reports...
"
PS: Protractor is correctly triggered for prereq and the specs, fails after the first problem is found by the scripts
Any idea how to solve this? thank you!