From beb43d9b7564be3161f8cda2e7edd1d613f5a7e4 Mon Sep 17 00:00:00 2001 From: acumino Date: Thu, 3 Mar 2022 14:01:31 +0530 Subject: [PATCH] Adpat custom reporter chnages --- go.sum | 4 +- pkg/builder/builder_suite_test.go | 4 +- pkg/builder/controller_test.go | 1 - pkg/cache/cache_suite_test.go | 4 +- pkg/cache/internal/internal_suite_test.go | 4 +- pkg/certwatcher/certwatcher_suite_test.go | 4 +- pkg/client/apiutil/apiutil_suite_test.go | 4 +- pkg/client/client_suite_test.go | 4 +- pkg/client/config/config_suite_test.go | 4 +- pkg/client/fake/client_suite_test.go | 4 +- pkg/cluster/cluster_suite_test.go | 4 +- pkg/config/config_suite_test.go | 4 +- pkg/controller/controller_suite_test.go | 4 +- .../controllerutil_suite_test.go | 4 +- pkg/envtest/envtest_suite_test.go | 4 +- pkg/envtest/ginkgo_test.go | 27 ------- pkg/envtest/printer/ginkgo.go | 52 -------------- pkg/envtest/printer/prow.go | 71 ++----------------- pkg/finalizer/finalizer_test.go | 4 +- pkg/handler/eventhandler_suite_test.go | 4 +- pkg/healthz/healthz_suite_test.go | 4 +- .../controller/controller_suite_test.go | 4 +- pkg/internal/recorder/recorder_suite_test.go | 4 +- pkg/internal/testing/addr/addr_suite_test.go | 4 +- .../testing/certs/certs_suite_test.go | 4 +- .../controlplane/controlplane_suite_test.go | 4 +- .../testing/process/process_suite_test.go | 4 +- pkg/log/log_suite_test.go | 4 +- pkg/log/zap/zap_suite_test.go | 4 +- pkg/manager/manager_suite_test.go | 4 +- pkg/manager/signals/signals_suite_test.go | 4 +- pkg/predicate/predicate_suite_test.go | 4 +- pkg/reconcile/reconcile_suite_test.go | 4 +- pkg/runtime/inject/inject_suite_test.go | 4 +- pkg/scheme/scheme_suite_test.go | 4 +- pkg/source/internal/internal_suite_test.go | 4 +- pkg/source/source_suite_test.go | 4 +- pkg/webhook/admission/admission_suite_test.go | 4 +- .../authentication_suite_test.go | 4 +- .../conversion/conversion_suite_test.go | 4 +- pkg/webhook/webhook_suite_test.go | 4 +- 41 files changed, 44 insertions(+), 255 deletions(-) delete mode 100644 pkg/envtest/ginkgo_test.go delete mode 100644 pkg/envtest/printer/ginkgo.go diff --git a/go.sum b/go.sum index bbc348ef7e..661d6461ee 100644 --- a/go.sum +++ b/go.sum @@ -354,15 +354,13 @@ github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9k github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= -github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/ginkgo/v2 v2.1.1 h1:LCnPB85AvFNr91s0B2aDzEiiIg6MUwLYbryC1NSlWi8= github.com/onsi/ginkgo/v2 v2.1.1/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.17.0 h1:9Luw4uT5HTjHTN8+aNcSThgH1vdXnmdJ8xIfZ4wyTRE= github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= -github.com/onsi/gomega v1.18.0 h1:ngbYoRctxjl8SiF7XgP0NxBFbfHcg3wfHMMaFHWwMTM= -github.com/onsi/gomega v1.18.0/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= diff --git a/pkg/builder/builder_suite_test.go b/pkg/builder/builder_suite_test.go index 6e861afcb4..a3a25a8798 100644 --- a/pkg/builder/builder_suite_test.go +++ b/pkg/builder/builder_suite_test.go @@ -20,7 +20,6 @@ import ( "testing" . "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "k8s.io/apimachinery/pkg/api/meta" @@ -78,8 +77,7 @@ var _ = AfterSuite(func() { }) var _ = ReportAfterSuite("Report to Prow", func(report Report) { - reporters.ReportViaDeprecatedReporter(printer.NewlineReporter{}, report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 - reporters.ReportViaDeprecatedReporter(printer.NewProwReporter(suiteName), report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 + printer.AddReport(report, suiteName) }) func addCRDToEnvironment(env *envtest.Environment, gvks ...schema.GroupVersionKind) { diff --git a/pkg/builder/controller_test.go b/pkg/builder/controller_test.go index 5ca4de13bb..10cad368ec 100644 --- a/pkg/builder/controller_test.go +++ b/pkg/builder/controller_test.go @@ -550,7 +550,6 @@ func doReconcileTest(ctx context.Context, nameSuffix string, mgr manager.Manager go func() { defer GinkgoRecover() Expect(mgr.Start(ctx)).NotTo(HaveOccurred()) - By("Stopping the application") }() By("Creating a Deployment") diff --git a/pkg/cache/cache_suite_test.go b/pkg/cache/cache_suite_test.go index 1c41593040..2c5b1f7f6c 100644 --- a/pkg/cache/cache_suite_test.go +++ b/pkg/cache/cache_suite_test.go @@ -20,7 +20,6 @@ import ( "testing" . "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" @@ -59,6 +58,5 @@ var _ = AfterSuite(func() { }) var _ = ReportAfterSuite("Report to Prow", func(report Report) { - reporters.ReportViaDeprecatedReporter(printer.NewlineReporter{}, report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 - reporters.ReportViaDeprecatedReporter(printer.NewProwReporter(suiteName), report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 + printer.AddReport(report, suiteName) }) diff --git a/pkg/cache/internal/internal_suite_test.go b/pkg/cache/internal/internal_suite_test.go index 3f3af9d820..56cfe2cb80 100644 --- a/pkg/cache/internal/internal_suite_test.go +++ b/pkg/cache/internal/internal_suite_test.go @@ -20,7 +20,6 @@ import ( "testing" . "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" ) @@ -33,6 +32,5 @@ func TestSource(t *testing.T) { } var _ = ReportAfterSuite("Report to Prow", func(report Report) { - reporters.ReportViaDeprecatedReporter(printer.NewlineReporter{}, report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 - reporters.ReportViaDeprecatedReporter(printer.NewProwReporter(suiteName), report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 + printer.AddReport(report, suiteName) }) diff --git a/pkg/certwatcher/certwatcher_suite_test.go b/pkg/certwatcher/certwatcher_suite_test.go index 4da29ba64e..e74ebb0e2a 100644 --- a/pkg/certwatcher/certwatcher_suite_test.go +++ b/pkg/certwatcher/certwatcher_suite_test.go @@ -21,7 +21,6 @@ import ( "testing" . "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" logf "sigs.k8s.io/controller-runtime/pkg/log" @@ -50,6 +49,5 @@ var _ = AfterSuite(func() { }) var _ = ReportAfterSuite("Report to Prow", func(report Report) { - reporters.ReportViaDeprecatedReporter(printer.NewlineReporter{}, report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 - reporters.ReportViaDeprecatedReporter(printer.NewProwReporter(suiteName), report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 + printer.AddReport(report, suiteName) }) diff --git a/pkg/client/apiutil/apiutil_suite_test.go b/pkg/client/apiutil/apiutil_suite_test.go index 1619c0417b..0094d3b1b8 100644 --- a/pkg/client/apiutil/apiutil_suite_test.go +++ b/pkg/client/apiutil/apiutil_suite_test.go @@ -20,7 +20,6 @@ import ( "testing" . "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" "k8s.io/client-go/rest" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" @@ -46,6 +45,5 @@ var _ = BeforeSuite(func() { }) var _ = ReportAfterSuite("Report to Prow", func(report Report) { - reporters.ReportViaDeprecatedReporter(printer.NewlineReporter{}, report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 - reporters.ReportViaDeprecatedReporter(printer.NewProwReporter(suiteName), report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 + printer.AddReport(report, suiteName) }) diff --git a/pkg/client/client_suite_test.go b/pkg/client/client_suite_test.go index 3e5acc4a07..b229c68c56 100644 --- a/pkg/client/client_suite_test.go +++ b/pkg/client/client_suite_test.go @@ -20,7 +20,6 @@ import ( "testing" . "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" "k8s.io/client-go/kubernetes" "k8s.io/client-go/kubernetes/scheme" @@ -64,6 +63,5 @@ var _ = AfterSuite(func() { }) var _ = ReportAfterSuite("Report to Prow", func(report Report) { - reporters.ReportViaDeprecatedReporter(printer.NewlineReporter{}, report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 - reporters.ReportViaDeprecatedReporter(printer.NewProwReporter(suiteName), report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 + printer.AddReport(report, suiteName) }) diff --git a/pkg/client/config/config_suite_test.go b/pkg/client/config/config_suite_test.go index 7a97214a44..1bee02b10d 100644 --- a/pkg/client/config/config_suite_test.go +++ b/pkg/client/config/config_suite_test.go @@ -20,7 +20,6 @@ import ( "testing" . "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" @@ -40,6 +39,5 @@ var _ = BeforeSuite(func() { }) var _ = ReportAfterSuite("Report to Prow", func(report Report) { - reporters.ReportViaDeprecatedReporter(printer.NewlineReporter{}, report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 - reporters.ReportViaDeprecatedReporter(printer.NewProwReporter(suiteName), report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 + printer.AddReport(report, suiteName) }) diff --git a/pkg/client/fake/client_suite_test.go b/pkg/client/fake/client_suite_test.go index d5b42ed413..796b05163d 100644 --- a/pkg/client/fake/client_suite_test.go +++ b/pkg/client/fake/client_suite_test.go @@ -20,7 +20,6 @@ import ( "testing" . "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" @@ -40,6 +39,5 @@ var _ = BeforeSuite(func() { }) var _ = ReportAfterSuite("Report to Prow", func(report Report) { - reporters.ReportViaDeprecatedReporter(printer.NewlineReporter{}, report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 - reporters.ReportViaDeprecatedReporter(printer.NewProwReporter(suiteName), report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 + printer.AddReport(report, suiteName) }) diff --git a/pkg/cluster/cluster_suite_test.go b/pkg/cluster/cluster_suite_test.go index 348b2bd5da..5d204a2d34 100644 --- a/pkg/cluster/cluster_suite_test.go +++ b/pkg/cluster/cluster_suite_test.go @@ -21,7 +21,6 @@ import ( "testing" . "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" @@ -72,6 +71,5 @@ var _ = AfterSuite(func() { }) var _ = ReportAfterSuite("Report to Prow", func(report Report) { - reporters.ReportViaDeprecatedReporter(printer.NewlineReporter{}, report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 - reporters.ReportViaDeprecatedReporter(printer.NewProwReporter(suiteName), report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 + printer.AddReport(report, suiteName) }) diff --git a/pkg/config/config_suite_test.go b/pkg/config/config_suite_test.go index 8b3eda86ae..976d0ba1a9 100644 --- a/pkg/config/config_suite_test.go +++ b/pkg/config/config_suite_test.go @@ -20,7 +20,6 @@ import ( "testing" . "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" @@ -34,6 +33,5 @@ func TestScheme(t *testing.T) { } var _ = ReportAfterSuite("Report to Prow", func(report Report) { - reporters.ReportViaDeprecatedReporter(printer.NewlineReporter{}, report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 - reporters.ReportViaDeprecatedReporter(printer.NewProwReporter(suiteName), report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 + printer.AddReport(report, suiteName) }) diff --git a/pkg/controller/controller_suite_test.go b/pkg/controller/controller_suite_test.go index a76e05bf3c..f810c23f78 100644 --- a/pkg/controller/controller_suite_test.go +++ b/pkg/controller/controller_suite_test.go @@ -21,7 +21,6 @@ import ( "testing" . "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/kubernetes" @@ -94,6 +93,5 @@ var _ = AfterSuite(func() { }) var _ = ReportAfterSuite("Report to Prow", func(report Report) { - reporters.ReportViaDeprecatedReporter(printer.NewlineReporter{}, report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 - reporters.ReportViaDeprecatedReporter(printer.NewProwReporter(suiteName), report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 + printer.AddReport(report, suiteName) }) diff --git a/pkg/controller/controllerutil/controllerutil_suite_test.go b/pkg/controller/controllerutil/controllerutil_suite_test.go index 11da263807..f4ab0448b5 100644 --- a/pkg/controller/controllerutil/controllerutil_suite_test.go +++ b/pkg/controller/controllerutil/controllerutil_suite_test.go @@ -20,7 +20,6 @@ import ( "testing" . "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" "k8s.io/client-go/rest" @@ -57,6 +56,5 @@ var _ = AfterSuite(func() { }) var _ = ReportAfterSuite("Report to Prow", func(report Report) { - reporters.ReportViaDeprecatedReporter(printer.NewlineReporter{}, report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 - reporters.ReportViaDeprecatedReporter(printer.NewProwReporter(suiteName), report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 + printer.AddReport(report, suiteName) }) diff --git a/pkg/envtest/envtest_suite_test.go b/pkg/envtest/envtest_suite_test.go index 278783093c..a6dc7f4567 100644 --- a/pkg/envtest/envtest_suite_test.go +++ b/pkg/envtest/envtest_suite_test.go @@ -20,7 +20,6 @@ import ( "testing" . "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" admissionv1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -138,6 +137,5 @@ var _ = AfterSuite(func() { }) var _ = ReportAfterSuite("Report to Prow", func(report Report) { - reporters.ReportViaDeprecatedReporter(printer.NewlineReporter{}, report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 - reporters.ReportViaDeprecatedReporter(printer.NewProwReporter(suiteName), report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 + printer.AddReport(report, suiteName) }) diff --git a/pkg/envtest/ginkgo_test.go b/pkg/envtest/ginkgo_test.go deleted file mode 100644 index fba031c954..0000000000 --- a/pkg/envtest/ginkgo_test.go +++ /dev/null @@ -1,27 +0,0 @@ -/* -Copyright 2021 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package envtest - -import ( - "sigs.k8s.io/controller-runtime/pkg/envtest/printer" -) - -// NewlineReporter is Reporter that Prints a newline after the default Reporter output so that the results -// are correctly parsed by test automation. -// See issue https://github.com/jstemmer/go-junit-report/issues/31 -// It's re-exported here to avoid compatibility breakage/mass rewrites. -type NewlineReporter = printer.NewlineReporter diff --git a/pkg/envtest/printer/ginkgo.go b/pkg/envtest/printer/ginkgo.go deleted file mode 100644 index 6e2ca7505c..0000000000 --- a/pkg/envtest/printer/ginkgo.go +++ /dev/null @@ -1,52 +0,0 @@ -/* -Copyright 2016 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -// Package printer contains setup for a friendlier Ginkgo printer that's easier -// to parse by test automation. -package printer - -import ( - "fmt" - - "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/config" - "github.com/onsi/ginkgo/v2/types" -) - -var _ ginkgo.Reporter = NewlineReporter{} //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 - -// NewlineReporter is Reporter that Prints a newline after the default Reporter output so that the results -// are correctly parsed by test automation. -// See issue https://github.com/jstemmer/go-junit-report/issues/31 -type NewlineReporter struct{} - -// SuiteWillBegin implements ginkgo.Reporter. -func (NewlineReporter) SuiteWillBegin(config config.GinkgoConfigType, summary *types.SuiteSummary) {} - -// BeforeSuiteDidRun implements ginkgo.Reporter. -func (NewlineReporter) BeforeSuiteDidRun(setupSummary *types.SetupSummary) {} - -// AfterSuiteDidRun implements ginkgo.Reporter. -func (NewlineReporter) AfterSuiteDidRun(setupSummary *types.SetupSummary) {} - -// SpecWillRun implements ginkgo.Reporter. -func (NewlineReporter) SpecWillRun(specSummary *types.SpecSummary) {} - -// SpecDidComplete implements ginkgo.Reporter. -func (NewlineReporter) SpecDidComplete(specSummary *types.SpecSummary) {} - -// SuiteDidEnd Prints a newline between "35 Passed | 0 Failed | 0 Pending | 0 Skipped" and "--- PASS:". -func (NewlineReporter) SuiteDidEnd(summary *types.SuiteSummary) { fmt.Printf("\n") } diff --git a/pkg/envtest/printer/prow.go b/pkg/envtest/printer/prow.go index 1150c69bcc..815aade8f1 100644 --- a/pkg/envtest/printer/prow.go +++ b/pkg/envtest/printer/prow.go @@ -22,10 +22,8 @@ import ( "path/filepath" "sync" - "github.com/onsi/ginkgo/v2/config" + "github.com/onsi/ginkgo/v2" "github.com/onsi/ginkgo/v2/reporters" - "github.com/onsi/ginkgo/v2/types" - "k8s.io/apimachinery/pkg/util/sets" ) @@ -34,17 +32,8 @@ var ( allRegisteredSuitesLock = &sync.Mutex{} ) -type prowReporter struct { - junitReporter *reporters.JUnitReporter -} - -// NewProwReporter returns a prowReporter that will write out junit if running in Prow and do -// nothing otherwise. -// WARNING: It seems this does not always properly fail the test runs when there are failures, -// see https://github.com/onsi/ginkgo/issues/706 -// When using this you must make sure to grep for failures in your junit xmls and fail the run -// if there are any. -func NewProwReporter(suiteName string) reporters.DeprecatedReporter { //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 +// AddReport adds. +func AddReport(report ginkgo.Report, suiteName string) { allRegisteredSuitesLock.Lock() if allRegisteredSuites.Has(suiteName) { panic(fmt.Sprintf("Suite named %q registered more than once", suiteName)) @@ -52,57 +41,11 @@ func NewProwReporter(suiteName string) reporters.DeprecatedReporter { //nolint allRegisteredSuites.Insert(suiteName) allRegisteredSuitesLock.Unlock() - if os.Getenv("CI") == "" { - return &prowReporter{} - } artifactsDir := os.Getenv("ARTIFACTS") - if artifactsDir == "" { - return &prowReporter{} - } - - path := filepath.Join(artifactsDir, fmt.Sprintf("junit_%s.xml", suiteName)) - return &prowReporter{ - junitReporter: reporters.NewJUnitReporter(path), - } -} - -func (pr *prowReporter) SuiteWillBegin(config config.GinkgoConfigType, summary *types.SuiteSummary) { - if pr.junitReporter != nil { - pr.junitReporter.SuiteWillBegin(config, summary) - } -} - -// BeforeSuiteDidRun implements ginkgo.Reporter. -func (pr *prowReporter) BeforeSuiteDidRun(setupSummary *types.SetupSummary) { - if pr.junitReporter != nil { - pr.junitReporter.BeforeSuiteDidRun(setupSummary) - } -} - -// AfterSuiteDidRun implements ginkgo.Reporter. -func (pr *prowReporter) AfterSuiteDidRun(setupSummary *types.SetupSummary) { - if pr.junitReporter != nil { - pr.junitReporter.AfterSuiteDidRun(setupSummary) - } -} - -// SpecWillRun implements ginkgo.Reporter. -func (pr *prowReporter) SpecWillRun(specSummary *types.SpecSummary) { - if pr.junitReporter != nil { - pr.junitReporter.SpecWillRun(specSummary) - } -} - -// SpecDidComplete implements ginkgo.Reporter. -func (pr *prowReporter) SpecDidComplete(specSummary *types.SpecSummary) { - if pr.junitReporter != nil { - pr.junitReporter.SpecDidComplete(specSummary) - } -} -// SuiteDidEnd Prints a newline between "35 Passed | 0 Failed | 0 Pending | 0 Skipped" and "--- PASS:". -func (pr *prowReporter) SuiteDidEnd(summary *types.SuiteSummary) { - if pr.junitReporter != nil { - pr.junitReporter.SuiteDidEnd(summary) + if os.Getenv("CI") != "" && artifactsDir != "" { + path := filepath.Join(artifactsDir, fmt.Sprintf("junit_%s_%d.xml", suiteName, report.SuiteConfig.ParallelProcess)) + err := reporters.GenerateJUnitReport(report, path) + fmt.Printf("Failed to generate report\n\t%s", err.Error()) } } diff --git a/pkg/finalizer/finalizer_test.go b/pkg/finalizer/finalizer_test.go index 5c32b945b8..15350abee5 100644 --- a/pkg/finalizer/finalizer_test.go +++ b/pkg/finalizer/finalizer_test.go @@ -6,7 +6,6 @@ import ( "testing" . "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -219,6 +218,5 @@ var _ = Describe("TestFinalizer", func() { }) var _ = ReportAfterSuite("Report to Prow", func(report Report) { - reporters.ReportViaDeprecatedReporter(printer.NewlineReporter{}, report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 - reporters.ReportViaDeprecatedReporter(printer.NewProwReporter(suiteName), report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 + printer.AddReport(report, suiteName) }) diff --git a/pkg/handler/eventhandler_suite_test.go b/pkg/handler/eventhandler_suite_test.go index bec74253cc..96264ccb6b 100644 --- a/pkg/handler/eventhandler_suite_test.go +++ b/pkg/handler/eventhandler_suite_test.go @@ -20,7 +20,6 @@ import ( "testing" . "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" "k8s.io/client-go/rest" "sigs.k8s.io/controller-runtime/pkg/envtest" @@ -53,6 +52,5 @@ var _ = AfterSuite(func() { }) var _ = ReportAfterSuite("Report to Prow", func(report Report) { - reporters.ReportViaDeprecatedReporter(printer.NewlineReporter{}, report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 - reporters.ReportViaDeprecatedReporter(printer.NewProwReporter(suiteName), report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 + printer.AddReport(report, suiteName) }) diff --git a/pkg/healthz/healthz_suite_test.go b/pkg/healthz/healthz_suite_test.go index c1ca64b8b2..ce69f9e974 100644 --- a/pkg/healthz/healthz_suite_test.go +++ b/pkg/healthz/healthz_suite_test.go @@ -20,7 +20,6 @@ import ( "testing" . "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" logf "sigs.k8s.io/controller-runtime/pkg/log" @@ -39,6 +38,5 @@ var _ = BeforeSuite(func() { }) var _ = ReportAfterSuite("Report to Prow", func(report Report) { - reporters.ReportViaDeprecatedReporter(printer.NewlineReporter{}, report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 - reporters.ReportViaDeprecatedReporter(printer.NewProwReporter(suiteName), report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 + printer.AddReport(report, suiteName) }) diff --git a/pkg/internal/controller/controller_suite_test.go b/pkg/internal/controller/controller_suite_test.go index b13639aa94..20015ac654 100644 --- a/pkg/internal/controller/controller_suite_test.go +++ b/pkg/internal/controller/controller_suite_test.go @@ -20,7 +20,6 @@ import ( "testing" . "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" @@ -59,6 +58,5 @@ var _ = AfterSuite(func() { }) var _ = ReportAfterSuite("Report to Prow", func(report Report) { - reporters.ReportViaDeprecatedReporter(printer.NewlineReporter{}, report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 - reporters.ReportViaDeprecatedReporter(printer.NewProwReporter(suiteName), report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 + printer.AddReport(report, suiteName) }) diff --git a/pkg/internal/recorder/recorder_suite_test.go b/pkg/internal/recorder/recorder_suite_test.go index 77dc4d4f44..671783ddf3 100644 --- a/pkg/internal/recorder/recorder_suite_test.go +++ b/pkg/internal/recorder/recorder_suite_test.go @@ -20,7 +20,6 @@ import ( "testing" . "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" @@ -59,6 +58,5 @@ var _ = AfterSuite(func() { }) var _ = ReportAfterSuite("Report to Prow", func(report Report) { - reporters.ReportViaDeprecatedReporter(printer.NewlineReporter{}, report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 - reporters.ReportViaDeprecatedReporter(printer.NewProwReporter(suiteName), report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 + printer.AddReport(report, suiteName) }) diff --git a/pkg/internal/testing/addr/addr_suite_test.go b/pkg/internal/testing/addr/addr_suite_test.go index 4d4132fa7f..baa40102d3 100644 --- a/pkg/internal/testing/addr/addr_suite_test.go +++ b/pkg/internal/testing/addr/addr_suite_test.go @@ -20,7 +20,6 @@ import ( "testing" . "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" @@ -35,6 +34,5 @@ func TestAddr(t *testing.T) { } var _ = ReportAfterSuite("Report to Prow", func(report Report) { - reporters.ReportViaDeprecatedReporter(printer.NewlineReporter{}, report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 - reporters.ReportViaDeprecatedReporter(printer.NewProwReporter(suiteName), report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 + printer.AddReport(report, suiteName) }) diff --git a/pkg/internal/testing/certs/certs_suite_test.go b/pkg/internal/testing/certs/certs_suite_test.go index dc1217f6a5..085c092be9 100644 --- a/pkg/internal/testing/certs/certs_suite_test.go +++ b/pkg/internal/testing/certs/certs_suite_test.go @@ -20,7 +20,6 @@ import ( "testing" . "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" @@ -35,6 +34,5 @@ func TestInternal(t *testing.T) { } var _ = ReportAfterSuite("Report to Prow", func(report Report) { - reporters.ReportViaDeprecatedReporter(printer.NewlineReporter{}, report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 - reporters.ReportViaDeprecatedReporter(printer.NewProwReporter(suiteName), report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 + printer.AddReport(report, suiteName) }) diff --git a/pkg/internal/testing/controlplane/controlplane_suite_test.go b/pkg/internal/testing/controlplane/controlplane_suite_test.go index 209f51cb91..812fa9e31c 100644 --- a/pkg/internal/testing/controlplane/controlplane_suite_test.go +++ b/pkg/internal/testing/controlplane/controlplane_suite_test.go @@ -20,7 +20,6 @@ import ( "testing" . "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" @@ -35,6 +34,5 @@ func TestIntegration(t *testing.T) { } var _ = ReportAfterSuite("Report to Prow", func(report Report) { - reporters.ReportViaDeprecatedReporter(printer.NewlineReporter{}, report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 - reporters.ReportViaDeprecatedReporter(printer.NewProwReporter(suiteName), report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 + printer.AddReport(report, suiteName) }) diff --git a/pkg/internal/testing/process/process_suite_test.go b/pkg/internal/testing/process/process_suite_test.go index 614313aa40..9832534448 100644 --- a/pkg/internal/testing/process/process_suite_test.go +++ b/pkg/internal/testing/process/process_suite_test.go @@ -20,7 +20,6 @@ import ( "testing" . "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" @@ -35,6 +34,5 @@ func TestInternal(t *testing.T) { } var _ = ReportAfterSuite("Report to Prow", func(report Report) { - reporters.ReportViaDeprecatedReporter(printer.NewlineReporter{}, report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 - reporters.ReportViaDeprecatedReporter(printer.NewProwReporter(suiteName), report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 + printer.AddReport(report, suiteName) }) diff --git a/pkg/log/log_suite_test.go b/pkg/log/log_suite_test.go index bdc75d2912..3abca610ad 100644 --- a/pkg/log/log_suite_test.go +++ b/pkg/log/log_suite_test.go @@ -20,7 +20,6 @@ import ( "testing" . "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" ) @@ -33,6 +32,5 @@ func TestSource(t *testing.T) { } var _ = ReportAfterSuite("Report to Prow", func(report Report) { - reporters.ReportViaDeprecatedReporter(printer.NewlineReporter{}, report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 - reporters.ReportViaDeprecatedReporter(printer.NewProwReporter(suiteName), report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 + printer.AddReport(report, suiteName) }) diff --git a/pkg/log/zap/zap_suite_test.go b/pkg/log/zap/zap_suite_test.go index c151a07e06..86cd0d61fa 100644 --- a/pkg/log/zap/zap_suite_test.go +++ b/pkg/log/zap/zap_suite_test.go @@ -20,7 +20,6 @@ import ( "testing" . "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" ) @@ -33,6 +32,5 @@ func TestSource(t *testing.T) { } var _ = ReportAfterSuite("Report to Prow", func(report Report) { - reporters.ReportViaDeprecatedReporter(printer.NewlineReporter{}, report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 - reporters.ReportViaDeprecatedReporter(printer.NewProwReporter(suiteName), report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 + printer.AddReport(report, suiteName) }) diff --git a/pkg/manager/manager_suite_test.go b/pkg/manager/manager_suite_test.go index 96b5eb4e76..73fe2406aa 100644 --- a/pkg/manager/manager_suite_test.go +++ b/pkg/manager/manager_suite_test.go @@ -22,7 +22,6 @@ import ( "testing" . "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" @@ -84,6 +83,5 @@ var _ = AfterSuite(func() { }) var _ = ReportAfterSuite("Report to Prow", func(report Report) { - reporters.ReportViaDeprecatedReporter(printer.NewlineReporter{}, report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 - reporters.ReportViaDeprecatedReporter(printer.NewProwReporter(suiteName), report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 + printer.AddReport(report, suiteName) }) diff --git a/pkg/manager/signals/signals_suite_test.go b/pkg/manager/signals/signals_suite_test.go index dc8375648b..5bc6c8c5d3 100644 --- a/pkg/manager/signals/signals_suite_test.go +++ b/pkg/manager/signals/signals_suite_test.go @@ -21,7 +21,6 @@ import ( "testing" . "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" ) @@ -38,6 +37,5 @@ var _ = BeforeSuite(func() { }) var _ = ReportAfterSuite("Report to Prow", func(report Report) { - reporters.ReportViaDeprecatedReporter(printer.NewlineReporter{}, report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 - reporters.ReportViaDeprecatedReporter(printer.NewProwReporter(suiteName), report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 + printer.AddReport(report, suiteName) }) diff --git a/pkg/predicate/predicate_suite_test.go b/pkg/predicate/predicate_suite_test.go index a98b4b5a28..ff6da96d7a 100644 --- a/pkg/predicate/predicate_suite_test.go +++ b/pkg/predicate/predicate_suite_test.go @@ -20,7 +20,6 @@ import ( "testing" . "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" logf "sigs.k8s.io/controller-runtime/pkg/log" @@ -39,6 +38,5 @@ var _ = BeforeSuite(func() { }) var _ = ReportAfterSuite("Report to Prow", func(report Report) { - reporters.ReportViaDeprecatedReporter(printer.NewlineReporter{}, report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 - reporters.ReportViaDeprecatedReporter(printer.NewProwReporter(suiteName), report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 + printer.AddReport(report, suiteName) }) diff --git a/pkg/reconcile/reconcile_suite_test.go b/pkg/reconcile/reconcile_suite_test.go index da1a99dd4d..c8e5586005 100644 --- a/pkg/reconcile/reconcile_suite_test.go +++ b/pkg/reconcile/reconcile_suite_test.go @@ -20,7 +20,6 @@ import ( "testing" . "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" logf "sigs.k8s.io/controller-runtime/pkg/log" @@ -39,6 +38,5 @@ var _ = BeforeSuite(func() { }) var _ = ReportAfterSuite("Report to Prow", func(report Report) { - reporters.ReportViaDeprecatedReporter(printer.NewlineReporter{}, report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 - reporters.ReportViaDeprecatedReporter(printer.NewProwReporter(suiteName), report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 + printer.AddReport(report, suiteName) }) diff --git a/pkg/runtime/inject/inject_suite_test.go b/pkg/runtime/inject/inject_suite_test.go index c7d4244976..3d49744d34 100644 --- a/pkg/runtime/inject/inject_suite_test.go +++ b/pkg/runtime/inject/inject_suite_test.go @@ -20,7 +20,6 @@ import ( "testing" . "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" ) @@ -33,6 +32,5 @@ func TestSource(t *testing.T) { } var _ = ReportAfterSuite("Report to Prow", func(report Report) { - reporters.ReportViaDeprecatedReporter(printer.NewlineReporter{}, report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 - reporters.ReportViaDeprecatedReporter(printer.NewProwReporter(suiteName), report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 + printer.AddReport(report, suiteName) }) diff --git a/pkg/scheme/scheme_suite_test.go b/pkg/scheme/scheme_suite_test.go index 26c46ce0a4..6d7d8b7d66 100644 --- a/pkg/scheme/scheme_suite_test.go +++ b/pkg/scheme/scheme_suite_test.go @@ -20,7 +20,6 @@ import ( "testing" . "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" @@ -34,6 +33,5 @@ func TestScheme(t *testing.T) { } var _ = ReportAfterSuite("Report to Prow", func(report Report) { - reporters.ReportViaDeprecatedReporter(printer.NewlineReporter{}, report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 - reporters.ReportViaDeprecatedReporter(printer.NewProwReporter(suiteName), report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 + printer.AddReport(report, suiteName) }) diff --git a/pkg/source/internal/internal_suite_test.go b/pkg/source/internal/internal_suite_test.go index 75af16a26e..17c64eda2d 100644 --- a/pkg/source/internal/internal_suite_test.go +++ b/pkg/source/internal/internal_suite_test.go @@ -20,7 +20,6 @@ import ( "testing" . "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" logf "sigs.k8s.io/controller-runtime/pkg/log" @@ -39,6 +38,5 @@ var _ = BeforeSuite(func() { }) var _ = ReportAfterSuite("Report to Prow", func(report Report) { - reporters.ReportViaDeprecatedReporter(printer.NewlineReporter{}, report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 - reporters.ReportViaDeprecatedReporter(printer.NewProwReporter(suiteName), report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 + printer.AddReport(report, suiteName) }) diff --git a/pkg/source/source_suite_test.go b/pkg/source/source_suite_test.go index 13f580cf31..04bef13469 100644 --- a/pkg/source/source_suite_test.go +++ b/pkg/source/source_suite_test.go @@ -21,7 +21,6 @@ import ( "testing" . "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" @@ -74,6 +73,5 @@ var _ = AfterSuite(func() { }) var _ = ReportAfterSuite("Report to Prow", func(report Report) { - reporters.ReportViaDeprecatedReporter(printer.NewlineReporter{}, report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 - reporters.ReportViaDeprecatedReporter(printer.NewProwReporter(suiteName), report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 + printer.AddReport(report, suiteName) }) diff --git a/pkg/webhook/admission/admission_suite_test.go b/pkg/webhook/admission/admission_suite_test.go index b3955a73cf..0cf9a1e7e8 100644 --- a/pkg/webhook/admission/admission_suite_test.go +++ b/pkg/webhook/admission/admission_suite_test.go @@ -20,7 +20,6 @@ import ( "testing" . "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" @@ -40,6 +39,5 @@ var _ = BeforeSuite(func() { }) var _ = ReportAfterSuite("Report to Prow", func(report Report) { - reporters.ReportViaDeprecatedReporter(printer.NewlineReporter{}, report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 - reporters.ReportViaDeprecatedReporter(printer.NewProwReporter(suiteName), report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 + printer.AddReport(report, suiteName) }) diff --git a/pkg/webhook/authentication/authentication_suite_test.go b/pkg/webhook/authentication/authentication_suite_test.go index 9e9ecd81f1..a2f22264cf 100644 --- a/pkg/webhook/authentication/authentication_suite_test.go +++ b/pkg/webhook/authentication/authentication_suite_test.go @@ -20,7 +20,6 @@ import ( "testing" . "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" @@ -40,6 +39,5 @@ var _ = BeforeSuite(func() { }) var _ = ReportAfterSuite("Report to Prow", func(report Report) { - reporters.ReportViaDeprecatedReporter(printer.NewlineReporter{}, report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 - reporters.ReportViaDeprecatedReporter(printer.NewProwReporter(suiteName), report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 + printer.AddReport(report, suiteName) }) diff --git a/pkg/webhook/conversion/conversion_suite_test.go b/pkg/webhook/conversion/conversion_suite_test.go index 44d7f0f28f..442357ad38 100644 --- a/pkg/webhook/conversion/conversion_suite_test.go +++ b/pkg/webhook/conversion/conversion_suite_test.go @@ -19,7 +19,6 @@ import ( "testing" . "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" @@ -39,6 +38,5 @@ var _ = BeforeSuite(func() { }) var _ = ReportAfterSuite("Report to Prow", func(report Report) { - reporters.ReportViaDeprecatedReporter(printer.NewlineReporter{}, report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 - reporters.ReportViaDeprecatedReporter(printer.NewProwReporter(suiteName), report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 + printer.AddReport(report, suiteName) }) diff --git a/pkg/webhook/webhook_suite_test.go b/pkg/webhook/webhook_suite_test.go index 4e18903ba8..b5d486a280 100644 --- a/pkg/webhook/webhook_suite_test.go +++ b/pkg/webhook/webhook_suite_test.go @@ -21,7 +21,6 @@ import ( "testing" . "github.com/onsi/ginkgo/v2" - "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" admissionv1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -109,6 +108,5 @@ func initializeWebhookInEnvironment() { } var _ = ReportAfterSuite("Report to Prow", func(report Report) { - reporters.ReportViaDeprecatedReporter(printer.NewlineReporter{}, report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 - reporters.ReportViaDeprecatedReporter(printer.NewProwReporter(suiteName), report) //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 + printer.AddReport(report, suiteName) })