File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -10,10 +10,13 @@ import (
1010
1111 configv1 "github.com/openshift/api/config/v1"
1212 olmv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1"
13+ "go.uber.org/zap/zapcore"
1314 v1 "k8s.io/api/core/v1"
1415 metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
16+ ctrl "sigs.k8s.io/controller-runtime"
1517 "sigs.k8s.io/controller-runtime/pkg/client"
1618 "sigs.k8s.io/controller-runtime/pkg/client/config"
19+ "sigs.k8s.io/controller-runtime/pkg/log/zap"
1720
1821 "github.com/rhobs/observability-operator/pkg/operator"
1922 "github.com/rhobs/observability-operator/test/e2e/framework"
3336func TestMain (m * testing.M ) {
3437 flag .Parse ()
3538
39+ // Setup controller-runtime logger to avoid warning messages
40+ opts := zap.Options {
41+ Development : true ,
42+ TimeEncoder : zapcore .RFC3339TimeEncoder ,
43+ }
44+ ctrl .SetLogger (zap .New (zap .UseFlagOptions (& opts )))
45+
3646 // Deferred calls are not executed on os.Exit from TestMain.
3747 // As a workaround, we call another function in which we can add deferred calls.
3848 // http://blog.englund.nu/golang,/testing/2017/03/12/using-defer-in-testmain.html
You can’t perform that action at this time.
0 commit comments