Skip to content

Commit

Permalink
fix: add NO_GINKGO env var
Browse files Browse the repository at this point in the history
Signed-off-by: Zach Aller <[email protected]>
  • Loading branch information
zachaller committed Jan 20, 2025
1 parent a2d0ce1 commit a2f98b4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ test: manifests generate fmt vet envtest ## Run Ginkgo tests using go test, we p

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

# Utilize Kind or modify the e2e tests to load the image locally, enabling compatibility with other vendors.
.PHONY: test-e2e # Run the e2e tests against a Kind k8s instance that is spun up.
Expand Down
3 changes: 3 additions & 0 deletions internal/controller/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ const (
)

func TestControllersGinkgo(t *testing.T) {
if os.Getenv("NO_GINKGO") == "true" {
t.Skip("Skipping testing in CI environment")
}
t.Parallel()

RegisterFailHandler(Fail)
Expand Down
4 changes: 4 additions & 0 deletions test/e2e/e2e_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package e2e

import (
"fmt"
"os"
"testing"

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

// Run e2e tests using the Ginkgo runner.
func TestE2E(t *testing.T) {
if os.Getenv("NO_GINKGO") == "true" {
t.Skip("Skipping testing in CI environment")
}
t.Parallel()
RegisterFailHandler(Fail)

Expand Down

0 comments on commit a2f98b4

Please sign in to comment.