From 35173add364a141b3a63981cc6e885adaf5ee888 Mon Sep 17 00:00:00 2001 From: Vegard Engen Date: Sat, 25 Oct 2025 21:59:05 +0200 Subject: [PATCH] Fix test failures in GitHub Actions workflows - Add envtest setup before running tests - Use 'make setup-envtest' to install test binaries - Use 'make test' instead of direct go test - Ensures proper test environment setup in CI This fixes the BeforeSuite panic caused by missing envtest binaries. --- .github/workflows/docker-build-push.yaml | 7 +++++-- .github/workflows/pr-validation.yaml | 5 ++++- .github/workflows/release.yaml | 6 +++++- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-build-push.yaml b/.github/workflows/docker-build-push.yaml index 5ed8409..509d3ff 100644 --- a/.github/workflows/docker-build-push.yaml +++ b/.github/workflows/docker-build-push.yaml @@ -34,10 +34,13 @@ jobs: go-version-file: 'go.mod' cache: true + - name: Install envtest binaries + run: | + make setup-envtest + - name: Run tests run: | - go test -v ./... -coverprofile=coverage.out - go tool cover -func=coverage.out + make test - name: Set up QEMU uses: docker/setup-qemu-action@v3 diff --git a/.github/workflows/pr-validation.yaml b/.github/workflows/pr-validation.yaml index 1344ad2..7a327f4 100644 --- a/.github/workflows/pr-validation.yaml +++ b/.github/workflows/pr-validation.yaml @@ -30,8 +30,11 @@ jobs: - name: Run go vet run: go vet ./... + - name: Install envtest binaries + run: make setup-envtest + - name: Run tests - run: go test -v -race -coverprofile=coverage.out ./... + run: make test - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 1fcf020..6a72080 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -31,9 +31,13 @@ jobs: uses: actions/setup-go@v5 with: go-version-file: 'go.mod' + cache: true + + - name: Install envtest binaries + run: make setup-envtest - name: Run tests - run: go test -v ./... + run: make test - name: Set up QEMU uses: docker/setup-qemu-action@v3