Skip to content

Commit a2f98b4

Browse files
committed
fix: add NO_GINKGO env var
Signed-off-by: Zach Aller <[email protected]>
1 parent a2d0ce1 commit a2f98b4

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ test: manifests generate fmt vet envtest ## Run Ginkgo tests using go test, we p
8484

8585
.PHONY: go-unit-test
8686
go-unit-test: ## Run go unit tests
87-
KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test -run ^TestControllersGinkgo ./... -coverprofile cover-go-unit.out
87+
NO_GINKGO="true" KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test ./... -coverprofile cover-go-unit.out
8888

8989
# Utilize Kind or modify the e2e tests to load the image locally, enabling compatibility with other vendors.
9090
.PHONY: test-e2e # Run the e2e tests against a Kind k8s instance that is spun up.

internal/controller/suite_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ const (
7777
)
7878

7979
func TestControllersGinkgo(t *testing.T) {
80+
if os.Getenv("NO_GINKGO") == "true" {
81+
t.Skip("Skipping testing in CI environment")
82+
}
8083
t.Parallel()
8184

8285
RegisterFailHandler(Fail)

test/e2e/e2e_suite_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package e2e
1818

1919
import (
2020
"fmt"
21+
"os"
2122
"testing"
2223

2324
. "github.com/onsi/ginkgo/v2"
@@ -26,6 +27,9 @@ import (
2627

2728
// Run e2e tests using the Ginkgo runner.
2829
func TestE2E(t *testing.T) {
30+
if os.Getenv("NO_GINKGO") == "true" {
31+
t.Skip("Skipping testing in CI environment")
32+
}
2933
t.Parallel()
3034
RegisterFailHandler(Fail)
3135

0 commit comments

Comments
 (0)