diff --git a/pkg/testmachinery/collector/collector_test.go b/pkg/testmachinery/collector/collector_test.go index 5812ee2077..e6ddbcedf9 100644 --- a/pkg/testmachinery/collector/collector_test.go +++ b/pkg/testmachinery/collector/collector_test.go @@ -22,9 +22,9 @@ import ( "os" "path/filepath" + "github.com/go-logr/logr" "github.com/golang/mock/gomock" "k8s.io/apimachinery/pkg/util/json" - "sigs.k8s.io/controller-runtime/pkg/log" "github.com/gardener/test-infra/pkg/apis/config" "github.com/gardener/test-infra/pkg/testmachinery" @@ -61,7 +61,7 @@ var _ = Describe("collector summary", func() { esClient = mock_elasticsearch.NewMockClient(esCtrl) s3Client = mock_collector.NewMockClient(s3Ctrl) c = &collector{ - log: log.NullLogger{}, + log: logr.Discard(), esClient: esClient, s3Client: s3Client, s3Config: &config.S3{BucketName: "testbucket"}, diff --git a/pkg/testmachinery/collector/exports_test.go b/pkg/testmachinery/collector/exports_test.go index ac27a995b4..f9ee42c1e4 100644 --- a/pkg/testmachinery/collector/exports_test.go +++ b/pkg/testmachinery/collector/exports_test.go @@ -21,9 +21,9 @@ import ( "os" "path/filepath" + "github.com/go-logr/logr" "github.com/golang/mock/gomock" "k8s.io/apimachinery/pkg/util/json" - "sigs.k8s.io/controller-runtime/pkg/log" "github.com/gardener/test-infra/pkg/apis/config" "github.com/gardener/test-infra/pkg/testmachinery" @@ -56,7 +56,7 @@ var _ = Describe("collector summary", func() { esClient = mock_elasticsearch.NewMockClient(esCtrl) s3Client = mock_collector.NewMockClient(s3Ctrl) c = &collector{ - log: log.NullLogger{}, + log: logr.Discard(), esClient: esClient, s3Client: s3Client, s3Config: &config.S3{BucketName: "testbucket"}, diff --git a/pkg/testmachinery/collector/summary_test.go b/pkg/testmachinery/collector/summary_test.go index 5d5835da7a..d3a2cb0494 100644 --- a/pkg/testmachinery/collector/summary_test.go +++ b/pkg/testmachinery/collector/summary_test.go @@ -15,8 +15,8 @@ package collector import ( + "github.com/go-logr/logr" "github.com/onsi/ginkgo" - "sigs.k8s.io/controller-runtime/pkg/log" "github.com/gardener/test-infra/pkg/apis/testmachinery/v1beta1" "github.com/gardener/test-infra/pkg/testmachinery/metadata" @@ -33,7 +33,7 @@ var _ = Describe("output generation tests", func() { ginkgo.BeforeEach(func() { c = &collector{ - log: log.NullLogger{}, + log: logr.Discard(), } }) diff --git a/pkg/testmachinery/controller/reconciler/resume_test.go b/pkg/testmachinery/controller/reconciler/resume_test.go index 3e437ee0e5..103aa45b34 100644 --- a/pkg/testmachinery/controller/reconciler/resume_test.go +++ b/pkg/testmachinery/controller/reconciler/resume_test.go @@ -18,10 +18,10 @@ import ( "time" argov1 "github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1" + "github.com/go-logr/logr" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "sigs.k8s.io/controller-runtime/pkg/log" tmv1beta1 "github.com/gardener/test-infra/pkg/apis/testmachinery/v1beta1" "github.com/gardener/test-infra/pkg/testmachinery" @@ -31,7 +31,7 @@ var _ = Describe("Testmachinery controller resume", func() { BeforeEach(func() { reconciler = &TestmachineryReconciler{ - Logger: log.NullLogger{}, + Logger: logr.Discard(), timers: make(map[string]*time.Timer), } }) diff --git a/pkg/testmachinery/controller/reconciler/update_test.go b/pkg/testmachinery/controller/reconciler/update_test.go index 2388c05e2b..a44d2eed02 100644 --- a/pkg/testmachinery/controller/reconciler/update_test.go +++ b/pkg/testmachinery/controller/reconciler/update_test.go @@ -19,9 +19,9 @@ import ( "time" argov1 "github.com/argoproj/argo-workflows/v3/pkg/apis/workflow/v1alpha1" + "github.com/go-logr/logr" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - "sigs.k8s.io/controller-runtime/pkg/log" tmv1beta1 "github.com/gardener/test-infra/pkg/apis/testmachinery/v1beta1" ) @@ -74,7 +74,7 @@ var _ = Describe("Testmachinery controller update", func() { BeforeEach(func() { reconciler = &TestmachineryReconciler{ - Logger: log.NullLogger{}, + Logger: logr.Discard(), timers: make(map[string]*time.Timer), } }) diff --git a/pkg/testmachinery/controller/watch/cache_test.go b/pkg/testmachinery/controller/watch/cache_test.go index 6d19b0dab8..f81c252e09 100644 --- a/pkg/testmachinery/controller/watch/cache_test.go +++ b/pkg/testmachinery/controller/watch/cache_test.go @@ -22,10 +22,10 @@ import ( "sync" "time" + "github.com/go-logr/logr" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "sigs.k8s.io/controller-runtime/pkg/log" tmv1beta1 "github.com/gardener/test-infra/pkg/apis/testmachinery/v1beta1" "github.com/gardener/test-infra/pkg/testmachinery/controller/watch" @@ -58,7 +58,7 @@ var _ = Describe("Watch Cache Informer", func() { Expect(err).ToNot(HaveOccurred()) wg = sync.WaitGroup{} - w, err = watch.New(log.NullLogger{}, restConfig, opts) + w, err = watch.New(logr.Discard(), restConfig, opts) Expect(err).ToNot(HaveOccurred()) wg.Add(1) go func() { diff --git a/pkg/testmachinery/controller/watch/polling_test.go b/pkg/testmachinery/controller/watch/polling_test.go index a0ca875ce5..e330864d15 100644 --- a/pkg/testmachinery/controller/watch/polling_test.go +++ b/pkg/testmachinery/controller/watch/polling_test.go @@ -21,10 +21,10 @@ import ( "strconv" "time" + "github.com/go-logr/logr" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "sigs.k8s.io/controller-runtime/pkg/log" tmv1beta1 "github.com/gardener/test-infra/pkg/apis/testmachinery/v1beta1" "github.com/gardener/test-infra/pkg/testmachinery/controller/watch" @@ -63,7 +63,7 @@ var _ = Describe("Watch Polling Informer", func() { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - w, err := watch.New(log.NullLogger{}, restConfig, options) + w, err := watch.New(logr.Discard(), restConfig, options) Expect(err).ToNot(HaveOccurred()) go func() { err := w.Start(ctx) @@ -82,7 +82,7 @@ var _ = Describe("Watch Polling Informer", func() { It("watch should reconcile once", func() { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - w, err := watch.New(log.NullLogger{}, restConfig, options) + w, err := watch.New(logr.Discard(), restConfig, options) Expect(err).ToNot(HaveOccurred()) go func() { @@ -116,7 +116,7 @@ var _ = Describe("Watch Polling Informer", func() { It("watch should reconcile until the latest update was received", func() { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - w, err := watch.New(log.NullLogger{}, restConfig, options) + w, err := watch.New(logr.Discard(), restConfig, options) Expect(err).ToNot(HaveOccurred()) go func() { err := w.Start(ctx) @@ -153,7 +153,7 @@ var _ = Describe("Watch Polling Informer", func() { It("watch should return an error if the watch function returns an error", func() { ctx, cancel := context.WithCancel(context.Background()) defer cancel() - w, err := watch.New(log.NullLogger{}, restConfig, options) + w, err := watch.New(logr.Discard(), restConfig, options) Expect(err).ToNot(HaveOccurred()) go func() { err := w.Start(ctx) diff --git a/pkg/testrunner/componentdescriptor/componentdescriptor_test.go b/pkg/testrunner/componentdescriptor/componentdescriptor_test.go index 82a01a6fed..b515fb6128 100644 --- a/pkg/testrunner/componentdescriptor/componentdescriptor_test.go +++ b/pkg/testrunner/componentdescriptor/componentdescriptor_test.go @@ -21,10 +21,10 @@ import ( mock_ociclient "github.com/gardener/component-cli/ociclient/mock" "github.com/gardener/component-cli/pkg/commands/constants" + "github.com/go-logr/logr" "github.com/golang/mock/gomock" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - "sigs.k8s.io/controller-runtime/pkg/log" ) func TestConfig(t *testing.T) { @@ -58,7 +58,7 @@ var _ = Describe("componentdescriptor test", func() { Expect(os.Setenv(constants.ComponentRepositoryCacheDirEnvVar, "./testdata")).To(Succeed()) defer os.Unsetenv(constants.ComponentRepositoryCacheDirEnvVar) - dependencies, err := GetComponents(ctx, log.NullLogger{}, mockOCIClient, input) + dependencies, err := GetComponents(ctx, logr.Discard(), mockOCIClient, input) Expect(err).ToNot(HaveOccurred()) Expect(len(dependencies)).To(Equal(2)) @@ -73,7 +73,7 @@ var _ = Describe("componentdescriptor test", func() { Expect(os.Remove("./testdata/registry.example/github.com/gardener/gardener-0.18.0")).To(Succeed()) }() - dependencies, err := GetComponents(ctx, log.NullLogger{}, mockOCIClient, input) + dependencies, err := GetComponents(ctx, logr.Discard(), mockOCIClient, input) Expect(err).ToNot(HaveOccurred()) Expect(len(dependencies)).To(Equal(2)) @@ -98,7 +98,7 @@ var _ = Describe("componentdescriptor test", func() { }, } - dependencies, err := GetComponents(ctx, log.NullLogger{}, mockOCIClient, input) + dependencies, err := GetComponents(ctx, logr.Discard(), mockOCIClient, input) Expect(err).ToNot(HaveOccurred()) Expect(len(dependencies)).To(Equal(3), "There should be 3 dependencies") diff --git a/pkg/testrunner/componentdescriptor/testdata/registry.example/example.com/repo1-0.17.0 b/pkg/testrunner/componentdescriptor/testdata/registry.example/example.com/repo1-0.17.0 index fab635077b..4222345c99 100644 --- a/pkg/testrunner/componentdescriptor/testdata/registry.example/example.com/repo1-0.17.0 +++ b/pkg/testrunner/componentdescriptor/testdata/registry.example/example.com/repo1-0.17.0 @@ -1,20 +1 @@ -meta: - schemaVersion: 'v2' - -component: - name: 'example.com/repo1' - version: '0.17.0' - - repositoryContexts: - - type: 'ociRegistry' - baseUrl: 'registry.example' - provider: 'internal' - sources: [] - resources: [] - componentReferences: - - name: 'repo2' - componentName: 'example.com/repo2' - version: '1.27.0' - - name: 'repo3' - componentName: 'example.com/repo3' - version: '1.30.0' +{"meta":{"schemaVersion":"v2"},"component":{"name":"example.com/repo1","version":"0.17.0","repositoryContexts":[{"baseUrl":"registry.example","type":"ociRegistry"}],"provider":"internal","sources":[],"componentReferences":[{"name":"repo2","componentName":"example.com/repo2","version":"1.27.0"},{"name":"repo3","componentName":"example.com/repo3","version":"1.30.0"}],"resources":[]}} \ No newline at end of file diff --git a/pkg/testrunner/componentdescriptor/testdata/registry.example/github.com/gardener/gardener-0.17.0 b/pkg/testrunner/componentdescriptor/testdata/registry.example/github.com/gardener/gardener-0.17.0 index 6bc4e4531c..5319406ba5 100644 --- a/pkg/testrunner/componentdescriptor/testdata/registry.example/github.com/gardener/gardener-0.17.0 +++ b/pkg/testrunner/componentdescriptor/testdata/registry.example/github.com/gardener/gardener-0.17.0 @@ -1,17 +1 @@ -meta: - schemaVersion: 'v2' - -component: - name: 'github.com/gardener/gardener' - version: '0.17.0' - - repositoryContexts: - - type: 'ociRegistry' - baseUrl: 'registry.example' - provider: 'internal' - sources: [] - resources: [] - componentReferences: - - name: 'dashboard' - componentName: 'github.com/gardener/dashboard' - version: '1.27.0' +{"meta":{"schemaVersion":"v2"},"component":{"name":"github.com/gardener/gardener","version":"0.17.0","repositoryContexts":[{"baseUrl":"registry.example","type":"ociRegistry"}],"provider":"internal","sources":[],"componentReferences":[{"name":"dashboard","componentName":"github.com/gardener/dashboard","version":"1.27.0"}],"resources":[]}} \ No newline at end of file diff --git a/pkg/testrunner/execution_test.go b/pkg/testrunner/execution_test.go index 124de4e366..a1d98e41d1 100644 --- a/pkg/testrunner/execution_test.go +++ b/pkg/testrunner/execution_test.go @@ -18,9 +18,9 @@ import ( "math" "time" + "github.com/go-logr/logr" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - "sigs.k8s.io/controller-runtime/pkg/log" "github.com/gardener/test-infra/pkg/testrunner" ) @@ -30,7 +30,7 @@ var _ = Describe("Executor tests", func() { Context("basic", func() { It("should run a set of functions in serial without backoff", func() { executions := [3]*execution{} - executor, err := testrunner.NewExecutor(log.NullLogger{}, testrunner.ExecutorConfig{ + executor, err := testrunner.NewExecutor(logr.Discard(), testrunner.ExecutorConfig{ Serial: true, }) Expect(err).ToNot(HaveOccurred()) @@ -59,7 +59,7 @@ var _ = Describe("Executor tests", func() { It("should run all functions in parallel", func() { executions := [3]*execution{} - executor, err := testrunner.NewExecutor(log.NullLogger{}, testrunner.ExecutorConfig{}) + executor, err := testrunner.NewExecutor(logr.Discard(), testrunner.ExecutorConfig{}) Expect(err).ToNot(HaveOccurred()) for i := 0; i < 3; i++ { @@ -85,7 +85,7 @@ var _ = Describe("Executor tests", func() { It("should run 3 functions in serial with a backoff", func() { executions := [3]*execution{} - executor, err := testrunner.NewExecutor(log.NullLogger{}, testrunner.ExecutorConfig{ + executor, err := testrunner.NewExecutor(logr.Discard(), testrunner.ExecutorConfig{ Serial: true, BackoffBucket: 1, BackoffPeriod: 2 * time.Second, @@ -113,7 +113,7 @@ var _ = Describe("Executor tests", func() { }, 10) It("should run 1 function in serial", func() { - executor, err := testrunner.NewExecutor(log.NullLogger{}, testrunner.ExecutorConfig{ + executor, err := testrunner.NewExecutor(logr.Discard(), testrunner.ExecutorConfig{ Serial: true, }) Expect(err).ToNot(HaveOccurred()) @@ -131,7 +131,7 @@ var _ = Describe("Executor tests", func() { It("should run 3 functions in serial", func() { executions := [3]*execution{} - executor, err := testrunner.NewExecutor(log.NullLogger{}, testrunner.ExecutorConfig{ + executor, err := testrunner.NewExecutor(logr.Discard(), testrunner.ExecutorConfig{ Serial: true, }) Expect(err).ToNot(HaveOccurred()) @@ -159,7 +159,7 @@ var _ = Describe("Executor tests", func() { It("should run 6 functions in parallel with a backoff in a bucket of 2", func() { executions := [6]*execution{} - executor, err := testrunner.NewExecutor(log.NullLogger{}, testrunner.ExecutorConfig{ + executor, err := testrunner.NewExecutor(logr.Discard(), testrunner.ExecutorConfig{ Serial: false, BackoffBucket: 2, BackoffPeriod: 2 * time.Second, @@ -188,7 +188,7 @@ var _ = Describe("Executor tests", func() { It("should run 6 functions in serial with a backoff in a bucket of 2", func() { executions := [6]*execution{} - executor, err := testrunner.NewExecutor(log.NullLogger{}, testrunner.ExecutorConfig{ + executor, err := testrunner.NewExecutor(logr.Discard(), testrunner.ExecutorConfig{ Serial: true, BackoffBucket: 2, BackoffPeriod: 2 * time.Second, @@ -218,7 +218,7 @@ var _ = Describe("Executor tests", func() { It("should add another test during execution", func() { executions := [3]*execution{} - executor, err := testrunner.NewExecutor(log.NullLogger{}, testrunner.ExecutorConfig{ + executor, err := testrunner.NewExecutor(logr.Discard(), testrunner.ExecutorConfig{ Serial: true, }) Expect(err).ToNot(HaveOccurred()) @@ -249,7 +249,7 @@ var _ = Describe("Executor tests", func() { It("should add another test during execution in parallel steps", func() { executions := [3]*execution{} - executor, err := testrunner.NewExecutor(log.NullLogger{}, testrunner.ExecutorConfig{}) + executor, err := testrunner.NewExecutor(logr.Discard(), testrunner.ExecutorConfig{}) Expect(err).ToNot(HaveOccurred()) addExecution := newExecution(4) @@ -277,7 +277,7 @@ var _ = Describe("Executor tests", func() { It("should add another test during execution in parallel steps that start immediately", func() { executions := [3]*execution{} - executor, err := testrunner.NewExecutor(log.NullLogger{}, testrunner.ExecutorConfig{}) + executor, err := testrunner.NewExecutor(logr.Discard(), testrunner.ExecutorConfig{}) Expect(err).ToNot(HaveOccurred()) addExecution := newExecution(4) @@ -308,7 +308,7 @@ var _ = Describe("Executor tests", func() { It("should add same test during execution in parallel steps", func() { executions := [3]*execution{} - executor, err := testrunner.NewExecutor(log.NullLogger{}, testrunner.ExecutorConfig{}) + executor, err := testrunner.NewExecutor(logr.Discard(), testrunner.ExecutorConfig{}) Expect(err).ToNot(HaveOccurred()) for i := 0; i < 3; i++ { diff --git a/pkg/testrunner/template/shoot_template_test.go b/pkg/testrunner/template/shoot_template_test.go index 6e7c517b2f..74ced69f3d 100644 --- a/pkg/testrunner/template/shoot_template_test.go +++ b/pkg/testrunner/template/shoot_template_test.go @@ -20,6 +20,7 @@ import ( ociopts "github.com/gardener/component-cli/ociclient/options" gardencorev1beta1 "github.com/gardener/gardener/pkg/apis/core/v1beta1" + "github.com/go-logr/logr" "k8s.io/utils/pointer" "github.com/gardener/test-infra/pkg/apis/testmachinery/v1beta1" @@ -27,7 +28,6 @@ import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - "sigs.k8s.io/controller-runtime/pkg/log" "github.com/gardener/test-infra/pkg/common" ) @@ -80,7 +80,7 @@ var _ = Describe("shoot templates", func() { OCIOpts: &ociopts.Options{}, } - runs, err := RenderTestruns(ctx, log.NullLogger{}, params, shoots) + runs, err := RenderTestruns(ctx, logr.Discard(), params, shoots) Expect(err).ToNot(HaveOccurred()) Expect(runs.GetTestruns()).To(HaveLen(1)) tr := runs[0].Testrun @@ -113,7 +113,7 @@ var _ = Describe("shoot templates", func() { Landscape: "test", } - runs, err := RenderTestruns(ctx, log.NullLogger{}, params, shoots) + runs, err := RenderTestruns(ctx, logr.Discard(), params, shoots) Expect(err).ToNot(HaveOccurred()) Expect(runs.GetTestruns()).To(HaveLen(1)) meta := runs[0].Metadata @@ -164,7 +164,7 @@ var _ = Describe("shoot templates", func() { }, }), } - runs, err := RenderTestruns(ctx, log.NullLogger{}, params, shoots) + runs, err := RenderTestruns(ctx, logr.Discard(), params, shoots) Expect(err).ToNot(HaveOccurred()) Expect(runs.GetTestruns()).To(HaveLen(1)) tr := runs[0].Testrun @@ -202,7 +202,7 @@ var _ = Describe("shoot templates", func() { }, }, })) - runs, err := RenderTestruns(ctx, log.NullLogger{}, params, shoots) + runs, err := RenderTestruns(ctx, logr.Discard(), params, shoots) Expect(err).ToNot(HaveOccurred()) Expect(runs.GetTestruns()).To(HaveLen(2)) }) @@ -218,7 +218,7 @@ var _ = Describe("shoot templates", func() { OCIOpts: &ociopts.Options{}, } - runs, err := RenderTestruns(ctx, log.NullLogger{}, params, shoots) + runs, err := RenderTestruns(ctx, logr.Discard(), params, shoots) Expect(err).ToNot(HaveOccurred()) Expect(runs.GetTestruns()).To(HaveLen(2)) }) @@ -250,7 +250,7 @@ var _ = Describe("shoot templates", func() { }, }, })) - runs, err := RenderTestruns(ctx, log.NullLogger{}, params, shoots) + runs, err := RenderTestruns(ctx, logr.Discard(), params, shoots) Expect(err).ToNot(HaveOccurred()) Expect(runs.GetTestruns()).To(HaveLen(3)) }) @@ -265,7 +265,7 @@ var _ = Describe("shoot templates", func() { OCIOpts: &ociopts.Options{}, } - runs, err := RenderTestruns(ctx, log.NullLogger{}, params, shoots) + runs, err := RenderTestruns(ctx, logr.Discard(), params, shoots) Expect(err).ToNot(HaveOccurred()) Expect(runs.GetTestruns()).To(HaveLen(1)) tr := runs[0].Testrun diff --git a/pkg/testrunner/template/template_test.go b/pkg/testrunner/template/template_test.go index c82eed3711..8b2ef0ab93 100644 --- a/pkg/testrunner/template/template_test.go +++ b/pkg/testrunner/template/template_test.go @@ -19,9 +19,9 @@ import ( "path/filepath" ociopts "github.com/gardener/component-cli/ociclient/options" + "github.com/go-logr/logr" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" - "sigs.k8s.io/controller-runtime/pkg/log" "github.com/gardener/test-infra/pkg/testrunner/componentdescriptor" ) @@ -47,7 +47,7 @@ var _ = Describe("default templates", func() { ComponentDescriptorPath: componentDescriptorPath, OCIOpts: &ociopts.Options{}, } - runs, err := RenderTestruns(ctx, log.NullLogger{}, params, nil) + runs, err := RenderTestruns(ctx, logr.Discard(), params, nil) Expect(err).ToNot(HaveOccurred()) Expect(runs.GetTestruns()).To(HaveLen(1)) }) @@ -60,7 +60,7 @@ var _ = Describe("default templates", func() { OCIOpts: &ociopts.Options{}, SetValues: []string{"addValue1=test,addValue2=test2"}, } - _, err := RenderTestruns(ctx, log.NullLogger{}, params, nil) + _, err := RenderTestruns(ctx, logr.Discard(), params, nil) Expect(err).ToNot(HaveOccurred()) }) @@ -72,7 +72,7 @@ var _ = Describe("default templates", func() { OCIOpts: &ociopts.Options{}, SetValues: []string{"addValue1=test", "addValue2=test2"}, } - _, err := RenderTestruns(ctx, log.NullLogger{}, params, nil) + _, err := RenderTestruns(ctx, logr.Discard(), params, nil) Expect(err).ToNot(HaveOccurred()) }) @@ -84,7 +84,7 @@ var _ = Describe("default templates", func() { ComponentDescriptorPath: componentDescriptorPath, OCIOpts: &ociopts.Options{}, } - runs, err := RenderTestruns(ctx, log.NullLogger{}, params, nil) + runs, err := RenderTestruns(ctx, logr.Discard(), params, nil) Expect(err).ToNot(HaveOccurred()) Expect(runs.GetTestruns()).To(HaveLen(1)) diff --git a/pkg/testrunner/template/testdata/registry.example/github.com/gardener/gardener-0.30.0 b/pkg/testrunner/template/testdata/registry.example/github.com/gardener/gardener-0.30.0 index 8290b02e37..04b24dc86d 100644 --- a/pkg/testrunner/template/testdata/registry.example/github.com/gardener/gardener-0.30.0 +++ b/pkg/testrunner/template/testdata/registry.example/github.com/gardener/gardener-0.30.0 @@ -1,14 +1 @@ -meta: - schemaVersion: 'v2' - -component: - name: 'github.com/gardener/gardener' - version: '0.30.0' - - repositoryContexts: - - type: 'ociRegistry' - baseUrl: 'registry.example' - provider: 'internal' - sources: [] - resources: [] - componentReferences: [] +{"meta":{"schemaVersion":"v2"},"component":{"name":"github.com/gardener/gardener","version":"0.30.0","repositoryContexts":[{"baseUrl":"registry.example","type":"ociRegistry"}],"provider":"internal","sources":[],"componentReferences":[],"resources":[]}} \ No newline at end of file diff --git a/pkg/tm-bot/plugins/plugins_test.go b/pkg/tm-bot/plugins/plugins_test.go index 360614cb66..5555cf95e7 100644 --- a/pkg/tm-bot/plugins/plugins_test.go +++ b/pkg/tm-bot/plugins/plugins_test.go @@ -15,11 +15,11 @@ package plugins_test import ( + "github.com/go-logr/logr" "github.com/golang/mock/gomock" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "github.com/spf13/pflag" - "sigs.k8s.io/controller-runtime/pkg/log" "github.com/gardener/test-infra/pkg/tm-bot/github" mock_github "github.com/gardener/test-infra/pkg/tm-bot/github/mocks" @@ -62,7 +62,7 @@ var _ = Describe("plugins", func() { It("should register a plugin and retrieve it", func() { mockPlugin.EXPECT().Command().Return("test").AnyTimes() mockPlugin.EXPECT().New(gomock.Any()).Return(mockPlugin).Times(1) - p := plugins.New(&log.NullLogger{}, mockPersistence) + p := plugins.New(logr.Discard(), mockPersistence) p.Register(mockPlugin) @@ -72,7 +72,7 @@ var _ = Describe("plugins", func() { }) It("should throw an error if a plugin is not defined", func() { - p := plugins.New(&log.NullLogger{}, mockPersistence) + p := plugins.New(logr.Discard(), mockPersistence) _, _, err := p.Get("test") Expect(err).To(HaveOccurred()) }) @@ -93,7 +93,7 @@ var _ = Describe("plugins", func() { mockPlugin.EXPECT().Authorization().Return(github.AuthorizationAll).Times(1) mockPlugin.EXPECT().Run(gomock.Any(), mockGHClient, event).Return(nil).Times(1) - p := plugins.New(&log.NullLogger{}, mockPersistence) + p := plugins.New(logr.Discard(), mockPersistence) p.Register(mockPlugin) err := p.HandleRequest(mockGHClient, event) @@ -128,7 +128,7 @@ var _ = Describe("plugins", func() { mockGHMgr.EXPECT().GetClient(event).Return(mockGHClient, nil).Times(1) - p := plugins.New(&log.NullLogger{}, mockPersistence) + p := plugins.New(logr.Discard(), mockPersistence) p.Register(mockPlugin) err := p.ResumePlugins(mockGHMgr) diff --git a/pkg/util/elasticsearch/bulk/es_bulk_suite_test.go b/pkg/util/elasticsearch/bulk/es_bulk_suite_test.go index eddd65708d..fe7eef160b 100644 --- a/pkg/util/elasticsearch/bulk/es_bulk_suite_test.go +++ b/pkg/util/elasticsearch/bulk/es_bulk_suite_test.go @@ -23,8 +23,7 @@ import ( "reflect" "testing" - "sigs.k8s.io/controller-runtime/pkg/log" - + "github.com/go-logr/logr" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) @@ -50,7 +49,7 @@ var _ = Describe("elasticsearch test", func() { output, err := ioutil.ReadFile("./testdata/json_output") Expect(err).ToNot(HaveOccurred(), "Cannot read json file from ./testdata/json_output") - bulks := ParseExportedFiles(log.NullLogger{}, "TestDef", tmMeta, input) + bulks := ParseExportedFiles(logr.Discard(), "TestDef", tmMeta, input) bulkFile, err := bulks.Marshal() Expect(err).ToNot(HaveOccurred()) @@ -68,7 +67,7 @@ var _ = Describe("elasticsearch test", func() { output, err := ioutil.ReadFile("./testdata/bulk_with_meta_output") Expect(err).ToNot(HaveOccurred(), "Cannot read json file from ./testdata/bulk_with_meta_output") - bulks := ParseExportedFiles(log.NullLogger{}, "TestDef", tmMeta, input) + bulks := ParseExportedFiles(logr.Discard(), "TestDef", tmMeta, input) bulkFile, err := bulks.Marshal() Expect(err).ToNot(HaveOccurred()) @@ -84,7 +83,7 @@ var _ = Describe("elasticsearch test", func() { output, err := ioutil.ReadFile("./testdata/bulk_no_meta_output") Expect(err).ToNot(HaveOccurred(), "Cannot read json file from ./testdata/bulk_no_meta_output") - bulks := ParseExportedFiles(log.NullLogger{}, "TestDef", tmMeta, input) + bulks := ParseExportedFiles(logr.Discard(), "TestDef", tmMeta, input) bulkFile, err := bulks.Marshal() Expect(err).ToNot(HaveOccurred()) @@ -97,7 +96,7 @@ var _ = Describe("elasticsearch test", func() { input, err := ioutil.ReadFile("./testdata/large_bulk") Expect(err).ToNot(HaveOccurred(), "Cannot read json file from ./testdata/bulk_with_meta") - bulks := ParseExportedFiles(log.NullLogger{}, "TestDef", tmMeta, input) + bulks := ParseExportedFiles(logr.Discard(), "TestDef", tmMeta, input) Expect(len(bulks) != 0).To(BeTrue(), "Expect bulks to not be emtpy") _, err = bulks[0].Marshal()