diff --git a/Makefile b/Makefile index c3c2fcba..6f05d90e 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,7 @@ install-tools: go install golang.org/x/vuln/cmd/govulncheck@latest ENVTEST_K8S_VERSION = 1.26.1 -ARCHITECTURE = amd64 +ARCHITECTURE = $(shell go env GOARCH) LOCAL_TESTBIN = $(CURDIR)/testbin LOCAL_BIN := $(CURDIR)/bin @@ -58,7 +58,7 @@ integration-tests: install-tools $(KUBEBUILDER_ASSETS) generate fmt vet manifest ginkgo -r --randomize-all controllers/ just-integration-tests: $(KUBEBUILDER_ASSETS) vet - ginkgo --randomize-all -r controllers/ + ginkgo --randomize-all -r -p controllers/ local-tests: unit-tests integration-tests ## Run all local tests (unit & integration) diff --git a/controllers/suite_test.go b/controllers/suite_test.go index 04cf9bef..114a9b38 100644 --- a/controllers/suite_test.go +++ b/controllers/suite_test.go @@ -15,6 +15,7 @@ import ( "fmt" "go/build" "k8s.io/client-go/kubernetes" + "k8s.io/client-go/rest" "path/filepath" "testing" "time" @@ -101,6 +102,9 @@ var _ = BeforeSuite(func() { filepath.Join(build.Default.GOPATH, "pkg", "mod", "github.com", "rabbitmq", "cluster-operator", "v2@v2.6.0", "config", "crd", "bases"), }, ErrorIfCRDPathMissing: true, + Config: &rest.Config{ + Host: fmt.Sprintf("localhost:818%d", GinkgoParallelProcess()), + }, } cfg, err := testEnv.Start()