Skip to content

Commit 069f6f5

Browse files
committed
Fixed test issue with CRDs that could not be found
1 parent 144b56a commit 069f6f5

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

internal/controller/suite_test.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,16 @@ import (
2929
"encoding/json"
3030
"errors"
3131
pdoknlv2beta1 "github.com/pdok/mapserver-operator/api/v2beta1"
32+
smoothoperator1 "github.com/pdok/smooth-operator/api/v1"
33+
traefikiov1alpha1 "github.com/traefik/traefik/v3/pkg/provider/kubernetes/crd/traefikio/v1alpha1"
34+
"golang.org/x/tools/go/packages"
3235
"k8s.io/apimachinery/pkg/runtime"
3336
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
3437
"os"
3538
"os/exec"
3639
"path/filepath"
3740
"testing"
3841

39-
traefikiov1alpha1 "github.com/traefik/traefik/v3/pkg/provider/kubernetes/crd/traefikio/v1alpha1"
40-
"golang.org/x/tools/go/packages"
41-
4242
. "github.com/onsi/ginkgo/v2"
4343
. "github.com/onsi/gomega"
4444

@@ -49,7 +49,6 @@ import (
4949
"sigs.k8s.io/controller-runtime/pkg/log/zap"
5050

5151
pdoknlv3 "github.com/pdok/mapserver-operator/api/v3"
52-
smoothoperator1 "github.com/pdok/smooth-operator/api/v1"
5352
// +kubebuilder:scaffold:imports
5453
)
5554

@@ -102,7 +101,8 @@ var _ = BeforeSuite(func() {
102101
CRDInstallOptions: envtest.CRDInstallOptions{
103102
Scheme: scheme,
104103
Paths: []string{
105-
filepath.Join("..", "..", "config", "crd", "bases"),
104+
filepath.Join("..", "..", "config", "crd", "bases", "pdok.nl_wfs.yaml"),
105+
filepath.Join("..", "..", "config", "crd", "bases", "pdok.nl_wms.yaml"),
106106
traefikCRDPath,
107107
ownerInfoCRDPath,
108108
},
@@ -117,8 +117,7 @@ var _ = BeforeSuite(func() {
117117

118118
// cfg is defined in this file globally.
119119
cfg, err = testEnv.Start()
120-
// TODO enabling next line causes the tests to fail, find out why
121-
//Expect(err).NotTo(HaveOccurred())
120+
Expect(err).NotTo(HaveOccurred())
122121
Expect(cfg).NotTo(BeNil())
123122

124123
k8sClient, err = client.New(cfg, client.Options{Scheme: scheme})

0 commit comments

Comments
 (0)