diff --git a/.github/actions/test/action.yml b/.github/actions/test/action.yml index 9ff1e41d..099b14df 100644 --- a/.github/actions/test/action.yml +++ b/.github/actions/test/action.yml @@ -10,6 +10,10 @@ inputs: description: The name to use for the debug bundle artifact. required: true default: debug-bundle + exit-on-failure: + description: If true, robot will exit the tests as soon as the first failure occurs. + required: false + default: true runs: using: composite steps: @@ -44,6 +48,8 @@ runs: - name: Run test suite shell: bash + env: + EXIT_ON_FAILURE: ${{ inputs.exit-on-failure }} run: | set -e source ./ci.env diff --git a/bin/run-tests b/bin/run-tests index b160ef4d..ed74cf16 100755 --- a/bin/run-tests +++ b/bin/run-tests @@ -22,6 +22,11 @@ ansible_variable() { work_bin_dir="$(ansible_variable work_directory)/bin" export PATH=$PATH:$work_bin_dir +extraargs="" +if [[ $EXIT_ON_FAILURE == true ]]; then + extraargs="--exitonfailure $extraargs" +fi + # Get the test directory test_directory="$(ansible_variable generate_tests_suite_directory)" test_vars_file="$(ansible_variable generate_tests_vars_file)" @@ -32,5 +37,6 @@ exec robot \ --loglevel debug \ --consolecolors on \ --variablefile "$test_vars_file" \ + "$extraargs" \ "$@" \ "$test_directory"