File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 6
6
- common/config/config.go
7
7
- mocks
8
8
# the following files should be excluded from coverage later
9
- - listener/apischema/*
10
- - listener/controller/*
9
+ # - listener/apischema/*
10
+ # - listener/controller/*
Original file line number Diff line number Diff line change @@ -18,9 +18,11 @@ import (
18
18
"github.com/stretchr/testify/suite"
19
19
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
20
20
"k8s.io/client-go/rest"
21
+ ctrl "sigs.k8s.io/controller-runtime"
21
22
"sigs.k8s.io/controller-runtime/pkg/client"
22
23
"sigs.k8s.io/controller-runtime/pkg/envtest"
23
24
"sigs.k8s.io/controller-runtime/pkg/kcp"
25
+ "sigs.k8s.io/controller-runtime/pkg/log/zap"
24
26
25
27
"github.com/openmfp/account-operator/api/v1alpha1"
26
28
appConfig "github.com/openmfp/kubernetes-graphql-gateway/common/config"
@@ -29,6 +31,14 @@ import (
29
31
"github.com/openmfp/kubernetes-graphql-gateway/gateway/schema"
30
32
)
31
33
34
+ // Initialize the logger for the test suite
35
+ // This is necessary to avoid the "[controller-runtime] log.SetLogger(...) was never called" error
36
+ // when running the tests
37
+ func TestMain (m * testing.M ) {
38
+ ctrl .SetLogger (zap .New (zap .UseDevMode (true )))
39
+ os .Exit (m .Run ())
40
+ }
41
+
32
42
type CommonTestSuite struct {
33
43
suite.Suite
34
44
testEnv * envtest.Environment
You can’t perform that action at this time.
0 commit comments