Skip to content

Commit 7d21127

Browse files
committed
Make unit tests parallel
1 parent a0eb858 commit 7d21127

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ GINKGO ?= go run github.com/onsi/ginkgo/v2/ginkgo
6969

7070
.PHONY: just-unit-tests
7171
just-unit-tests:
72-
$(GINKGO) -r --randomize-all api/ internal/ pkg/
72+
$(GINKGO) -r -p --randomize-all --fail-on-pending api/ internal/ pkg/
7373

7474
.PHONY: integration-tests
7575
integration-tests::install-tools
@@ -83,7 +83,7 @@ integration-tests::just-integration-tests ## Run integration tests
8383

8484
.PHONY: just-integration-tests
8585
just-integration-tests:
86-
$(GINKGO) -r -p controllers/
86+
$(GINKGO) -r -p --fail-on-pending --randomize-all controllers/
8787

8888
manifests: install-tools ## Generate manifests e.g. CRD, RBAC etc.
8989
controller-gen crd rbac:roleName=operator-role paths="./api/...;./controllers/..." output:crd:artifacts:config=config/crd/bases

api/v1beta1/suite_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
package v1beta1
1010

1111
import (
12+
"fmt"
1213
"path/filepath"
1314
"testing"
1415

@@ -41,6 +42,9 @@ var _ = BeforeSuite(func() {
4142
By("bootstrapping test environment")
4243
testEnv = &envtest.Environment{
4344
CRDDirectoryPaths: []string{filepath.Join("..", "..", "config", "crd", "bases")},
45+
Config: &rest.Config{
46+
Host: fmt.Sprintf("http://localhost:218%d", GinkgoParallelProcess()),
47+
},
4448
}
4549

4650
err := SchemeBuilder.AddToScheme(scheme.Scheme)

0 commit comments

Comments
 (0)