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.
This commit is contained in:
7
.github/workflows/docker-build-push.yaml
vendored
7
.github/workflows/docker-build-push.yaml
vendored
@@ -34,10 +34,13 @@ jobs:
|
|||||||
go-version-file: 'go.mod'
|
go-version-file: 'go.mod'
|
||||||
cache: true
|
cache: true
|
||||||
|
|
||||||
|
- name: Install envtest binaries
|
||||||
|
run: |
|
||||||
|
make setup-envtest
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: |
|
run: |
|
||||||
go test -v ./... -coverprofile=coverage.out
|
make test
|
||||||
go tool cover -func=coverage.out
|
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|||||||
5
.github/workflows/pr-validation.yaml
vendored
5
.github/workflows/pr-validation.yaml
vendored
@@ -30,8 +30,11 @@ jobs:
|
|||||||
- name: Run go vet
|
- name: Run go vet
|
||||||
run: go vet ./...
|
run: go vet ./...
|
||||||
|
|
||||||
|
- name: Install envtest binaries
|
||||||
|
run: make setup-envtest
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: go test -v -race -coverprofile=coverage.out ./...
|
run: make test
|
||||||
|
|
||||||
- name: Upload coverage to Codecov
|
- name: Upload coverage to Codecov
|
||||||
uses: codecov/codecov-action@v4
|
uses: codecov/codecov-action@v4
|
||||||
|
|||||||
6
.github/workflows/release.yaml
vendored
6
.github/workflows/release.yaml
vendored
@@ -31,9 +31,13 @@ jobs:
|
|||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version-file: 'go.mod'
|
go-version-file: 'go.mod'
|
||||||
|
cache: true
|
||||||
|
|
||||||
|
- name: Install envtest binaries
|
||||||
|
run: make setup-envtest
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: go test -v ./...
|
run: make test
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v3
|
uses: docker/setup-qemu-action@v3
|
||||||
|
|||||||
Reference in New Issue
Block a user