From 439aa11221e9151230076638958307748a6e6293 Mon Sep 17 00:00:00 2001 From: Abhijith Ravindra Date: Tue, 5 Nov 2024 15:01:40 +0100 Subject: [PATCH] (chore): exec e2e from root --- .github/workflows/ci-e2e-test.yaml | 4 ++-- Makefile | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci-e2e-test.yaml b/.github/workflows/ci-e2e-test.yaml index c7ee1639..d4b8a20e 100644 --- a/.github/workflows/ci-e2e-test.yaml +++ b/.github/workflows/ci-e2e-test.yaml @@ -25,7 +25,7 @@ jobs: - name: "E2E Detection" id: e2es run: | - scenarios=$(find ${{ github.workspace }}/e2e -type f -name 'e2e_test.go' -exec dirname {} \; | xargs -n 1 basename | jq -R -s -c 'split("\n")[:-1]') + scenarios=$(make list-scenarios) echo $scenarios echo "result=$scenarios" >> $GITHUB_OUTPUT @@ -88,7 +88,7 @@ jobs: GREENHOUSE_ADMIN_KUBECONFIG: ${{ steps.config.outputs.admin_config }} GREENHOUSE_REMOTE_KUBECONFIG: ${{ steps.config.outputs.remote_config }} GREENHOUSE_REMOTE_INT_KUBECONFIG: ${{ steps.config.outputs.remote_int_config }} - CONTROLLER_LOGS_PATH: ${{github.workspace}}/bin/${{matrix.e2es}}.txt + CONTROLLER_LOGS_PATH: ${{github.workspace}}/bin/${{matrix.e2es}}-${{matrix.k8s-version}}.txt run: | go install github.com/onsi/ginkgo/v2/ginkgo@latest ginkgo version diff --git a/Makefile b/Makefile index 0ed5f48d..d54cb051 100644 --- a/Makefile +++ b/Makefile @@ -263,7 +263,7 @@ e2e-local: prepare-e2e CONTROLLER_LOGS_PATH="${PWD}/bin/$(SCENARIO)-e2e-pod-logs.txt" \ EXECUTION_ENV=$(EXECUTION_ENV) \ GOMEGA_DEFAULT_EVENTUALLY_TIMEOUT="2m" \ - go test -tags="$(SCENARIO)E2E" ${PWD}/e2e/$(SCENARIO) -test.v -ginkgo.v + go test -tags="$(SCENARIO)E2E" ${PWD}/e2e/$(SCENARIO) -test.v -ginkgo.v --ginkgo.junit-report=${PWD}/bin/$(SCENARIO)-e2e-report.xml .PHONY: prepare-e2e prepare-e2e: @@ -271,6 +271,10 @@ prepare-e2e: kind get kubeconfig --name $(REMOTE_CLUSTER) > ${PWD}/bin/$(REMOTE_CLUSTER).kubeconfig kind get kubeconfig --name $(REMOTE_CLUSTER) --internal > ${PWD}/bin/$(REMOTE_CLUSTER)-int.kubeconfig +.PHONY: list-scenarios +list-scenarios: + find ${PWD}/e2e -type f -name 'e2e_test.go' -exec dirname {} \; | xargs -n 1 basename | jq -R -s -c 'split("\n")[:-1]' + .PHONY: dev-docs dev-docs: go run -tags="dev" -mod=mod dev-env/localenv/docs.go