From 319ba6ce4ea568e41b1857032cc7266bd1585e1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaros=C5=82aw=20Pieszka?= Date: Thu, 30 Nov 2023 10:32:18 +0100 Subject: [PATCH] Handle skipping final step in E2E tests (#516) * Handle skipping final step * force test failure to test workflow * shorter verdict evaluation * removed forced failure * example invocation corrected --- .github/workflows/run-e2e-tests-reusable.yaml | 20 ++++++++++++++++--- scripts/testing/run_e2e_module_tests.sh | 5 +---- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/run-e2e-tests-reusable.yaml b/.github/workflows/run-e2e-tests-reusable.yaml index 496faba0d..c3332f6b5 100644 --- a/.github/workflows/run-e2e-tests-reusable.yaml +++ b/.github/workflows/run-e2e-tests-reusable.yaml @@ -90,9 +90,23 @@ jobs: - name: Run tests run: "./scripts/testing/run_e2e_module_tests.sh ${{ inputs.credentials-mode }} ci" - finish-e2e-tests: + confirm-matrix-tests-succeeded: runs-on: ubuntu-latest needs: run-e2e-matrix + if: success() + outputs: + success: ${{ steps.set-output.outputs.success }} steps: - - name: Final step - run: echo "All finished" \ No newline at end of file + - name: Confirm that matrix tests succeeded + id: set-output + run: echo "success=true" >> "${GITHUB_OUTPUT}" + + finish-e2e-tests: + runs-on: ubuntu-latest + needs: confirm-matrix-tests-succeeded + if: always() + steps: + - name: Final decision + run: | + [[ "${{ needs.confirm-matrix-tests-succeeded.outputs.success }}" != "true" ]] && echo "E2E tests failed" && exit 1 + echo "E2E tests passed" \ No newline at end of file diff --git a/scripts/testing/run_e2e_module_tests.sh b/scripts/testing/run_e2e_module_tests.sh index 0d93541cf..b1ab2aacb 100755 --- a/scripts/testing/run_e2e_module_tests.sh +++ b/scripts/testing/run_e2e_module_tests.sh @@ -5,8 +5,7 @@ # - credentials mode, allowed values (required): # dummy - dummy credentials passed # real - real credentials passed -# - ci to indicate call from CI pipeline (optional) -# ./run_e2e_module_tests.sh real ci +# ./run_e2e_module_tests.sh real # # The script requires the following environment variable set - these values are used to create unique SI and SB names: # GITHUB_RUN_ID - a unique number for each workflow run within a repository @@ -17,8 +16,6 @@ # SM_URL - service manager url # SM_TOKEN_URL - token url -CI=${2-manual} # if called from any workflow "ci" is expected here - # standard bash error handling set -o nounset # treat unset variables as an error and exit immediately. set -o errexit # exit immediately when a command fails.