CircleCI Ideas

Add "accepted exit codes" to "run"

Some commands might "fail" with an error code != 0; and this might be an accepted or even expected behaviour.

If we'll have for example: "exit_codes:" with a list of accepted exit codes determine what is "okay" and what is not, it will further allow facilitation of negative testing.

Right now the best way (AFAIK) to achieve similar results is via a bash script that deals with the exit code as needed.

If dealing with simple negative testing, one use e.g.:

- run: bash -c "my_command_that_should_fail; if [[ \$? -eq 0 ]] ; then exit 1 ; else exit 0 ; fi"

  • Avatar32.5fb70cce7410889e661286fd7f1897de Guest
  • Mar 18 2019
  • New
  • Attach files
  • Avatar40.8f183f721a2c86cd98fddbbe6dc46ec9
    Guest commented
    March 19, 2019 07:09

    Edited to reflect a working version of a bash command for negative testing.