From 556fa62348fbd78a74368ffcd7494d7840257021 Mon Sep 17 00:00:00 2001 From: Chmouel Boudjnah Date: Wed, 18 Dec 2024 13:59:09 +0100 Subject: [PATCH] Fix e2e tests and uploading artifacts Shell script was wrong, let's fix it Fix uploading with matrix jobs we would otherwise get those: ``` Error: Failed to CreateArtifact: Received non-retryable error: Failed request: (409) Conflict: an artifact with this name already exists on the workflow run ```
Details
Signed-off-by: Chmouel Boudjnah --- .github/workflows/kind-e2e-tests.yaml | 2 +- Makefile | 4 ++-- hack/gh-workflow-ci.sh | 6 ++---- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/.github/workflows/kind-e2e-tests.yaml b/.github/workflows/kind-e2e-tests.yaml index 5d34faa0f..e658fc4cd 100644 --- a/.github/workflows/kind-e2e-tests.yaml +++ b/.github/workflows/kind-e2e-tests.yaml @@ -122,7 +122,7 @@ jobs: if: ${{ always() }} uses: actions/upload-artifact@v4 with: - name: logs + name: logs-e2e-tests-${{ matrix.provider }} path: /tmp/logs - name: Report Status diff --git a/Makefile b/Makefile index b9e48355e..94ebe7082 100644 --- a/Makefile +++ b/Makefile @@ -73,8 +73,8 @@ test-e2e-cleanup: ## cleanup test e2e namespace/pr left open .PHONY: test-e2e test-e2e: test-e2e-cleanup ## run e2e tests - @env GODEBUG=asynctimerchan=1 \ - go test $(GO_TEST_FLAGS) -timeout $(TIMEOUT_E2E) -failfast -count=1 -tags=e2e $(GO_TEST_FLAGS) ./test + env GODEBUG=asynctimerchan=1 \ + go test -timeout $(TIMEOUT_E2E) -failfast -count=1 -tags=e2e -v $(GO_TEST_FLAGS) ./test .PHONY: html-coverage html-coverage: ## generate html coverage diff --git a/hack/gh-workflow-ci.sh b/hack/gh-workflow-ci.sh index b93aed406..bb215d418 100755 --- a/hack/gh-workflow-ci.sh +++ b/hack/gh-workflow-ci.sh @@ -141,10 +141,8 @@ run_e2e_tests() { mapfile -t tests < <(get_tests "${target}") echo "About to run ${#tests[@]} tests: ${tests[*]}" - env GO_TEST_FLAGS="-run '$( - IFS='|' - echo "${tests[*]}" - )'" make test-e2e + # shellcheck disable=SC2001 + GO_TEST_FLAGS="-run \"$(echo "${tests[*]}" | sed 's/ /|/g')\"" make test-e2e } collect_logs() {