I was using the Execute shell
function in Jenkins with a different set of commands (calling the newman
testing application). When one of the test cases was failing through newman
, my build was marked as a failure.
Previous Execute shell
newman run ./test/postman_collection_1.json --environment ./test/postman_environment.json --bail
newman run ./test/postman_collection_2.json --environment ./test/postman_environment.json --bail
Since I move moved all these commands to a script file, and used "Execute shell" to execute this script file (which are a copy of the commands previously directly in the "Execute shell", my build is not marked as a failure anymore when one of the newman test cases fails.
New Execute shell
:
chmod +x ./docs/ci_tests.sh
./docs/ci_tests.sh
Content of ci_tests.sh
:
#!/bin/bash
newman run ./test/postman_collection_1.json --environment ./test/postman_environment.json --bail
newman run ./test/postman_collection_2.json --environment ./test/postman_environment.json --bail
Any reason why the return value of the commands (newman
) are not triggering a jenkins fail when I am using them through a file?