Run integration tests in parallel

This commit is contained in:
mmontes11
2024-09-06 21:16:27 +02:00
parent 6068cc51cf
commit 986016845e
2 changed files with 10 additions and 5 deletions

View File

@ -85,6 +85,15 @@ var _ = BeforeSuite(func() {
Expect(err).NotTo(HaveOccurred())
Expect(cfg).NotTo(BeNil())
k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme})
Expect(err).NotTo(HaveOccurred())
Expect(k8sClient).NotTo(BeNil())
// Controllers only run in process 1 to avoid conflicts reconciling
if GinkgoParallelProcess() != 1 {
return
}
env, err := environment.GetOperatorEnv(testCtx)
Expect(err).ToNot(HaveOccurred())
@ -99,10 +108,6 @@ var _ = BeforeSuite(func() {
Expect(cfg).NotTo(BeNil())
DeferCleanup(testEnv.Stop)
k8sClient, err = client.New(cfg, client.Options{Scheme: scheme.Scheme})
Expect(err).NotTo(HaveOccurred())
Expect(k8sClient).NotTo(BeNil())
k8sManager, err := ctrl.NewManager(cfg, ctrl.Options{
Scheme: scheme.Scheme,
Controller: config.Controller{

View File

@ -33,7 +33,7 @@ ENV_ENT ?= \
TEST_ENTERPRISE=true \
KUBEBUILDER_ASSETS=$(KUBEBUILDER_ASSETS)
TEST_ARGS ?= --coverprofile=cover.out --timeout 30m
TEST_ARGS ?= --coverprofile=cover.out --timeout 30m -p
TEST ?= $(ENV) $(GINKGO) $(TEST_ARGS)
TEST_ENT ?= $(ENV_ENT) $(GINKGO) $(TEST_ARGS)