Skip to content

Commit a0eb858

Browse files
committed
Make integration tests parallel
1 parent ab7a705 commit a0eb858

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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 controllers/
86+
$(GINKGO) -r -p 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

controllers/rabbitmqcluster_controller_test.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -488,8 +488,12 @@ var _ = Describe("RabbitmqClusterController", func() {
488488
Expect(resourceRequirements.Limits).To(HaveKeyWithValue(corev1.ResourceMemory, expectedRequirements.Limits[corev1.ResourceMemory]))
489489

490490
// verify that SuccessfulUpdate event is recorded for the StatefulSet
491-
Expect(aggregateEventMsgs(ctx, cluster, "SuccessfulUpdate")).To(
492-
ContainSubstring("updated resource %s of Type *v1.StatefulSet", cluster.ChildResourceName("server")))
491+
Eventually(func() string {
492+
return aggregateEventMsgs(ctx, cluster, "SuccessfulUpdate")
493+
}).
494+
Within(5 * time.Second).
495+
WithPolling(time.Second).
496+
Should(ContainSubstring("updated resource %s of Type *v1.StatefulSet", cluster.ChildResourceName("server")))
493497
})
494498

495499
It("the rabbitmq image is updated", func() {

controllers/suite_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ package controllers_test
1212

1313
import (
1414
"context"
15+
"fmt"
1516
"path/filepath"
1617
"testing"
1718

@@ -73,6 +74,9 @@ var _ = BeforeSuite(func() {
7374
By("bootstrapping test environment")
7475
testEnv = &envtest.Environment{
7576
CRDDirectoryPaths: []string{filepath.Join("..", "config", "crd", "bases")},
77+
Config: &rest.Config{
78+
Host: fmt.Sprintf("http://localhost:218%d", GinkgoParallelProcess()),
79+
},
7680
}
7781

7882
cfg, err := testEnv.Start()

0 commit comments

Comments
 (0)