From 92b5ae5b9f8a5bd5cac40069153f91839276cfb4 Mon Sep 17 00:00:00 2001 From: acumino Date: Fri, 4 Feb 2022 17:34:10 +0530 Subject: [PATCH 01/13] Upgrade to ginkgo v2.1.1 --- go.mod | 1 + 1 file changed, 1 insertion(+) diff --git a/go.mod b/go.mod index 59b6cd4464..2b7841dec0 100644 --- a/go.mod +++ b/go.mod @@ -8,6 +8,7 @@ require ( github.com/go-logr/logr v1.2.0 github.com/go-logr/zapr v1.2.0 github.com/onsi/ginkgo v1.16.5 + github.com/onsi/ginkgo/v2 v2.1.1 github.com/onsi/gomega v1.18.1 github.com/prometheus/client_golang v1.12.1 github.com/prometheus/client_model v0.2.0 From ed8df81a9f18c7d106a0109de5c7ea33ccad34aa Mon Sep 17 00:00:00 2001 From: acumino Date: Fri, 4 Feb 2022 17:39:18 +0530 Subject: [PATCH 02/13] Adapt ginkgo import paths --- pkg/builder/builder_suite_test.go | 2 +- pkg/builder/controller_test.go | 2 +- pkg/builder/webhook_test.go | 2 +- pkg/cache/cache_suite_test.go | 2 +- pkg/cache/cache_test.go | 2 +- pkg/cache/informer_cache_test.go | 2 +- pkg/cache/informer_cache_unit_test.go | 2 +- pkg/certwatcher/certwatcher_suite_test.go | 2 +- pkg/certwatcher/certwatcher_test.go | 2 +- pkg/client/apiutil/apiutil_suite_test.go | 2 +- pkg/client/apiutil/dynamicrestmapper_test.go | 2 +- pkg/client/client_suite_test.go | 2 +- pkg/client/client_test.go | 2 +- pkg/client/config/config_suite_test.go | 2 +- pkg/client/config/config_test.go | 2 +- pkg/client/dryrun_test.go | 2 +- pkg/client/fake/client_suite_test.go | 2 +- pkg/client/fake/client_test.go | 5 ++--- pkg/client/namespaced_client_test.go | 2 +- pkg/client/options_test.go | 2 +- pkg/client/watch_test.go | 2 +- pkg/cluster/cluster_suite_test.go | 2 +- pkg/cluster/cluster_test.go | 2 +- pkg/config/config_suite_test.go | 2 +- pkg/config/config_test.go | 2 +- pkg/controller/controller_integration_test.go | 2 +- pkg/controller/controller_suite_test.go | 2 +- pkg/controller/controller_test.go | 2 +- pkg/controller/controllerutil/controllerutil_suite_test.go | 2 +- pkg/controller/controllerutil/controllerutil_test.go | 2 +- pkg/envtest/envtest_suite_test.go | 2 +- pkg/envtest/envtest_test.go | 2 +- pkg/envtest/printer/ginkgo.go | 2 +- pkg/envtest/printer/prow.go | 2 +- pkg/envtest/webhook_test.go | 2 +- pkg/finalizer/finalizer_test.go | 2 +- pkg/handler/eventhandler_suite_test.go | 2 +- pkg/handler/eventhandler_test.go | 2 +- pkg/healthz/healthz_suite_test.go | 2 +- pkg/healthz/healthz_test.go | 2 +- pkg/internal/controller/controller_suite_test.go | 2 +- pkg/internal/controller/controller_test.go | 2 +- pkg/internal/recorder/recorder_integration_test.go | 2 +- pkg/internal/recorder/recorder_suite_test.go | 2 +- pkg/internal/recorder/recorder_test.go | 2 +- pkg/internal/testing/addr/addr_suite_test.go | 2 +- pkg/internal/testing/addr/manager_test.go | 2 +- pkg/internal/testing/certs/certs_suite_test.go | 2 +- pkg/internal/testing/certs/tinyca_test.go | 2 +- pkg/internal/testing/controlplane/apiserver_test.go | 2 +- pkg/internal/testing/controlplane/auth_test.go | 2 +- pkg/internal/testing/controlplane/controlplane_suite_test.go | 2 +- pkg/internal/testing/controlplane/etcd_test.go | 2 +- pkg/internal/testing/controlplane/kubectl_test.go | 2 +- pkg/internal/testing/controlplane/plane_test.go | 2 +- pkg/internal/testing/process/arguments_test.go | 2 +- pkg/internal/testing/process/bin_path_finder_test.go | 2 +- pkg/internal/testing/process/process_suite_test.go | 2 +- pkg/internal/testing/process/process_test.go | 2 +- pkg/log/log_suite_test.go | 2 +- pkg/log/log_test.go | 2 +- pkg/log/zap/zap_suite_test.go | 2 +- pkg/log/zap/zap_test.go | 2 +- pkg/manager/manager_suite_test.go | 2 +- pkg/manager/manager_test.go | 2 +- pkg/manager/runnable_group_test.go | 2 +- pkg/manager/signals/signal_test.go | 2 +- pkg/manager/signals/signals_suite_test.go | 2 +- pkg/predicate/predicate_suite_test.go | 2 +- pkg/predicate/predicate_test.go | 2 +- pkg/reconcile/reconcile_suite_test.go | 2 +- pkg/reconcile/reconcile_test.go | 2 +- pkg/runtime/inject/inject_suite_test.go | 2 +- pkg/runtime/inject/inject_test.go | 2 +- pkg/scheme/scheme_suite_test.go | 2 +- pkg/scheme/scheme_test.go | 2 +- pkg/source/internal/internal_suite_test.go | 2 +- pkg/source/internal/internal_test.go | 2 +- pkg/source/source_integration_test.go | 2 +- pkg/source/source_suite_test.go | 2 +- pkg/source/source_test.go | 2 +- pkg/webhook/admission/admission_suite_test.go | 2 +- pkg/webhook/admission/decode_test.go | 2 +- pkg/webhook/admission/http_test.go | 2 +- pkg/webhook/admission/multi_test.go | 2 +- pkg/webhook/admission/response_test.go | 2 +- pkg/webhook/admission/validator_test.go | 2 +- pkg/webhook/admission/webhook_test.go | 2 +- pkg/webhook/authentication/authentication_suite_test.go | 2 +- pkg/webhook/authentication/http_test.go | 2 +- pkg/webhook/authentication/response_test.go | 2 +- pkg/webhook/authentication/webhook_test.go | 2 +- pkg/webhook/conversion/conversion_suite_test.go | 2 +- pkg/webhook/conversion/conversion_test.go | 2 +- pkg/webhook/server_test.go | 2 +- pkg/webhook/webhook_integration_test.go | 2 +- pkg/webhook/webhook_suite_test.go | 2 +- 97 files changed, 98 insertions(+), 99 deletions(-) diff --git a/pkg/builder/builder_suite_test.go b/pkg/builder/builder_suite_test.go index 5ae6fd8616..dd80062f71 100644 --- a/pkg/builder/builder_suite_test.go +++ b/pkg/builder/builder_suite_test.go @@ -19,7 +19,7 @@ package builder import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" "k8s.io/apimachinery/pkg/api/meta" diff --git a/pkg/builder/controller_test.go b/pkg/builder/controller_test.go index 56c1a41458..bd95227eac 100644 --- a/pkg/builder/controller_test.go +++ b/pkg/builder/controller_test.go @@ -23,7 +23,7 @@ import ( "sync/atomic" "github.com/go-logr/logr" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" diff --git a/pkg/builder/webhook_test.go b/pkg/builder/webhook_test.go index 80703a38ff..2b231e4a92 100644 --- a/pkg/builder/webhook_test.go +++ b/pkg/builder/webhook_test.go @@ -25,7 +25,7 @@ import ( "os" "strings" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" diff --git a/pkg/cache/cache_suite_test.go b/pkg/cache/cache_suite_test.go index 2517777d39..7b16a76ef7 100644 --- a/pkg/cache/cache_suite_test.go +++ b/pkg/cache/cache_suite_test.go @@ -19,7 +19,7 @@ package cache_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" diff --git a/pkg/cache/cache_test.go b/pkg/cache/cache_test.go index a84b08e94c..d4d72011cd 100644 --- a/pkg/cache/cache_test.go +++ b/pkg/cache/cache_test.go @@ -23,8 +23,8 @@ import ( "sort" "strconv" - . "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo/extensions/table" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" diff --git a/pkg/cache/informer_cache_test.go b/pkg/cache/informer_cache_test.go index 6a19eaa366..ff691204a8 100644 --- a/pkg/cache/informer_cache_test.go +++ b/pkg/cache/informer_cache_test.go @@ -17,7 +17,7 @@ limitations under the License. package cache_test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "k8s.io/client-go/rest" diff --git a/pkg/cache/informer_cache_unit_test.go b/pkg/cache/informer_cache_unit_test.go index 6f66e4bd89..401cc70f8d 100644 --- a/pkg/cache/informer_cache_unit_test.go +++ b/pkg/cache/informer_cache_unit_test.go @@ -17,7 +17,7 @@ limitations under the License. package cache import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" diff --git a/pkg/certwatcher/certwatcher_suite_test.go b/pkg/certwatcher/certwatcher_suite_test.go index e1e9861ea5..a81b8aafbb 100644 --- a/pkg/certwatcher/certwatcher_suite_test.go +++ b/pkg/certwatcher/certwatcher_suite_test.go @@ -20,7 +20,7 @@ import ( "os" "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" logf "sigs.k8s.io/controller-runtime/pkg/log" diff --git a/pkg/certwatcher/certwatcher_test.go b/pkg/certwatcher/certwatcher_test.go index 8ca27b27b1..c7349ea80d 100644 --- a/pkg/certwatcher/certwatcher_test.go +++ b/pkg/certwatcher/certwatcher_test.go @@ -29,7 +29,7 @@ import ( "os" "time" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/prometheus/client_golang/prometheus/testutil" "sigs.k8s.io/controller-runtime/pkg/certwatcher" diff --git a/pkg/client/apiutil/apiutil_suite_test.go b/pkg/client/apiutil/apiutil_suite_test.go index f617195724..b59ba1b9bb 100644 --- a/pkg/client/apiutil/apiutil_suite_test.go +++ b/pkg/client/apiutil/apiutil_suite_test.go @@ -19,7 +19,7 @@ package apiutil import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "k8s.io/client-go/rest" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" diff --git a/pkg/client/apiutil/dynamicrestmapper_test.go b/pkg/client/apiutil/dynamicrestmapper_test.go index 6b88a3aa5f..51c8f3ca4b 100644 --- a/pkg/client/apiutil/dynamicrestmapper_test.go +++ b/pkg/client/apiutil/dynamicrestmapper_test.go @@ -20,7 +20,7 @@ import ( "fmt" "time" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/onsi/gomega/format" "github.com/onsi/gomega/types" diff --git a/pkg/client/client_suite_test.go b/pkg/client/client_suite_test.go index c7ed32e7bc..276c2b8106 100644 --- a/pkg/client/client_suite_test.go +++ b/pkg/client/client_suite_test.go @@ -19,7 +19,7 @@ package client_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "k8s.io/client-go/kubernetes" "k8s.io/client-go/kubernetes/scheme" diff --git a/pkg/client/client_test.go b/pkg/client/client_test.go index 52bec53ff0..6fb693e926 100644 --- a/pkg/client/client_test.go +++ b/pkg/client/client_test.go @@ -22,7 +22,7 @@ import ( "sync/atomic" "time" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" diff --git a/pkg/client/config/config_suite_test.go b/pkg/client/config/config_suite_test.go index 4d07c03c4b..7b4aaff311 100644 --- a/pkg/client/config/config_suite_test.go +++ b/pkg/client/config/config_suite_test.go @@ -19,7 +19,7 @@ package config import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" diff --git a/pkg/client/config/config_test.go b/pkg/client/config/config_test.go index a1f04d9e6e..058ff33c1f 100644 --- a/pkg/client/config/config_test.go +++ b/pkg/client/config/config_test.go @@ -21,7 +21,7 @@ import ( "path/filepath" "strings" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" diff --git a/pkg/client/dryrun_test.go b/pkg/client/dryrun_test.go index 0a46e5617d..3d2b07cca0 100644 --- a/pkg/client/dryrun_test.go +++ b/pkg/client/dryrun_test.go @@ -21,7 +21,7 @@ import ( "fmt" "sync/atomic" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" diff --git a/pkg/client/fake/client_suite_test.go b/pkg/client/fake/client_suite_test.go index ac5540106e..5dd0176fc8 100644 --- a/pkg/client/fake/client_suite_test.go +++ b/pkg/client/fake/client_suite_test.go @@ -19,7 +19,7 @@ package fake import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" diff --git a/pkg/client/fake/client_test.go b/pkg/client/fake/client_test.go index 5ce93a8cdc..f95a05d9d4 100644 --- a/pkg/client/fake/client_test.go +++ b/pkg/client/fake/client_test.go @@ -22,11 +22,10 @@ import ( "fmt" "time" - "k8s.io/client-go/kubernetes/fake" - - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" + "k8s.io/client-go/kubernetes/fake" appsv1 "k8s.io/api/apps/v1" coordinationv1 "k8s.io/api/coordination/v1" diff --git a/pkg/client/namespaced_client_test.go b/pkg/client/namespaced_client_test.go index 5b8f3388c8..648c8a4c62 100644 --- a/pkg/client/namespaced_client_test.go +++ b/pkg/client/namespaced_client_test.go @@ -22,7 +22,7 @@ import ( "fmt" "sync/atomic" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" rbacv1 "k8s.io/api/rbac/v1" diff --git a/pkg/client/options_test.go b/pkg/client/options_test.go index 36447a3f3c..c41592bd0d 100644 --- a/pkg/client/options_test.go +++ b/pkg/client/options_test.go @@ -17,7 +17,7 @@ limitations under the License. package client_test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/client/watch_test.go b/pkg/client/watch_test.go index 6181596b5e..9ddd51901b 100644 --- a/pkg/client/watch_test.go +++ b/pkg/client/watch_test.go @@ -21,7 +21,7 @@ import ( "fmt" "sync/atomic" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" diff --git a/pkg/cluster/cluster_suite_test.go b/pkg/cluster/cluster_suite_test.go index 4970497193..37a894d055 100644 --- a/pkg/cluster/cluster_suite_test.go +++ b/pkg/cluster/cluster_suite_test.go @@ -20,7 +20,7 @@ import ( "net/http" "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" diff --git a/pkg/cluster/cluster_test.go b/pkg/cluster/cluster_test.go index f9f7a0bdf3..0da179d3f0 100644 --- a/pkg/cluster/cluster_test.go +++ b/pkg/cluster/cluster_test.go @@ -22,7 +22,7 @@ import ( "fmt" "github.com/go-logr/logr" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "go.uber.org/goleak" "k8s.io/apimachinery/pkg/api/meta" diff --git a/pkg/config/config_suite_test.go b/pkg/config/config_suite_test.go index 9a494dafbc..c94965ce66 100644 --- a/pkg/config/config_suite_test.go +++ b/pkg/config/config_suite_test.go @@ -19,7 +19,7 @@ package config_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go index f2b5461b55..3d7aec7e81 100644 --- a/pkg/config/config_test.go +++ b/pkg/config/config_test.go @@ -17,7 +17,7 @@ limitations under the License. package config_test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/config" "sigs.k8s.io/controller-runtime/pkg/config/v1alpha1" diff --git a/pkg/controller/controller_integration_test.go b/pkg/controller/controller_integration_test.go index 9f347b0032..70e4a5f761 100644 --- a/pkg/controller/controller_integration_test.go +++ b/pkg/controller/controller_integration_test.go @@ -31,7 +31,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/reconcile" "sigs.k8s.io/controller-runtime/pkg/source" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/manager" ) diff --git a/pkg/controller/controller_suite_test.go b/pkg/controller/controller_suite_test.go index 71b2232239..51ce76ef86 100644 --- a/pkg/controller/controller_suite_test.go +++ b/pkg/controller/controller_suite_test.go @@ -20,7 +20,7 @@ import ( "net/http" "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/kubernetes" diff --git a/pkg/controller/controller_test.go b/pkg/controller/controller_test.go index d3e8419a16..8932cb35ca 100644 --- a/pkg/controller/controller_test.go +++ b/pkg/controller/controller_test.go @@ -21,7 +21,7 @@ import ( "fmt" "time" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "go.uber.org/goleak" corev1 "k8s.io/api/core/v1" diff --git a/pkg/controller/controllerutil/controllerutil_suite_test.go b/pkg/controller/controllerutil/controllerutil_suite_test.go index da4c5cf4ac..7c6363054f 100644 --- a/pkg/controller/controllerutil/controllerutil_suite_test.go +++ b/pkg/controller/controllerutil/controllerutil_suite_test.go @@ -19,7 +19,7 @@ package controllerutil_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "k8s.io/client-go/rest" diff --git a/pkg/controller/controllerutil/controllerutil_test.go b/pkg/controller/controllerutil/controllerutil_test.go index e2464b2953..6e996bb203 100644 --- a/pkg/controller/controllerutil/controllerutil_test.go +++ b/pkg/controller/controllerutil/controllerutil_test.go @@ -21,7 +21,7 @@ import ( "fmt" "math/rand" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" diff --git a/pkg/envtest/envtest_suite_test.go b/pkg/envtest/envtest_suite_test.go index 0d5bb0eae2..95d9ce6ca8 100644 --- a/pkg/envtest/envtest_suite_test.go +++ b/pkg/envtest/envtest_suite_test.go @@ -19,7 +19,7 @@ package envtest import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" admissionv1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/envtest/envtest_test.go b/pkg/envtest/envtest_test.go index 11eedca0ac..c19a1241d1 100644 --- a/pkg/envtest/envtest_test.go +++ b/pkg/envtest/envtest_test.go @@ -21,7 +21,7 @@ import ( "path/filepath" "time" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" diff --git a/pkg/envtest/printer/ginkgo.go b/pkg/envtest/printer/ginkgo.go index d835dc7721..91573339fd 100644 --- a/pkg/envtest/printer/ginkgo.go +++ b/pkg/envtest/printer/ginkgo.go @@ -21,9 +21,9 @@ package printer import ( "fmt" - "github.com/onsi/ginkgo" "github.com/onsi/ginkgo/config" "github.com/onsi/ginkgo/types" + "github.com/onsi/ginkgo/v2" ) var _ ginkgo.Reporter = NewlineReporter{} diff --git a/pkg/envtest/printer/prow.go b/pkg/envtest/printer/prow.go index 2f4009aa03..27d71675a1 100644 --- a/pkg/envtest/printer/prow.go +++ b/pkg/envtest/printer/prow.go @@ -22,10 +22,10 @@ import ( "path/filepath" "sync" - "github.com/onsi/ginkgo" "github.com/onsi/ginkgo/config" "github.com/onsi/ginkgo/reporters" "github.com/onsi/ginkgo/types" + "github.com/onsi/ginkgo/v2" "k8s.io/apimachinery/pkg/util/sets" ) diff --git a/pkg/envtest/webhook_test.go b/pkg/envtest/webhook_test.go index 6f900bb7fb..bb1726cf01 100644 --- a/pkg/envtest/webhook_test.go +++ b/pkg/envtest/webhook_test.go @@ -21,7 +21,7 @@ import ( "path/filepath" "time" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" diff --git a/pkg/finalizer/finalizer_test.go b/pkg/finalizer/finalizer_test.go index 944acd595a..7cc437d598 100644 --- a/pkg/finalizer/finalizer_test.go +++ b/pkg/finalizer/finalizer_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/handler/eventhandler_suite_test.go b/pkg/handler/eventhandler_suite_test.go index ebcc993915..99ebe8d03c 100644 --- a/pkg/handler/eventhandler_suite_test.go +++ b/pkg/handler/eventhandler_suite_test.go @@ -19,7 +19,7 @@ package handler_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "k8s.io/client-go/rest" "sigs.k8s.io/controller-runtime/pkg/envtest" diff --git a/pkg/handler/eventhandler_test.go b/pkg/handler/eventhandler_test.go index 61db62e66a..d8b2211869 100644 --- a/pkg/handler/eventhandler_test.go +++ b/pkg/handler/eventhandler_test.go @@ -17,7 +17,7 @@ package handler_test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" appsv1 "k8s.io/api/apps/v1" autoscalingv1 "k8s.io/api/autoscaling/v1" diff --git a/pkg/healthz/healthz_suite_test.go b/pkg/healthz/healthz_suite_test.go index b51fcb3605..58b5b1cb6b 100644 --- a/pkg/healthz/healthz_suite_test.go +++ b/pkg/healthz/healthz_suite_test.go @@ -19,7 +19,7 @@ package healthz_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" logf "sigs.k8s.io/controller-runtime/pkg/log" diff --git a/pkg/healthz/healthz_test.go b/pkg/healthz/healthz_test.go index e0413103f7..639a7575f3 100644 --- a/pkg/healthz/healthz_test.go +++ b/pkg/healthz/healthz_test.go @@ -21,7 +21,7 @@ import ( "net/http" "net/http/httptest" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/healthz" ) diff --git a/pkg/internal/controller/controller_suite_test.go b/pkg/internal/controller/controller_suite_test.go index 6091dd746c..4a8d3a359f 100644 --- a/pkg/internal/controller/controller_suite_test.go +++ b/pkg/internal/controller/controller_suite_test.go @@ -19,7 +19,7 @@ package controller import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" diff --git a/pkg/internal/controller/controller_test.go b/pkg/internal/controller/controller_test.go index 7825749490..df539273e6 100644 --- a/pkg/internal/controller/controller_test.go +++ b/pkg/internal/controller/controller_test.go @@ -24,7 +24,7 @@ import ( "time" "github.com/go-logr/logr" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/prometheus/client_golang/prometheus" dto "github.com/prometheus/client_model/go" diff --git a/pkg/internal/recorder/recorder_integration_test.go b/pkg/internal/recorder/recorder_integration_test.go index 5bafaabf5a..30928c390f 100644 --- a/pkg/internal/recorder/recorder_integration_test.go +++ b/pkg/internal/recorder/recorder_integration_test.go @@ -31,7 +31,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/reconcile" "sigs.k8s.io/controller-runtime/pkg/source" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/internal/recorder/recorder_suite_test.go b/pkg/internal/recorder/recorder_suite_test.go index ee8f98fae0..e69dab170e 100644 --- a/pkg/internal/recorder/recorder_suite_test.go +++ b/pkg/internal/recorder/recorder_suite_test.go @@ -19,7 +19,7 @@ package recorder_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" diff --git a/pkg/internal/recorder/recorder_test.go b/pkg/internal/recorder/recorder_test.go index 86bcdd36f6..0179ce53fc 100644 --- a/pkg/internal/recorder/recorder_test.go +++ b/pkg/internal/recorder/recorder_test.go @@ -18,7 +18,7 @@ package recorder_test import ( "github.com/go-logr/logr" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/tools/record" diff --git a/pkg/internal/testing/addr/addr_suite_test.go b/pkg/internal/testing/addr/addr_suite_test.go index b18c62def9..0361d296d3 100644 --- a/pkg/internal/testing/addr/addr_suite_test.go +++ b/pkg/internal/testing/addr/addr_suite_test.go @@ -19,7 +19,7 @@ package addr_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" diff --git a/pkg/internal/testing/addr/manager_test.go b/pkg/internal/testing/addr/manager_test.go index cf95c36115..065e847dc5 100644 --- a/pkg/internal/testing/addr/manager_test.go +++ b/pkg/internal/testing/addr/manager_test.go @@ -20,7 +20,7 @@ import ( "net" "strconv" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/internal/testing/addr" diff --git a/pkg/internal/testing/certs/certs_suite_test.go b/pkg/internal/testing/certs/certs_suite_test.go index 5b63fc4f55..c4e49a3cff 100644 --- a/pkg/internal/testing/certs/certs_suite_test.go +++ b/pkg/internal/testing/certs/certs_suite_test.go @@ -19,7 +19,7 @@ package certs_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" diff --git a/pkg/internal/testing/certs/tinyca_test.go b/pkg/internal/testing/certs/tinyca_test.go index e3f2513210..6e0540ba9f 100644 --- a/pkg/internal/testing/certs/tinyca_test.go +++ b/pkg/internal/testing/certs/tinyca_test.go @@ -24,7 +24,7 @@ import ( "sort" "time" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" . "github.com/onsi/gomega/gstruct" diff --git a/pkg/internal/testing/controlplane/apiserver_test.go b/pkg/internal/testing/controlplane/apiserver_test.go index b857220203..6ce1577d45 100644 --- a/pkg/internal/testing/controlplane/apiserver_test.go +++ b/pkg/internal/testing/controlplane/apiserver_test.go @@ -20,7 +20,7 @@ import ( "errors" "net/url" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "k8s.io/client-go/rest" diff --git a/pkg/internal/testing/controlplane/auth_test.go b/pkg/internal/testing/controlplane/auth_test.go index 3acbc3d3c4..9891c6f2e2 100644 --- a/pkg/internal/testing/controlplane/auth_test.go +++ b/pkg/internal/testing/controlplane/auth_test.go @@ -22,7 +22,7 @@ import ( "os" "path/filepath" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "k8s.io/client-go/rest" kcert "k8s.io/client-go/util/cert" diff --git a/pkg/internal/testing/controlplane/controlplane_suite_test.go b/pkg/internal/testing/controlplane/controlplane_suite_test.go index 067b0c40ce..1fddd35554 100644 --- a/pkg/internal/testing/controlplane/controlplane_suite_test.go +++ b/pkg/internal/testing/controlplane/controlplane_suite_test.go @@ -19,7 +19,7 @@ package controlplane_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" diff --git a/pkg/internal/testing/controlplane/etcd_test.go b/pkg/internal/testing/controlplane/etcd_test.go index e9a1f7a181..7c7c7561ff 100644 --- a/pkg/internal/testing/controlplane/etcd_test.go +++ b/pkg/internal/testing/controlplane/etcd_test.go @@ -17,7 +17,7 @@ limitations under the License. package controlplane_test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" . "sigs.k8s.io/controller-runtime/pkg/internal/testing/controlplane" diff --git a/pkg/internal/testing/controlplane/kubectl_test.go b/pkg/internal/testing/controlplane/kubectl_test.go index c09695eecb..5484bc31a1 100644 --- a/pkg/internal/testing/controlplane/kubectl_test.go +++ b/pkg/internal/testing/controlplane/kubectl_test.go @@ -19,7 +19,7 @@ package controlplane_test import ( "io" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" . "github.com/onsi/gomega/gstruct" "k8s.io/client-go/rest" diff --git a/pkg/internal/testing/controlplane/plane_test.go b/pkg/internal/testing/controlplane/plane_test.go index 714e76e8a4..cd0359dbca 100644 --- a/pkg/internal/testing/controlplane/plane_test.go +++ b/pkg/internal/testing/controlplane/plane_test.go @@ -19,7 +19,7 @@ package controlplane_test import ( "context" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" kauthn "k8s.io/api/authorization/v1" diff --git a/pkg/internal/testing/process/arguments_test.go b/pkg/internal/testing/process/arguments_test.go index 386a3ec52f..b513cbdf86 100644 --- a/pkg/internal/testing/process/arguments_test.go +++ b/pkg/internal/testing/process/arguments_test.go @@ -20,7 +20,7 @@ import ( "net/url" "strings" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" . "sigs.k8s.io/controller-runtime/pkg/internal/testing/process" diff --git a/pkg/internal/testing/process/bin_path_finder_test.go b/pkg/internal/testing/process/bin_path_finder_test.go index c933478811..1b15941840 100644 --- a/pkg/internal/testing/process/bin_path_finder_test.go +++ b/pkg/internal/testing/process/bin_path_finder_test.go @@ -19,7 +19,7 @@ package process import ( "os" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/internal/testing/process/process_suite_test.go b/pkg/internal/testing/process/process_suite_test.go index 4b9d7ab198..5914964457 100644 --- a/pkg/internal/testing/process/process_suite_test.go +++ b/pkg/internal/testing/process/process_suite_test.go @@ -19,7 +19,7 @@ package process_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" diff --git a/pkg/internal/testing/process/process_test.go b/pkg/internal/testing/process/process_test.go index 4ea6ae7263..9c3aa3bf27 100644 --- a/pkg/internal/testing/process/process_test.go +++ b/pkg/internal/testing/process/process_test.go @@ -25,7 +25,7 @@ import ( "strconv" "time" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/onsi/gomega/ghttp" "sigs.k8s.io/controller-runtime/pkg/internal/testing/addr" diff --git a/pkg/log/log_suite_test.go b/pkg/log/log_suite_test.go index bf8e967cb7..0960b83330 100644 --- a/pkg/log/log_suite_test.go +++ b/pkg/log/log_suite_test.go @@ -19,7 +19,7 @@ package log import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" ) diff --git a/pkg/log/log_test.go b/pkg/log/log_test.go index 7ea56d9b49..a4f4d895ab 100644 --- a/pkg/log/log_test.go +++ b/pkg/log/log_test.go @@ -21,7 +21,7 @@ import ( "errors" "github.com/go-logr/logr" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/log/zap/zap_suite_test.go b/pkg/log/zap/zap_suite_test.go index 43044d8066..472fe3aa4c 100644 --- a/pkg/log/zap/zap_suite_test.go +++ b/pkg/log/zap/zap_suite_test.go @@ -19,7 +19,7 @@ package zap import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" ) diff --git a/pkg/log/zap/zap_test.go b/pkg/log/zap/zap_test.go index 2d18476e1f..748923b9f1 100644 --- a/pkg/log/zap/zap_test.go +++ b/pkg/log/zap/zap_test.go @@ -24,7 +24,7 @@ import ( "reflect" "github.com/go-logr/logr" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "go.uber.org/zap/zapcore" corev1 "k8s.io/api/core/v1" diff --git a/pkg/manager/manager_suite_test.go b/pkg/manager/manager_suite_test.go index 3b975a9049..a8efb48ded 100644 --- a/pkg/manager/manager_suite_test.go +++ b/pkg/manager/manager_suite_test.go @@ -21,7 +21,7 @@ import ( "net/http" "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" diff --git a/pkg/manager/manager_test.go b/pkg/manager/manager_test.go index a4530688fa..b5aef683e6 100644 --- a/pkg/manager/manager_test.go +++ b/pkg/manager/manager_test.go @@ -30,7 +30,7 @@ import ( "time" "github.com/go-logr/logr" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "github.com/prometheus/client_golang/prometheus" "go.uber.org/goleak" diff --git a/pkg/manager/runnable_group_test.go b/pkg/manager/runnable_group_test.go index db23eeae95..2122f23656 100644 --- a/pkg/manager/runnable_group_test.go +++ b/pkg/manager/runnable_group_test.go @@ -7,7 +7,7 @@ import ( "sync/atomic" "time" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "k8s.io/utils/pointer" "sigs.k8s.io/controller-runtime/pkg/cache/informertest" diff --git a/pkg/manager/signals/signal_test.go b/pkg/manager/signals/signal_test.go index 2776e13a6d..134937e012 100644 --- a/pkg/manager/signals/signal_test.go +++ b/pkg/manager/signals/signal_test.go @@ -23,7 +23,7 @@ import ( "sync" "time" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/pkg/manager/signals/signals_suite_test.go b/pkg/manager/signals/signals_suite_test.go index 770df0ca9c..4b809e4548 100644 --- a/pkg/manager/signals/signals_suite_test.go +++ b/pkg/manager/signals/signals_suite_test.go @@ -20,7 +20,7 @@ import ( "os/signal" "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" ) diff --git a/pkg/predicate/predicate_suite_test.go b/pkg/predicate/predicate_suite_test.go index a03d94b17d..244d1ded86 100644 --- a/pkg/predicate/predicate_suite_test.go +++ b/pkg/predicate/predicate_suite_test.go @@ -19,7 +19,7 @@ package predicate_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" logf "sigs.k8s.io/controller-runtime/pkg/log" diff --git a/pkg/predicate/predicate_test.go b/pkg/predicate/predicate_test.go index f545139871..e43cca655e 100644 --- a/pkg/predicate/predicate_test.go +++ b/pkg/predicate/predicate_test.go @@ -17,7 +17,7 @@ limitations under the License. package predicate_test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" diff --git a/pkg/reconcile/reconcile_suite_test.go b/pkg/reconcile/reconcile_suite_test.go index 179fb10de4..cccc4d609b 100644 --- a/pkg/reconcile/reconcile_suite_test.go +++ b/pkg/reconcile/reconcile_suite_test.go @@ -19,7 +19,7 @@ package reconcile_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" logf "sigs.k8s.io/controller-runtime/pkg/log" diff --git a/pkg/reconcile/reconcile_test.go b/pkg/reconcile/reconcile_test.go index 26924c8fa9..125b80936d 100644 --- a/pkg/reconcile/reconcile_test.go +++ b/pkg/reconcile/reconcile_test.go @@ -21,7 +21,7 @@ import ( "fmt" "time" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/reconcile" diff --git a/pkg/runtime/inject/inject_suite_test.go b/pkg/runtime/inject/inject_suite_test.go index 98cf79ab3b..50398dcf90 100644 --- a/pkg/runtime/inject/inject_suite_test.go +++ b/pkg/runtime/inject/inject_suite_test.go @@ -19,7 +19,7 @@ package inject import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" ) diff --git a/pkg/runtime/inject/inject_test.go b/pkg/runtime/inject/inject_test.go index bffc34ec27..7818909221 100644 --- a/pkg/runtime/inject/inject_test.go +++ b/pkg/runtime/inject/inject_test.go @@ -20,7 +20,7 @@ import ( "fmt" "reflect" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/rest" diff --git a/pkg/scheme/scheme_suite_test.go b/pkg/scheme/scheme_suite_test.go index a11e08fa5c..d924c06431 100644 --- a/pkg/scheme/scheme_suite_test.go +++ b/pkg/scheme/scheme_suite_test.go @@ -19,7 +19,7 @@ package scheme_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" diff --git a/pkg/scheme/scheme_test.go b/pkg/scheme/scheme_test.go index 72f083ad4b..37c6766e6f 100644 --- a/pkg/scheme/scheme_test.go +++ b/pkg/scheme/scheme_test.go @@ -19,7 +19,7 @@ package scheme_test import ( "reflect" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" . "github.com/onsi/gomega/gstruct" appsv1 "k8s.io/api/apps/v1" diff --git a/pkg/source/internal/internal_suite_test.go b/pkg/source/internal/internal_suite_test.go index 21dd5ee6b4..edf2375b3e 100644 --- a/pkg/source/internal/internal_suite_test.go +++ b/pkg/source/internal/internal_suite_test.go @@ -19,7 +19,7 @@ package internal_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" logf "sigs.k8s.io/controller-runtime/pkg/log" diff --git a/pkg/source/internal/internal_test.go b/pkg/source/internal/internal_test.go index 9b96c6d46d..312fd86c17 100644 --- a/pkg/source/internal/internal_test.go +++ b/pkg/source/internal/internal_test.go @@ -17,7 +17,7 @@ limitations under the License. package internal_test import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "k8s.io/client-go/tools/cache" "k8s.io/client-go/util/workqueue" diff --git a/pkg/source/source_integration_test.go b/pkg/source/source_integration_test.go index f05a154d14..a41eb8d744 100644 --- a/pkg/source/source_integration_test.go +++ b/pkg/source/source_integration_test.go @@ -26,7 +26,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/runtime/inject" "sigs.k8s.io/controller-runtime/pkg/source" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" diff --git a/pkg/source/source_suite_test.go b/pkg/source/source_suite_test.go index 9fd9671cd0..c6dfc68ddf 100644 --- a/pkg/source/source_suite_test.go +++ b/pkg/source/source_suite_test.go @@ -20,7 +20,7 @@ import ( "context" "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" diff --git a/pkg/source/source_test.go b/pkg/source/source_test.go index 70c708df08..c2e6904180 100644 --- a/pkg/source/source_test.go +++ b/pkg/source/source_test.go @@ -21,7 +21,7 @@ import ( "fmt" "time" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/cache/informertest" "sigs.k8s.io/controller-runtime/pkg/event" diff --git a/pkg/webhook/admission/admission_suite_test.go b/pkg/webhook/admission/admission_suite_test.go index 3648aa45b7..8e605dbf8f 100644 --- a/pkg/webhook/admission/admission_suite_test.go +++ b/pkg/webhook/admission/admission_suite_test.go @@ -19,7 +19,7 @@ package admission import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" diff --git a/pkg/webhook/admission/decode_test.go b/pkg/webhook/admission/decode_test.go index c167c51026..f92db10a6c 100644 --- a/pkg/webhook/admission/decode_test.go +++ b/pkg/webhook/admission/decode_test.go @@ -17,7 +17,7 @@ limitations under the License. package admission import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" admissionv1 "k8s.io/api/admission/v1" diff --git a/pkg/webhook/admission/http_test.go b/pkg/webhook/admission/http_test.go index 7dd2d5bcfc..356e24010a 100644 --- a/pkg/webhook/admission/http_test.go +++ b/pkg/webhook/admission/http_test.go @@ -24,7 +24,7 @@ import ( "net/http" "net/http/httptest" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" admissionv1 "k8s.io/api/admission/v1" diff --git a/pkg/webhook/admission/multi_test.go b/pkg/webhook/admission/multi_test.go index a8b51872a2..da85a52e42 100644 --- a/pkg/webhook/admission/multi_test.go +++ b/pkg/webhook/admission/multi_test.go @@ -19,7 +19,7 @@ package admission import ( "context" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" jsonpatch "gomodules.xyz/jsonpatch/v2" diff --git a/pkg/webhook/admission/response_test.go b/pkg/webhook/admission/response_test.go index e96b0e6ca7..42a083a166 100644 --- a/pkg/webhook/admission/response_test.go +++ b/pkg/webhook/admission/response_test.go @@ -20,7 +20,7 @@ import ( "errors" "net/http" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" jsonpatch "gomodules.xyz/jsonpatch/v2" diff --git a/pkg/webhook/admission/validator_test.go b/pkg/webhook/admission/validator_test.go index 7fe19268d9..d777d78a67 100644 --- a/pkg/webhook/admission/validator_test.go +++ b/pkg/webhook/admission/validator_test.go @@ -21,7 +21,7 @@ import ( goerrors "errors" "net/http" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/webhook/admission/admissiontest" diff --git a/pkg/webhook/admission/webhook_test.go b/pkg/webhook/admission/webhook_test.go index 73b0be1694..a2a66d9d1d 100644 --- a/pkg/webhook/admission/webhook_test.go +++ b/pkg/webhook/admission/webhook_test.go @@ -20,7 +20,7 @@ import ( "context" "net/http" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" jsonpatch "gomodules.xyz/jsonpatch/v2" diff --git a/pkg/webhook/authentication/authentication_suite_test.go b/pkg/webhook/authentication/authentication_suite_test.go index b993d1ef80..94083c53bd 100644 --- a/pkg/webhook/authentication/authentication_suite_test.go +++ b/pkg/webhook/authentication/authentication_suite_test.go @@ -19,7 +19,7 @@ package authentication import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" diff --git a/pkg/webhook/authentication/http_test.go b/pkg/webhook/authentication/http_test.go index 882a77e427..32227ee144 100644 --- a/pkg/webhook/authentication/http_test.go +++ b/pkg/webhook/authentication/http_test.go @@ -24,7 +24,7 @@ import ( "net/http" "net/http/httptest" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" authenticationv1 "k8s.io/api/authentication/v1" diff --git a/pkg/webhook/authentication/response_test.go b/pkg/webhook/authentication/response_test.go index 22c1ee3ba7..6eeef87c11 100644 --- a/pkg/webhook/authentication/response_test.go +++ b/pkg/webhook/authentication/response_test.go @@ -19,7 +19,7 @@ package authentication import ( "errors" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" authenticationv1 "k8s.io/api/authentication/v1" diff --git a/pkg/webhook/authentication/webhook_test.go b/pkg/webhook/authentication/webhook_test.go index 55849ece32..e80096395e 100644 --- a/pkg/webhook/authentication/webhook_test.go +++ b/pkg/webhook/authentication/webhook_test.go @@ -19,7 +19,7 @@ package authentication import ( "context" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" authenticationv1 "k8s.io/api/authentication/v1" diff --git a/pkg/webhook/conversion/conversion_suite_test.go b/pkg/webhook/conversion/conversion_suite_test.go index bb3798747c..7ebf10d538 100644 --- a/pkg/webhook/conversion/conversion_suite_test.go +++ b/pkg/webhook/conversion/conversion_suite_test.go @@ -18,7 +18,7 @@ package conversion import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" diff --git a/pkg/webhook/conversion/conversion_test.go b/pkg/webhook/conversion/conversion_test.go index 2dd5e2ae0e..6a6c9a7611 100644 --- a/pkg/webhook/conversion/conversion_test.go +++ b/pkg/webhook/conversion/conversion_test.go @@ -23,7 +23,7 @@ import ( "net/http" "net/http/httptest" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" appsv1beta1 "k8s.io/api/apps/v1beta1" diff --git a/pkg/webhook/server_test.go b/pkg/webhook/server_test.go index 5e77564194..68b4dcf076 100644 --- a/pkg/webhook/server_test.go +++ b/pkg/webhook/server_test.go @@ -24,7 +24,7 @@ import ( "net" "net/http" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "k8s.io/client-go/kubernetes/scheme" "k8s.io/client-go/rest" diff --git a/pkg/webhook/webhook_integration_test.go b/pkg/webhook/webhook_integration_test.go index 029a503b4b..3f0f0d42a1 100644 --- a/pkg/webhook/webhook_integration_test.go +++ b/pkg/webhook/webhook_integration_test.go @@ -26,7 +26,7 @@ import ( "strconv" "time" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" diff --git a/pkg/webhook/webhook_suite_test.go b/pkg/webhook/webhook_suite_test.go index b8ee879d36..9b8de74d3d 100644 --- a/pkg/webhook/webhook_suite_test.go +++ b/pkg/webhook/webhook_suite_test.go @@ -20,7 +20,7 @@ import ( "fmt" "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" admissionv1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" From 6bf50a93bd4fb460579acb26eaa8da965084ce22 Mon Sep 17 00:00:00 2001 From: acumino Date: Fri, 4 Feb 2022 17:42:31 +0530 Subject: [PATCH 03/13] Drop obsolete table extension imports --- pkg/cache/cache_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/cache/cache_test.go b/pkg/cache/cache_test.go index d4d72011cd..b8330c3a8e 100644 --- a/pkg/cache/cache_test.go +++ b/pkg/cache/cache_test.go @@ -23,7 +23,6 @@ import ( "sort" "strconv" - . "github.com/onsi/ginkgo/extensions/table" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" From fed90d20409da6ab21085684641c9eb45dc5dc7b Mon Sep 17 00:00:00 2001 From: acumino Date: Fri, 4 Feb 2022 18:09:38 +0530 Subject: [PATCH 04/13] tidy --- go.sum | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/go.sum b/go.sum index f942be5258..e0a4ee16d9 100644 --- a/go.sum +++ b/go.sum @@ -362,14 +362,25 @@ 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= +<<<<<<< HEAD github.com/onsi/ginkgo/v2 v2.0.0 h1:CcuG/HvWNkkaqCUpJifQY8z7qEMBJya6aLPx6ftGyjQ= github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= +======= +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= +>>>>>>> 369575cf (tidy) 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/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +<<<<<<< HEAD github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= +======= +github.com/onsi/gomega v1.18.0 h1:ngbYoRctxjl8SiF7XgP0NxBFbfHcg3wfHMMaFHWwMTM= +github.com/onsi/gomega v1.18.0/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= +>>>>>>> 369575cf (tidy) 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= From d491a458d4c1e684e2de7fd103793edcb0ce93a4 Mon Sep 17 00:00:00 2001 From: acumino Date: Fri, 4 Feb 2022 19:51:30 +0530 Subject: [PATCH 05/13] Remove {Before,After} Suite specific timeout --- pkg/builder/builder_suite_test.go | 2 +- pkg/cache/cache_suite_test.go | 2 +- pkg/certwatcher/certwatcher_suite_test.go | 4 ++-- pkg/client/apiutil/apiutil_suite_test.go | 2 +- pkg/client/client_suite_test.go | 2 +- pkg/client/config/config_suite_test.go | 2 +- pkg/client/fake/client_suite_test.go | 2 +- pkg/cluster/cluster_suite_test.go | 2 +- pkg/controller/controller_suite_test.go | 2 +- pkg/envtest/envtest_suite_test.go | 4 ++-- pkg/internal/controller/controller_suite_test.go | 2 +- pkg/internal/recorder/recorder_suite_test.go | 2 +- pkg/manager/manager_suite_test.go | 2 +- pkg/source/source_suite_test.go | 4 ++-- pkg/webhook/admission/admission_suite_test.go | 2 +- pkg/webhook/authentication/authentication_suite_test.go | 2 +- pkg/webhook/webhook_suite_test.go | 4 ++-- 17 files changed, 21 insertions(+), 21 deletions(-) diff --git a/pkg/builder/builder_suite_test.go b/pkg/builder/builder_suite_test.go index dd80062f71..5bcd177662 100644 --- a/pkg/builder/builder_suite_test.go +++ b/pkg/builder/builder_suite_test.go @@ -63,7 +63,7 @@ var _ = BeforeSuite(func() { webhook.DefaultPort, _, err = addr.Suggest("") Expect(err).NotTo(HaveOccurred()) -}, 60) +}) var _ = AfterSuite(func() { Expect(testenv.Stop()).To(Succeed()) diff --git a/pkg/cache/cache_suite_test.go b/pkg/cache/cache_suite_test.go index 7b16a76ef7..41da0353f4 100644 --- a/pkg/cache/cache_suite_test.go +++ b/pkg/cache/cache_suite_test.go @@ -50,7 +50,7 @@ var _ = BeforeSuite(func() { clientset, err = kubernetes.NewForConfig(cfg) Expect(err).NotTo(HaveOccurred()) -}, 60) +}) var _ = AfterSuite(func() { Expect(testenv.Stop()).To(Succeed()) diff --git a/pkg/certwatcher/certwatcher_suite_test.go b/pkg/certwatcher/certwatcher_suite_test.go index a81b8aafbb..ab04cec52e 100644 --- a/pkg/certwatcher/certwatcher_suite_test.go +++ b/pkg/certwatcher/certwatcher_suite_test.go @@ -40,10 +40,10 @@ func TestSource(t *testing.T) { var _ = BeforeSuite(func() { logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true))) -}, 60) +}) var _ = AfterSuite(func() { for _, file := range []string{certPath, keyPath} { _ = os.Remove(file) } -}, 60) +}) diff --git a/pkg/client/apiutil/apiutil_suite_test.go b/pkg/client/apiutil/apiutil_suite_test.go index b59ba1b9bb..479de99136 100644 --- a/pkg/client/apiutil/apiutil_suite_test.go +++ b/pkg/client/apiutil/apiutil_suite_test.go @@ -41,4 +41,4 @@ var _ = BeforeSuite(func() { // for things that technically need a rest.Config for defaulting, but don't actually use them cfg = &rest.Config{} -}, 60) +}) diff --git a/pkg/client/client_suite_test.go b/pkg/client/client_suite_test.go index 276c2b8106..56e765881d 100644 --- a/pkg/client/client_suite_test.go +++ b/pkg/client/client_suite_test.go @@ -55,7 +55,7 @@ var _ = BeforeSuite(func() { Expect(err).NotTo(HaveOccurred()) Expect(pkg.AddToScheme(scheme.Scheme)).NotTo(HaveOccurred()) -}, 60) +}) var _ = AfterSuite(func() { Expect(testenv.Stop()).To(Succeed()) diff --git a/pkg/client/config/config_suite_test.go b/pkg/client/config/config_suite_test.go index 7b4aaff311..d6891c462b 100644 --- a/pkg/client/config/config_suite_test.go +++ b/pkg/client/config/config_suite_test.go @@ -35,4 +35,4 @@ func TestConfig(t *testing.T) { var _ = BeforeSuite(func() { logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true))) -}, 60) +}) diff --git a/pkg/client/fake/client_suite_test.go b/pkg/client/fake/client_suite_test.go index 5dd0176fc8..154497cd90 100644 --- a/pkg/client/fake/client_suite_test.go +++ b/pkg/client/fake/client_suite_test.go @@ -35,4 +35,4 @@ func TestSource(t *testing.T) { var _ = BeforeSuite(func() { logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true))) -}, 60) +}) diff --git a/pkg/cluster/cluster_suite_test.go b/pkg/cluster/cluster_suite_test.go index 37a894d055..89f7a0c82c 100644 --- a/pkg/cluster/cluster_suite_test.go +++ b/pkg/cluster/cluster_suite_test.go @@ -63,7 +63,7 @@ var _ = BeforeSuite(func() { clientset, err = kubernetes.NewForConfig(cfg) Expect(err).NotTo(HaveOccurred()) -}, 60) +}) var _ = AfterSuite(func() { Expect(testenv.Stop()).To(Succeed()) diff --git a/pkg/controller/controller_suite_test.go b/pkg/controller/controller_suite_test.go index 51ce76ef86..f47ce13095 100644 --- a/pkg/controller/controller_suite_test.go +++ b/pkg/controller/controller_suite_test.go @@ -82,7 +82,7 @@ var _ = BeforeSuite(func() { // Prevent the metrics listener being created metrics.DefaultBindAddress = "0" -}, 60) +}) var _ = AfterSuite(func() { Expect(testenv.Stop()).To(Succeed()) diff --git a/pkg/envtest/envtest_suite_test.go b/pkg/envtest/envtest_suite_test.go index 95d9ce6ca8..fac2d6f0bd 100644 --- a/pkg/envtest/envtest_suite_test.go +++ b/pkg/envtest/envtest_suite_test.go @@ -44,7 +44,7 @@ var _ = BeforeSuite(func() { initializeWebhookInEnvironment() _, err := env.Start() Expect(err).NotTo(HaveOccurred()) -}, StartTimeout) +}) func initializeWebhookInEnvironment() { namespacedScopeV1 := admissionv1.NamespacedScope @@ -133,4 +133,4 @@ func initializeWebhookInEnvironment() { var _ = AfterSuite(func() { Expect(env.Stop()).NotTo(HaveOccurred()) -}, StopTimeout) +}) diff --git a/pkg/internal/controller/controller_suite_test.go b/pkg/internal/controller/controller_suite_test.go index 4a8d3a359f..bb96e3e645 100644 --- a/pkg/internal/controller/controller_suite_test.go +++ b/pkg/internal/controller/controller_suite_test.go @@ -50,7 +50,7 @@ var _ = BeforeSuite(func() { clientset, err = kubernetes.NewForConfig(cfg) Expect(err).NotTo(HaveOccurred()) -}, 60) +}) var _ = AfterSuite(func() { Expect(testenv.Stop()).To(Succeed()) diff --git a/pkg/internal/recorder/recorder_suite_test.go b/pkg/internal/recorder/recorder_suite_test.go index e69dab170e..cb71922b0e 100644 --- a/pkg/internal/recorder/recorder_suite_test.go +++ b/pkg/internal/recorder/recorder_suite_test.go @@ -50,7 +50,7 @@ var _ = BeforeSuite(func() { clientset, err = kubernetes.NewForConfig(cfg) Expect(err).NotTo(HaveOccurred()) -}, 60) +}) var _ = AfterSuite(func() { Expect(testenv.Stop()).To(Succeed()) diff --git a/pkg/manager/manager_suite_test.go b/pkg/manager/manager_suite_test.go index a8efb48ded..a630264e03 100644 --- a/pkg/manager/manager_suite_test.go +++ b/pkg/manager/manager_suite_test.go @@ -72,7 +72,7 @@ var _ = BeforeSuite(func() { // Prevent the metrics listener being created metrics.DefaultBindAddress = "0" -}, 60) +}) var _ = AfterSuite(func() { Expect(testenv.Stop()).To(Succeed()) diff --git a/pkg/source/source_suite_test.go b/pkg/source/source_suite_test.go index c6dfc68ddf..f91ef3ff07 100644 --- a/pkg/source/source_suite_test.go +++ b/pkg/source/source_suite_test.go @@ -64,9 +64,9 @@ var _ = BeforeSuite(func() { defer GinkgoRecover() Expect(icache.Start(ctx)).NotTo(HaveOccurred()) }() -}, 60) +}) var _ = AfterSuite(func() { cancel() Expect(testenv.Stop()).To(Succeed()) -}, 5) +}) diff --git a/pkg/webhook/admission/admission_suite_test.go b/pkg/webhook/admission/admission_suite_test.go index 8e605dbf8f..07c632b59e 100644 --- a/pkg/webhook/admission/admission_suite_test.go +++ b/pkg/webhook/admission/admission_suite_test.go @@ -35,4 +35,4 @@ func TestAdmissionWebhook(t *testing.T) { var _ = BeforeSuite(func() { logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true))) -}, 60) +}) diff --git a/pkg/webhook/authentication/authentication_suite_test.go b/pkg/webhook/authentication/authentication_suite_test.go index 94083c53bd..c74fc2bac4 100644 --- a/pkg/webhook/authentication/authentication_suite_test.go +++ b/pkg/webhook/authentication/authentication_suite_test.go @@ -35,4 +35,4 @@ func TestAuthenticationWebhook(t *testing.T) { var _ = BeforeSuite(func() { logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true))) -}, 60) +}) diff --git a/pkg/webhook/webhook_suite_test.go b/pkg/webhook/webhook_suite_test.go index 9b8de74d3d..99e6d71b4a 100644 --- a/pkg/webhook/webhook_suite_test.go +++ b/pkg/webhook/webhook_suite_test.go @@ -50,12 +50,12 @@ var _ = BeforeSuite(func() { var err error cfg, err = testenv.Start() Expect(err).NotTo(HaveOccurred()) -}, 60) +}) var _ = AfterSuite(func() { fmt.Println("stopping?") Expect(testenv.Stop()).To(Succeed()) -}, 60) +}) func initializeWebhookInEnvironment() { namespacedScopeV1 := admissionv1.NamespacedScope From 486e94d64678272c0aaa1ed4c9688d6b00eab44d Mon Sep 17 00:00:00 2001 From: acumino Date: Fri, 4 Feb 2022 22:51:50 +0530 Subject: [PATCH 06/13] Remove It specific timeout --- pkg/builder/controller_test.go | 4 +- pkg/cache/cache_test.go | 8 +-- pkg/client/client_test.go | 52 +++++++++---------- pkg/client/watch_test.go | 10 ++-- pkg/controller/controller_integration_test.go | 2 +- pkg/envtest/envtest_test.go | 30 +++++------ pkg/source/source_integration_test.go | 4 +- 7 files changed, 54 insertions(+), 56 deletions(-) diff --git a/pkg/builder/controller_test.go b/pkg/builder/controller_test.go index bd95227eac..51df53c5ae 100644 --- a/pkg/builder/controller_test.go +++ b/pkg/builder/controller_test.go @@ -321,7 +321,7 @@ var _ = Describe("application", func() { ctx, cancel := context.WithCancel(context.Background()) defer cancel() doReconcileTest(ctx, "3", m, false, bldr) - }, 10) + }) It("should Reconcile Watches objects", func() { m, err := manager.New(cfg, manager.Options{}) @@ -336,7 +336,7 @@ var _ = Describe("application", func() { ctx, cancel := context.WithCancel(context.Background()) defer cancel() doReconcileTest(ctx, "4", m, true, bldr) - }, 10) + }) }) Describe("Set custom predicates", func() { diff --git a/pkg/cache/cache_test.go b/pkg/cache/cache_test.go index b8330c3a8e..7f49cd85ec 100644 --- a/pkg/cache/cache_test.go +++ b/pkg/cache/cache_test.go @@ -1539,7 +1539,7 @@ func CacheTest(createCacheFunc func(config *rest.Config, opts cache.Options) (ca By("verifying the object is received on the channel") Eventually(out).Should(Receive(Equal(pod))) - }, 3) + }) It("should be able to index an object field then retrieve objects by that field", func() { By("creating the cache") @@ -1589,7 +1589,7 @@ func CacheTest(createCacheFunc func(config *rest.Config, opts cache.Options) (ca Expect(listObj.Items).Should(HaveLen(1)) actual := listObj.Items[0] Expect(actual.GetName()).To(Equal("test-pod-3")) - }, 3) + }) It("should allow for get informer to be cancelled", func() { By("cancelling the context") @@ -1659,7 +1659,7 @@ func CacheTest(createCacheFunc func(config *rest.Config, opts cache.Options) (ca By("verifying the object's metadata is received on the channel") Eventually(out).Should(Receive(Equal(podMeta))) - }, 3) + }) It("should be able to index an object field then retrieve objects by that field", func() { By("creating the cache") @@ -1713,7 +1713,7 @@ func CacheTest(createCacheFunc func(config *rest.Config, opts cache.Options) (ca Version: "v1", Kind: "Pod", })) - }, 3) + }) It("should allow for get informer to be cancelled", func() { By("creating a context and cancelling it") diff --git a/pkg/client/client_test.go b/pkg/client/client_test.go index 6fb693e926..7292ac251e 100644 --- a/pkg/client/client_test.go +++ b/pkg/client/client_test.go @@ -38,8 +38,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" ) -const serverSideTimeoutSeconds = 10 - func deleteDeployment(ctx context.Context, dep *appsv1.Deployment, ns string) { _, err := clientset.AppsV1().Deployments(ns).Get(ctx, dep.Name, metav1.GetOptions{}) if err == nil { @@ -167,7 +165,7 @@ var _ = Describe("Client", func() { Spec: corev1.NodeSpec{}, } scheme = kscheme.Scheme - }, serverSideTimeoutSeconds) + }) var delOptions *metav1.DeleteOptions AfterEach(func() { @@ -184,7 +182,7 @@ var _ = Describe("Client", func() { err = clientset.CoreV1().Nodes().Delete(ctx, node.Name, *delOptions) Expect(err).NotTo(HaveOccurred()) } - }, serverSideTimeoutSeconds) + }) // TODO(seans): Cast "cl" as "client" struct from "Client" interface. Then validate the // instance values for the "client" struct. @@ -294,7 +292,7 @@ var _ = Describe("Client", func() { Expect(err).To(HaveOccurred()) // TODO(seans): Add test to validate the returned error. Problems currently with // different returned error locally versus travis. - }, serverSideTimeoutSeconds) + }) It("should fail if the object cannot be mapped to a GVK", func() { By("creating client with empty Scheme") @@ -431,7 +429,7 @@ var _ = Describe("Client", func() { Expect(err).To(HaveOccurred()) // TODO(seans): Add test to validate the returned error. Problems currently with // different returned error locally versus travis. - }, serverSideTimeoutSeconds) + }) }) @@ -1646,7 +1644,7 @@ var _ = Describe("Client", func() { } } Expect(hasDep).To(BeTrue()) - }, serverSideTimeoutSeconds) + }) It("should fetch unstructured collection of objects", func() { By("create an initial object") @@ -1680,7 +1678,7 @@ var _ = Describe("Client", func() { } } Expect(hasDep).To(BeTrue()) - }, serverSideTimeoutSeconds) + }) It("should fetch unstructured collection of objects, even if scheme is empty", func() { By("create an initial object") @@ -1709,7 +1707,7 @@ var _ = Describe("Client", func() { } } Expect(hasDep).To(BeTrue()) - }, serverSideTimeoutSeconds) + }) It("should return an empty list if there are no matching objects", func() { cl, err := client.New(cfg, client.Options{}) @@ -1721,7 +1719,7 @@ var _ = Describe("Client", func() { By("validating no Deployments are returned") Expect(deps.Items).To(BeEmpty()) - }, serverSideTimeoutSeconds) + }) // TODO(seans): get label selector test working It("should filter results by label selector", func() { @@ -1782,7 +1780,7 @@ var _ = Describe("Client", func() { deleteDeployment(ctx, depFrontend, ns) deleteDeployment(ctx, depBackend, ns) - }, serverSideTimeoutSeconds) + }) It("should filter results by namespace selector", func() { By("creating a Deployment in test-namespace-1") @@ -1841,7 +1839,7 @@ var _ = Describe("Client", func() { deleteDeployment(ctx, depBackend, "test-namespace-2") deleteNamespace(ctx, tns1) deleteNamespace(ctx, tns2) - }, serverSideTimeoutSeconds) + }) It("should filter results by field selector", func() { By("creating a Deployment with name deployment-frontend") @@ -1893,7 +1891,7 @@ var _ = Describe("Client", func() { deleteDeployment(ctx, depFrontend, ns) deleteDeployment(ctx, depBackend, ns) - }, serverSideTimeoutSeconds) + }) It("should filter results by namespace selector and label selector", func() { By("creating a Deployment in test-namespace-3 with the app=frontend label") @@ -1986,7 +1984,7 @@ var _ = Describe("Client", func() { deleteDeployment(ctx, depFrontend4, "test-namespace-4") deleteNamespace(ctx, tns3) deleteNamespace(ctx, tns4) - }, serverSideTimeoutSeconds) + }) It("should filter results using limit and continue options", func() { @@ -2069,7 +2067,7 @@ var _ = Describe("Client", func() { Expect(deps.Continue).To(BeEmpty()) Expect(deps.Items[0].Name).To(Equal(dep3.Name)) Expect(deps.Items[1].Name).To(Equal(dep4.Name)) - }, serverSideTimeoutSeconds) + }) PIt("should fail if the object doesn't have meta", func() { @@ -2112,7 +2110,7 @@ var _ = Describe("Client", func() { } } Expect(hasDep).To(BeTrue()) - }, serverSideTimeoutSeconds) + }) It("should return an empty list if there are no matching objects", func() { cl, err := client.New(cfg, client.Options{}) @@ -2129,7 +2127,7 @@ var _ = Describe("Client", func() { By("validating no Deployments are returned") Expect(deps.Items).To(BeEmpty()) - }, serverSideTimeoutSeconds) + }) It("should filter results by namespace selector", func() { By("creating a Deployment in test-namespace-5") @@ -2193,7 +2191,7 @@ var _ = Describe("Client", func() { deleteDeployment(ctx, depBackend, "test-namespace-6") deleteNamespace(ctx, tns1) deleteNamespace(ctx, tns2) - }, serverSideTimeoutSeconds) + }) It("should filter results by field selector", func() { By("creating a Deployment with name deployment-frontend") @@ -2250,7 +2248,7 @@ var _ = Describe("Client", func() { deleteDeployment(ctx, depFrontend, ns) deleteDeployment(ctx, depBackend, ns) - }, serverSideTimeoutSeconds) + }) It("should filter results by namespace selector and label selector", func() { By("creating a Deployment in test-namespace-7 with the app=frontend label") @@ -2346,7 +2344,7 @@ var _ = Describe("Client", func() { deleteDeployment(ctx, depFrontend4, "test-namespace-8") deleteNamespace(ctx, tns3) deleteNamespace(ctx, tns4) - }, serverSideTimeoutSeconds) + }) PIt("should fail if the object doesn't have meta", func() { @@ -2394,7 +2392,7 @@ var _ = Describe("Client", func() { } } Expect(hasDep).To(BeTrue()) - }, serverSideTimeoutSeconds) + }) It("should return an empty list if there are no matching objects", func() { cl, err := client.New(cfg, client.Options{}) @@ -2411,7 +2409,7 @@ var _ = Describe("Client", func() { By("validating no Deployments are returned") Expect(metaList.Items).To(BeEmpty()) - }, serverSideTimeoutSeconds) + }) // TODO(seans): get label selector test working It("should filter results by label selector", func() { @@ -2477,7 +2475,7 @@ var _ = Describe("Client", func() { deleteDeployment(ctx, depFrontend, ns) deleteDeployment(ctx, depBackend, ns) - }, serverSideTimeoutSeconds) + }) It("should filter results by namespace selector", func() { By("creating a Deployment in test-namespace-1") @@ -2541,7 +2539,7 @@ var _ = Describe("Client", func() { deleteDeployment(ctx, depBackend, "test-namespace-2") deleteNamespace(ctx, tns1) deleteNamespace(ctx, tns2) - }, serverSideTimeoutSeconds) + }) It("should filter results by field selector", func() { By("creating a Deployment with name deployment-frontend") @@ -2598,7 +2596,7 @@ var _ = Describe("Client", func() { deleteDeployment(ctx, depFrontend, ns) deleteDeployment(ctx, depBackend, ns) - }, serverSideTimeoutSeconds) + }) It("should filter results by namespace selector and label selector", func() { By("creating a Deployment in test-namespace-3 with the app=frontend label") @@ -2696,7 +2694,7 @@ var _ = Describe("Client", func() { deleteDeployment(ctx, depFrontend4, "test-namespace-4") deleteNamespace(ctx, tns3) deleteNamespace(ctx, tns4) - }, serverSideTimeoutSeconds) + }) It("should filter results using limit and continue options", func() { @@ -2794,7 +2792,7 @@ var _ = Describe("Client", func() { Expect(metaList.Continue).To(BeEmpty()) Expect(metaList.Items[0].Name).To(Equal(dep3.Name)) Expect(metaList.Items[1].Name).To(Equal(dep4.Name)) - }, serverSideTimeoutSeconds) + }) PIt("should fail if the object doesn't have meta", func() { diff --git a/pkg/client/watch_test.go b/pkg/client/watch_test.go index 9ddd51901b..4770e1e56a 100644 --- a/pkg/client/watch_test.go +++ b/pkg/client/watch_test.go @@ -59,11 +59,11 @@ var _ = Describe("ClientWithWatch", func() { var err error dep, err = clientset.AppsV1().Deployments(ns).Create(ctx, dep, metav1.CreateOptions{}) Expect(err).NotTo(HaveOccurred()) - }, serverSideTimeoutSeconds) + }) AfterEach(func() { deleteDeployment(ctx, dep, ns) - }, serverSideTimeoutSeconds) + }) Describe("NewWithWatch", func() { It("should return a new Client", func() { @@ -103,7 +103,7 @@ var _ = Describe("ClientWithWatch", func() { It("should receive a create event when watching the typed object", func() { watchSuite(&appsv1.DeploymentList{}, &appsv1.Deployment{}) - }, 15) + }) It("should receive a create event when watching the unstructured object", func() { u := &unstructured.UnstructuredList{} @@ -113,12 +113,12 @@ var _ = Describe("ClientWithWatch", func() { Version: "v1", }) watchSuite(u, &unstructured.Unstructured{}) - }, 15) + }) It("should receive a create event when watching the metadata object", func() { m := &metav1.PartialObjectMetadataList{TypeMeta: metav1.TypeMeta{Kind: "Deployment", APIVersion: "apps/v1"}} watchSuite(m, &metav1.PartialObjectMetadata{}) - }, 15) + }) }) }) diff --git a/pkg/controller/controller_integration_test.go b/pkg/controller/controller_integration_test.go index 70e4a5f761..3ddd2ccf60 100644 --- a/pkg/controller/controller_integration_test.go +++ b/pkg/controller/controller_integration_test.go @@ -169,7 +169,7 @@ var _ = Describe("controller", func() { err = cm.GetClient(). List(context.Background(), &controllertest.UnconventionalListTypeList{}) Expect(err).NotTo(HaveOccurred()) - }, 5) + }) }) }) diff --git a/pkg/envtest/envtest_test.go b/pkg/envtest/envtest_test.go index c19a1241d1..21464e10be 100644 --- a/pkg/envtest/envtest_test.go +++ b/pkg/envtest/envtest_test.go @@ -243,7 +243,7 @@ var _ = Describe("Test", func() { CRDInstallOptions{MaxTime: 50 * time.Millisecond, PollInterval: 15 * time.Millisecond}, ) Expect(err).NotTo(HaveOccurred()) - }, 5) + }) It("should install the CRDs into the cluster using file", func() { crds, err = InstallCRDs(env.Config, CRDInstallOptions{ @@ -278,7 +278,7 @@ var _ = Describe("Test", func() { CRDInstallOptions{MaxTime: 50 * time.Millisecond, PollInterval: 15 * time.Millisecond}, ) Expect(err).NotTo(HaveOccurred()) - }, 10) + }) It("should be able to install CRDs using multiple files", func() { crds, err = InstallCRDs(env.Config, CRDInstallOptions{ @@ -289,7 +289,7 @@ var _ = Describe("Test", func() { }) Expect(err).NotTo(HaveOccurred()) Expect(crds).To(HaveLen(2)) - }, 10) + }) It("should filter out already existent CRD", func() { crds, err = InstallCRDs(env.Config, CRDInstallOptions{ @@ -329,26 +329,26 @@ var _ = Describe("Test", func() { CRDInstallOptions{MaxTime: 50 * time.Millisecond, PollInterval: 15 * time.Millisecond}, ) Expect(err).NotTo(HaveOccurred()) - }, 10) + }) It("should not return an not error if the directory doesn't exist", func() { crds, err = InstallCRDs(env.Config, CRDInstallOptions{Paths: []string{invalidDirectory}}) Expect(err).NotTo(HaveOccurred()) - }, 5) + }) It("should return an error if the directory doesn't exist", func() { crds, err = InstallCRDs(env.Config, CRDInstallOptions{ Paths: []string{invalidDirectory}, ErrorIfPathMissing: true, }) Expect(err).To(HaveOccurred()) - }, 5) + }) It("should return an error if the file doesn't exist", func() { crds, err = InstallCRDs(env.Config, CRDInstallOptions{Paths: []string{ filepath.Join(".", "testdata", "fake.yaml")}, ErrorIfPathMissing: true, }) Expect(err).To(HaveOccurred()) - }, 5) + }) It("should return an error if the resource group version isn't found", func() { // Wait for a CRD where the Group and Version don't exist @@ -374,7 +374,7 @@ var _ = Describe("Test", func() { CRDInstallOptions{MaxTime: 50 * time.Millisecond, PollInterval: 15 * time.Millisecond}, ) Expect(err).To(HaveOccurred()) - }, 5) + }) It("should return an error if the resource isn't found in the group version", func() { crds, err = InstallCRDs(env.Config, CRDInstallOptions{ @@ -421,7 +421,7 @@ var _ = Describe("Test", func() { CRDInstallOptions{MaxTime: 50 * time.Millisecond, PollInterval: 15 * time.Millisecond}, ) Expect(err).To(HaveOccurred()) - }, 5) + }) It("should reinstall the CRDs if already present in the cluster", func() { @@ -680,7 +680,7 @@ var _ = Describe("Test", func() { CRDInstallOptions{MaxTime: 50 * time.Millisecond, PollInterval: 15 * time.Millisecond}, ) Expect(err).NotTo(HaveOccurred()) - }, 5) + }) }) It("should update CRDs if already present in the cluster", func() { @@ -771,7 +771,7 @@ var _ = Describe("Test", func() { CRDInstallOptions{MaxTime: 50 * time.Millisecond, PollInterval: 15 * time.Millisecond}, ) Expect(err).NotTo(HaveOccurred()) - }, 5) + }) Describe("UninstallCRDs", func() { It("should uninstall the CRDs from the cluster", func() { @@ -928,7 +928,7 @@ var _ = Describe("Test", func() { } return true }, 20).Should(BeTrue()) - }, 30) + }) }) Describe("Start", func() { @@ -937,14 +937,14 @@ var _ = Describe("Test", func() { _, err := env.Start() Expect(err).To(HaveOccurred()) Expect(env.Stop()).To(Succeed()) - }, 30) + }) It("should not raise an error on invalid dir when flag is disabled", func() { env := &Environment{ErrorIfCRDPathMissing: false, CRDDirectoryPaths: []string{invalidDirectory}} _, err := env.Start() Expect(err).NotTo(HaveOccurred()) Expect(env.Stop()).To(Succeed()) - }, 30) + }) }) Describe("Stop", func() { @@ -956,6 +956,6 @@ var _ = Describe("Test", func() { // check if the /tmp/envtest-serving-certs-* dir doesnt exists any more Expect(env.WebhookInstallOptions.LocalServingCertDir).ShouldNot(BeADirectory()) - }, 30) + }) }) }) diff --git a/pkg/source/source_integration_test.go b/pkg/source/source_integration_test.go index a41eb8d744..c7b3da39e2 100644 --- a/pkg/source/source_integration_test.go +++ b/pkg/source/source_integration_test.go @@ -188,7 +188,7 @@ var _ = Describe("Source", func() { Expect(ok).To(BeTrue(), fmt.Sprintf("expect %T to be %T", evt, event.DeleteEvent{})) deleteEvt.Object.SetResourceVersion("") Expect(deleteEvt.Object).To(Equal(deleted)) - }, 5) + }) }) // TODO(pwittrock): Write this test @@ -274,7 +274,7 @@ var _ = Describe("Source", func() { _, err = clientset.AppsV1().ReplicaSets("default").Create(ctx, rs, metav1.CreateOptions{}) Expect(err).NotTo(HaveOccurred()) <-c - }, 30) + }) It("should provide a ReplicaSet UpdateEvent", func() { var err error From c784cdfe7dfa5aaaef162f2b9bbb7dbd1474dbf4 Mon Sep 17 00:00:00 2001 From: acumino Date: Sat, 5 Feb 2022 15:36:58 +0530 Subject: [PATCH 07/13] Adapt custom reporter to changed reporting infrastructure This is only a temporary adaption, as we are using the temporary compatibility layer, which will be removed again soon. Hence, we have to rework this and adapt for the long-term. --- pkg/builder/builder_suite_test.go | 11 ++++++++-- pkg/cache/cache_suite_test.go | 11 ++++++++-- pkg/certwatcher/certwatcher_suite_test.go | 14 +++++++++---- pkg/client/apiutil/apiutil_suite_test.go | 11 ++++++++-- pkg/client/client_suite_test.go | 11 ++++++++-- pkg/client/config/config_suite_test.go | 11 ++++++++-- pkg/client/fake/client_suite_test.go | 11 ++++++++-- pkg/cluster/cluster_suite_test.go | 11 ++++++++-- pkg/config/config_suite_test.go | 11 ++++++++-- pkg/controller/controller_suite_test.go | 11 ++++++++-- .../controllerutil_suite_test.go | 11 ++++++++-- pkg/envtest/envtest_suite_test.go | 11 ++++++++-- pkg/envtest/printer/ginkgo.go | 15 +++++++------ pkg/envtest/printer/prow.go | 21 +++++++++---------- pkg/finalizer/finalizer_test.go | 12 +++++++++-- pkg/handler/eventhandler_suite_test.go | 11 ++++++++-- pkg/healthz/healthz_suite_test.go | 11 ++++++++-- .../controller/controller_suite_test.go | 11 ++++++++-- pkg/internal/recorder/recorder_suite_test.go | 11 ++++++++-- pkg/internal/testing/addr/addr_suite_test.go | 11 ++++++++-- .../testing/certs/certs_suite_test.go | 11 ++++++++-- .../controlplane/controlplane_suite_test.go | 11 ++++++++-- .../testing/process/process_suite_test.go | 11 ++++++++-- pkg/log/log_suite_test.go | 11 ++++++++-- pkg/log/zap/zap_suite_test.go | 11 ++++++++-- pkg/manager/manager_suite_test.go | 11 ++++++++-- pkg/manager/signals/signals_suite_test.go | 11 ++++++++-- pkg/predicate/predicate_suite_test.go | 11 ++++++++-- pkg/reconcile/reconcile_suite_test.go | 11 ++++++++-- pkg/runtime/inject/inject_suite_test.go | 11 ++++++++-- pkg/scheme/scheme_suite_test.go | 11 ++++++++-- pkg/source/internal/internal_suite_test.go | 11 ++++++++-- pkg/source/source_suite_test.go | 11 ++++++++-- pkg/webhook/admission/admission_suite_test.go | 11 ++++++++-- .../authentication_suite_test.go | 11 ++++++++-- .../conversion/conversion_suite_test.go | 11 ++++++++-- pkg/webhook/webhook_suite_test.go | 11 ++++++++-- 37 files changed, 334 insertions(+), 91 deletions(-) diff --git a/pkg/builder/builder_suite_test.go b/pkg/builder/builder_suite_test.go index 5bcd177662..59f9dd3f9e 100644 --- a/pkg/builder/builder_suite_test.go +++ b/pkg/builder/builder_suite_test.go @@ -20,6 +20,7 @@ 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" @@ -36,10 +37,11 @@ import ( "sigs.k8s.io/controller-runtime/pkg/webhook" ) +var suiteName = "application Suite" + func TestBuilder(t *testing.T) { RegisterFailHandler(Fail) - suiteName := "application Suite" - RunSpecsWithDefaultAndCustomReporters(t, suiteName, []Reporter{printer.NewlineReporter{}, printer.NewProwReporter(suiteName)}) + RunSpecs(t, suiteName) } var testenv *envtest.Environment @@ -75,6 +77,11 @@ var _ = AfterSuite(func() { webhook.DefaultPort = 9443 }) +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 +}) + func addCRDToEnvironment(env *envtest.Environment, gvks ...schema.GroupVersionKind) { for _, gvk := range gvks { plural, singular := meta.UnsafeGuessKindToResource(gvk) diff --git a/pkg/cache/cache_suite_test.go b/pkg/cache/cache_suite_test.go index 41da0353f4..5361001aad 100644 --- a/pkg/cache/cache_suite_test.go +++ b/pkg/cache/cache_suite_test.go @@ -20,6 +20,7 @@ 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" @@ -29,10 +30,11 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) +var suiteName = "Cache Suite" + func TestSource(t *testing.T) { RegisterFailHandler(Fail) - suiteName := "Cache Suite" - RunSpecsWithDefaultAndCustomReporters(t, suiteName, []Reporter{printer.NewlineReporter{}, printer.NewProwReporter(suiteName)}) + RunSpecs(t, suiteName) } var testenv *envtest.Environment @@ -55,3 +57,8 @@ var _ = BeforeSuite(func() { var _ = AfterSuite(func() { Expect(testenv.Stop()).To(Succeed()) }) + +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 +}) diff --git a/pkg/certwatcher/certwatcher_suite_test.go b/pkg/certwatcher/certwatcher_suite_test.go index ab04cec52e..4da29ba64e 100644 --- a/pkg/certwatcher/certwatcher_suite_test.go +++ b/pkg/certwatcher/certwatcher_suite_test.go @@ -21,6 +21,7 @@ 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" @@ -28,14 +29,14 @@ import ( ) var ( - certPath = "testdata/tls.crt" - keyPath = "testdata/tls.key" + certPath = "testdata/tls.crt" + keyPath = "testdata/tls.key" + suiteName = "CertWatcher Suite" ) func TestSource(t *testing.T) { RegisterFailHandler(Fail) - suiteName := "CertWatcher Suite" - RunSpecsWithDefaultAndCustomReporters(t, suiteName, []Reporter{printer.NewlineReporter{}, printer.NewProwReporter(suiteName)}) + RunSpecs(t, suiteName) } var _ = BeforeSuite(func() { @@ -47,3 +48,8 @@ var _ = AfterSuite(func() { _ = os.Remove(file) } }) + +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 +}) diff --git a/pkg/client/apiutil/apiutil_suite_test.go b/pkg/client/apiutil/apiutil_suite_test.go index 479de99136..ae5c3b1728 100644 --- a/pkg/client/apiutil/apiutil_suite_test.go +++ b/pkg/client/apiutil/apiutil_suite_test.go @@ -20,6 +20,7 @@ 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" @@ -28,10 +29,11 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) +var suiteName = "API Utilities Test Suite" + func TestSource(t *testing.T) { RegisterFailHandler(Fail) - suiteName := "API Utilities Test Suite" - RunSpecsWithDefaultAndCustomReporters(t, suiteName, []Reporter{printer.NewlineReporter{}, printer.NewProwReporter(suiteName)}) + RunSpecs(t, suiteName) } var cfg *rest.Config @@ -42,3 +44,8 @@ var _ = BeforeSuite(func() { // for things that technically need a rest.Config for defaulting, but don't actually use them cfg = &rest.Config{} }) + +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 +}) diff --git a/pkg/client/client_suite_test.go b/pkg/client/client_suite_test.go index 56e765881d..73fc6962fd 100644 --- a/pkg/client/client_suite_test.go +++ b/pkg/client/client_suite_test.go @@ -20,6 +20,7 @@ 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" @@ -32,10 +33,11 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) +var suiteName = "Client Suite" + func TestSource(t *testing.T) { RegisterFailHandler(Fail) - suiteName := "Client Suite" - RunSpecsWithDefaultAndCustomReporters(t, suiteName, []Reporter{printer.NewlineReporter{}, printer.NewProwReporter(suiteName)}) + RunSpecs(t, suiteName) } var testenv *envtest.Environment @@ -60,3 +62,8 @@ var _ = BeforeSuite(func() { var _ = AfterSuite(func() { Expect(testenv.Stop()).To(Succeed()) }) + +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 +}) diff --git a/pkg/client/config/config_suite_test.go b/pkg/client/config/config_suite_test.go index d6891c462b..56e0389a97 100644 --- a/pkg/client/config/config_suite_test.go +++ b/pkg/client/config/config_suite_test.go @@ -20,6 +20,7 @@ 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" @@ -27,12 +28,18 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) +var suiteName = "Client Config Test Suite" + func TestConfig(t *testing.T) { RegisterFailHandler(Fail) - suiteName := "Client Config Test Suite" - RunSpecsWithDefaultAndCustomReporters(t, suiteName, []Reporter{printer.NewlineReporter{}, printer.NewProwReporter(suiteName)}) + RunSpecs(t, suiteName) } var _ = BeforeSuite(func() { logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true))) }) + +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 +}) diff --git a/pkg/client/fake/client_suite_test.go b/pkg/client/fake/client_suite_test.go index 154497cd90..d22fbbb8bb 100644 --- a/pkg/client/fake/client_suite_test.go +++ b/pkg/client/fake/client_suite_test.go @@ -20,6 +20,7 @@ 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" @@ -27,12 +28,18 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) +var suiteName = "Fake client Suite" + func TestSource(t *testing.T) { RegisterFailHandler(Fail) - suiteName := "Fake client Suite" - RunSpecsWithDefaultAndCustomReporters(t, suiteName, []Reporter{printer.NewlineReporter{}, printer.NewProwReporter(suiteName)}) + RunSpecs(t, suiteName) } var _ = BeforeSuite(func() { logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true))) }) + +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 +}) diff --git a/pkg/cluster/cluster_suite_test.go b/pkg/cluster/cluster_suite_test.go index 89f7a0c82c..14c599fc1a 100644 --- a/pkg/cluster/cluster_suite_test.go +++ b/pkg/cluster/cluster_suite_test.go @@ -21,6 +21,7 @@ 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" @@ -30,10 +31,11 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) +var suiteName = "Cluster Suite" + func TestSource(t *testing.T) { RegisterFailHandler(Fail) - suiteName := "Cluster Suite" - RunSpecsWithDefaultAndCustomReporters(t, suiteName, []Reporter{printer.NewlineReporter{}, printer.NewProwReporter(suiteName)}) + RunSpecs(t, suiteName) } var testenv *envtest.Environment @@ -68,3 +70,8 @@ var _ = BeforeSuite(func() { var _ = AfterSuite(func() { Expect(testenv.Stop()).To(Succeed()) }) + +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 +}) diff --git a/pkg/config/config_suite_test.go b/pkg/config/config_suite_test.go index c94965ce66..f9728a575f 100644 --- a/pkg/config/config_suite_test.go +++ b/pkg/config/config_suite_test.go @@ -20,13 +20,20 @@ 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" ) +var suiteName = "Config Suite" + func TestScheme(t *testing.T) { RegisterFailHandler(Fail) - suiteName := "Config Suite" - RunSpecsWithDefaultAndCustomReporters(t, suiteName, []Reporter{printer.NewlineReporter{}, printer.NewProwReporter(suiteName)}) + RunSpecs(t, suiteName) } + +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 +}) diff --git a/pkg/controller/controller_suite_test.go b/pkg/controller/controller_suite_test.go index f47ce13095..df99f70f72 100644 --- a/pkg/controller/controller_suite_test.go +++ b/pkg/controller/controller_suite_test.go @@ -21,6 +21,7 @@ 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" @@ -36,10 +37,11 @@ import ( crscheme "sigs.k8s.io/controller-runtime/pkg/scheme" ) +var suiteName = "Controller Integration Suite" + func TestSource(t *testing.T) { RegisterFailHandler(Fail) - suiteName := "Controller Integration Suite" - RunSpecsWithDefaultAndCustomReporters(t, suiteName, []Reporter{printer.NewlineReporter{}, printer.NewProwReporter(suiteName)}) + RunSpecs(t, suiteName) } var testenv *envtest.Environment @@ -90,3 +92,8 @@ var _ = AfterSuite(func() { // Put the DefaultBindAddress back metrics.DefaultBindAddress = ":8080" }) + +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 +}) diff --git a/pkg/controller/controllerutil/controllerutil_suite_test.go b/pkg/controller/controllerutil/controllerutil_suite_test.go index 7c6363054f..e39805522f 100644 --- a/pkg/controller/controllerutil/controllerutil_suite_test.go +++ b/pkg/controller/controllerutil/controllerutil_suite_test.go @@ -20,6 +20,7 @@ import ( "testing" . "github.com/onsi/ginkgo/v2" + "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" "k8s.io/client-go/rest" @@ -28,10 +29,11 @@ import ( "sigs.k8s.io/controller-runtime/pkg/envtest/printer" ) +var suiteName = "Controllerutil Suite" + func TestControllerutil(t *testing.T) { RegisterFailHandler(Fail) - suiteName := "Controllerutil Suite" - RunSpecsWithDefaultAndCustomReporters(t, suiteName, []Reporter{printer.NewlineReporter{}, printer.NewProwReporter(suiteName)}) + RunSpecs(t, suiteName) } var testenv *envtest.Environment @@ -53,3 +55,8 @@ var _ = BeforeSuite(func() { var _ = AfterSuite(func() { Expect(testenv.Stop()).To(Succeed()) }) + +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 +}) diff --git a/pkg/envtest/envtest_suite_test.go b/pkg/envtest/envtest_suite_test.go index fac2d6f0bd..d4155601a1 100644 --- a/pkg/envtest/envtest_suite_test.go +++ b/pkg/envtest/envtest_suite_test.go @@ -20,6 +20,7 @@ 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" @@ -29,10 +30,11 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) +var suiteName = "Envtest Suite" + func TestSource(t *testing.T) { RegisterFailHandler(Fail) - suiteName := "Envtest Suite" - RunSpecsWithDefaultAndCustomReporters(t, suiteName, []Reporter{NewlineReporter{}, printer.NewProwReporter(suiteName)}) + RunSpecs(t, suiteName) } var env *Environment @@ -134,3 +136,8 @@ func initializeWebhookInEnvironment() { var _ = AfterSuite(func() { Expect(env.Stop()).NotTo(HaveOccurred()) }) + +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 +}) diff --git a/pkg/envtest/printer/ginkgo.go b/pkg/envtest/printer/ginkgo.go index 91573339fd..6e2ca7505c 100644 --- a/pkg/envtest/printer/ginkgo.go +++ b/pkg/envtest/printer/ginkgo.go @@ -21,21 +21,20 @@ package printer import ( "fmt" - "github.com/onsi/ginkgo/config" - "github.com/onsi/ginkgo/types" "github.com/onsi/ginkgo/v2" + "github.com/onsi/ginkgo/v2/config" + "github.com/onsi/ginkgo/v2/types" ) -var _ ginkgo.Reporter = NewlineReporter{} +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{} -// SpecSuiteWillBegin implements ginkgo.Reporter. -func (NewlineReporter) SpecSuiteWillBegin(config config.GinkgoConfigType, summary *types.SuiteSummary) { -} +// SuiteWillBegin implements ginkgo.Reporter. +func (NewlineReporter) SuiteWillBegin(config config.GinkgoConfigType, summary *types.SuiteSummary) {} // BeforeSuiteDidRun implements ginkgo.Reporter. func (NewlineReporter) BeforeSuiteDidRun(setupSummary *types.SetupSummary) {} @@ -49,5 +48,5 @@ func (NewlineReporter) SpecWillRun(specSummary *types.SpecSummary) {} // SpecDidComplete implements ginkgo.Reporter. func (NewlineReporter) SpecDidComplete(specSummary *types.SpecSummary) {} -// SpecSuiteDidEnd Prints a newline between "35 Passed | 0 Failed | 0 Pending | 0 Skipped" and "--- PASS:". -func (NewlineReporter) SpecSuiteDidEnd(summary *types.SuiteSummary) { fmt.Printf("\n") } +// 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 27d71675a1..1150c69bcc 100644 --- a/pkg/envtest/printer/prow.go +++ b/pkg/envtest/printer/prow.go @@ -22,10 +22,9 @@ import ( "path/filepath" "sync" - "github.com/onsi/ginkgo/config" - "github.com/onsi/ginkgo/reporters" - "github.com/onsi/ginkgo/types" - "github.com/onsi/ginkgo/v2" + "github.com/onsi/ginkgo/v2/config" + "github.com/onsi/ginkgo/v2/reporters" + "github.com/onsi/ginkgo/v2/types" "k8s.io/apimachinery/pkg/util/sets" ) @@ -45,7 +44,7 @@ type prowReporter struct { // 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) ginkgo.Reporter { +func NewProwReporter(suiteName string) reporters.DeprecatedReporter { //nolint // For migration of custom reporter check https://onsi.github.io/ginkgo/MIGRATING_TO_V2#migration-strategy-2 allRegisteredSuitesLock.Lock() if allRegisteredSuites.Has(suiteName) { panic(fmt.Sprintf("Suite named %q registered more than once", suiteName)) @@ -61,15 +60,15 @@ func NewProwReporter(suiteName string) ginkgo.Reporter { return &prowReporter{} } - path := filepath.Join(artifactsDir, fmt.Sprintf("junit_%s_%d.xml", suiteName, config.GinkgoConfig.ParallelNode)) + path := filepath.Join(artifactsDir, fmt.Sprintf("junit_%s.xml", suiteName)) return &prowReporter{ junitReporter: reporters.NewJUnitReporter(path), } } -func (pr *prowReporter) SpecSuiteWillBegin(config config.GinkgoConfigType, summary *types.SuiteSummary) { +func (pr *prowReporter) SuiteWillBegin(config config.GinkgoConfigType, summary *types.SuiteSummary) { if pr.junitReporter != nil { - pr.junitReporter.SpecSuiteWillBegin(config, summary) + pr.junitReporter.SuiteWillBegin(config, summary) } } @@ -101,9 +100,9 @@ func (pr *prowReporter) SpecDidComplete(specSummary *types.SpecSummary) { } } -// SpecSuiteDidEnd Prints a newline between "35 Passed | 0 Failed | 0 Pending | 0 Skipped" and "--- PASS:". -func (pr *prowReporter) SpecSuiteDidEnd(summary *types.SuiteSummary) { +// 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.SpecSuiteDidEnd(summary) + pr.junitReporter.SuiteDidEnd(summary) } } diff --git a/pkg/finalizer/finalizer_test.go b/pkg/finalizer/finalizer_test.go index 7cc437d598..a984fdd9b5 100644 --- a/pkg/finalizer/finalizer_test.go +++ b/pkg/finalizer/finalizer_test.go @@ -6,6 +6,7 @@ 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" @@ -21,10 +22,12 @@ type mockFinalizer struct { func (f mockFinalizer) Finalize(context.Context, client.Object) (Result, error) { return f.result, f.err } + +var suiteName = "Finalizer Suite" + func TestFinalizer(t *testing.T) { RegisterFailHandler(Fail) - suiteName := "Finalizer Suite" - RunSpecsWithDefaultAndCustomReporters(t, suiteName, []Reporter{printer.NewlineReporter{}, printer.NewProwReporter(suiteName)}) + RunSpecs(t, suiteName) } var _ = Describe("TestFinalizer", func() { @@ -214,3 +217,8 @@ 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 +}) diff --git a/pkg/handler/eventhandler_suite_test.go b/pkg/handler/eventhandler_suite_test.go index 99ebe8d03c..963bda0b80 100644 --- a/pkg/handler/eventhandler_suite_test.go +++ b/pkg/handler/eventhandler_suite_test.go @@ -20,6 +20,7 @@ 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" @@ -28,10 +29,11 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) +var suiteName = "Eventhandler Suite" + func TestEventhandler(t *testing.T) { RegisterFailHandler(Fail) - suiteName := "Eventhandler Suite" - RunSpecsWithDefaultAndCustomReporters(t, suiteName, []Reporter{printer.NewlineReporter{}, printer.NewProwReporter(suiteName)}) + RunSpecs(t, suiteName) } var testenv *envtest.Environment @@ -49,3 +51,8 @@ var _ = BeforeSuite(func() { var _ = AfterSuite(func() { Expect(testenv.Stop()).To(Succeed()) }) + +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 +}) diff --git a/pkg/healthz/healthz_suite_test.go b/pkg/healthz/healthz_suite_test.go index 58b5b1cb6b..5f779a7571 100644 --- a/pkg/healthz/healthz_suite_test.go +++ b/pkg/healthz/healthz_suite_test.go @@ -20,18 +20,25 @@ 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" "sigs.k8s.io/controller-runtime/pkg/log/zap" ) +var suiteName = "Healthz Suite" + func TestHealthz(t *testing.T) { RegisterFailHandler(Fail) - suiteName := "Healthz Suite" - RunSpecsWithDefaultAndCustomReporters(t, suiteName, []Reporter{printer.NewlineReporter{}, printer.NewProwReporter(suiteName)}) + RunSpecs(t, suiteName) } var _ = BeforeSuite(func() { logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true))) }) + +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 +}) diff --git a/pkg/internal/controller/controller_suite_test.go b/pkg/internal/controller/controller_suite_test.go index bb96e3e645..777a02be0d 100644 --- a/pkg/internal/controller/controller_suite_test.go +++ b/pkg/internal/controller/controller_suite_test.go @@ -20,6 +20,7 @@ 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" @@ -29,10 +30,11 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) +var suiteName = "Controller internal Suite" + func TestSource(t *testing.T) { RegisterFailHandler(Fail) - suiteName := "Controller internal Suite" - RunSpecsWithDefaultAndCustomReporters(t, suiteName, []Reporter{printer.NewlineReporter{}, printer.NewProwReporter(suiteName)}) + RunSpecs(t, suiteName) } var testenv *envtest.Environment @@ -55,3 +57,8 @@ var _ = BeforeSuite(func() { var _ = AfterSuite(func() { Expect(testenv.Stop()).To(Succeed()) }) + +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 +}) diff --git a/pkg/internal/recorder/recorder_suite_test.go b/pkg/internal/recorder/recorder_suite_test.go index cb71922b0e..8a156fc754 100644 --- a/pkg/internal/recorder/recorder_suite_test.go +++ b/pkg/internal/recorder/recorder_suite_test.go @@ -20,6 +20,7 @@ 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" @@ -29,10 +30,11 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) +var suiteName = "Recorder Integration Suite" + func TestRecorder(t *testing.T) { RegisterFailHandler(Fail) - suiteName := "Recorder Integration Suite" - RunSpecsWithDefaultAndCustomReporters(t, suiteName, []Reporter{printer.NewlineReporter{}, printer.NewProwReporter(suiteName)}) + RunSpecs(t, suiteName) } var testenv *envtest.Environment @@ -55,3 +57,8 @@ var _ = BeforeSuite(func() { var _ = AfterSuite(func() { Expect(testenv.Stop()).To(Succeed()) }) + +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 +}) diff --git a/pkg/internal/testing/addr/addr_suite_test.go b/pkg/internal/testing/addr/addr_suite_test.go index 0361d296d3..154a809766 100644 --- a/pkg/internal/testing/addr/addr_suite_test.go +++ b/pkg/internal/testing/addr/addr_suite_test.go @@ -20,14 +20,21 @@ 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" ) +var suiteName = "Addr Suite" + func TestAddr(t *testing.T) { t.Parallel() RegisterFailHandler(Fail) - suiteName := "Addr Suite" - RunSpecsWithDefaultAndCustomReporters(t, suiteName, []Reporter{printer.NewlineReporter{}, printer.NewProwReporter(suiteName)}) + RunSpecs(t, suiteName) } + +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 +}) diff --git a/pkg/internal/testing/certs/certs_suite_test.go b/pkg/internal/testing/certs/certs_suite_test.go index c4e49a3cff..b3201210bc 100644 --- a/pkg/internal/testing/certs/certs_suite_test.go +++ b/pkg/internal/testing/certs/certs_suite_test.go @@ -20,14 +20,21 @@ 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" ) +var suiteName = "TinyCA (Internal Certs) Suite" + func TestInternal(t *testing.T) { t.Parallel() RegisterFailHandler(Fail) - suiteName := "TinyCA (Internal Certs) Suite" - RunSpecsWithDefaultAndCustomReporters(t, suiteName, []Reporter{printer.NewlineReporter{}, printer.NewProwReporter(suiteName)}) + RunSpecs(t, suiteName) } + +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 +}) diff --git a/pkg/internal/testing/controlplane/controlplane_suite_test.go b/pkg/internal/testing/controlplane/controlplane_suite_test.go index 1fddd35554..3874a44d8e 100644 --- a/pkg/internal/testing/controlplane/controlplane_suite_test.go +++ b/pkg/internal/testing/controlplane/controlplane_suite_test.go @@ -20,14 +20,21 @@ 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" ) +var suiteName = "Control Plane Standup Unit Tests" + func TestIntegration(t *testing.T) { t.Parallel() RegisterFailHandler(Fail) - suiteName := "Control Plane Standup Unit Tests" - RunSpecsWithDefaultAndCustomReporters(t, suiteName, []Reporter{printer.NewlineReporter{}, printer.NewProwReporter(suiteName)}) + RunSpecs(t, suiteName) } + +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 +}) diff --git a/pkg/internal/testing/process/process_suite_test.go b/pkg/internal/testing/process/process_suite_test.go index 5914964457..039e82035d 100644 --- a/pkg/internal/testing/process/process_suite_test.go +++ b/pkg/internal/testing/process/process_suite_test.go @@ -20,14 +20,21 @@ 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" ) +var suiteName = "Envtest Process Launcher Suite" + func TestInternal(t *testing.T) { t.Parallel() RegisterFailHandler(Fail) - suiteName := "Envtest Process Launcher Suite" - RunSpecsWithDefaultAndCustomReporters(t, suiteName, []Reporter{printer.NewlineReporter{}, printer.NewProwReporter(suiteName)}) + RunSpecs(t, suiteName) } + +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 +}) diff --git a/pkg/log/log_suite_test.go b/pkg/log/log_suite_test.go index 0960b83330..bb276b41f3 100644 --- a/pkg/log/log_suite_test.go +++ b/pkg/log/log_suite_test.go @@ -20,12 +20,19 @@ 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" ) +var suiteName = "Log Suite" + func TestSource(t *testing.T) { RegisterFailHandler(Fail) - suiteName := "Log Suite" - RunSpecsWithDefaultAndCustomReporters(t, suiteName, []Reporter{printer.NewlineReporter{}, printer.NewProwReporter(suiteName)}) + RunSpecs(t, suiteName) } + +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 +}) diff --git a/pkg/log/zap/zap_suite_test.go b/pkg/log/zap/zap_suite_test.go index 472fe3aa4c..65e5f33e15 100644 --- a/pkg/log/zap/zap_suite_test.go +++ b/pkg/log/zap/zap_suite_test.go @@ -20,12 +20,19 @@ 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" ) +var suiteName = "Zap Log Suite" + func TestSource(t *testing.T) { RegisterFailHandler(Fail) - suiteName := "Zap Log Suite" - RunSpecsWithDefaultAndCustomReporters(t, suiteName, []Reporter{printer.NewlineReporter{}, printer.NewProwReporter(suiteName)}) + RunSpecs(t, suiteName) } + +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 +}) diff --git a/pkg/manager/manager_suite_test.go b/pkg/manager/manager_suite_test.go index a630264e03..283976e90b 100644 --- a/pkg/manager/manager_suite_test.go +++ b/pkg/manager/manager_suite_test.go @@ -22,6 +22,7 @@ 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" @@ -32,10 +33,11 @@ import ( "sigs.k8s.io/controller-runtime/pkg/metrics" ) +var suiteName = "Manager Suite" + func TestSource(t *testing.T) { RegisterFailHandler(Fail) - suiteName := "Manager Suite" - RunSpecsWithDefaultAndCustomReporters(t, suiteName, []Reporter{printer.NewlineReporter{}, printer.NewProwReporter(suiteName)}) + RunSpecs(t, suiteName) } var testenv *envtest.Environment @@ -80,3 +82,8 @@ var _ = AfterSuite(func() { // Put the DefaultBindAddress back metrics.DefaultBindAddress = ":8080" }) + +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 +}) diff --git a/pkg/manager/signals/signals_suite_test.go b/pkg/manager/signals/signals_suite_test.go index 4b809e4548..9dbdd28bd5 100644 --- a/pkg/manager/signals/signals_suite_test.go +++ b/pkg/manager/signals/signals_suite_test.go @@ -21,16 +21,23 @@ 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" ) +var suiteName = "Runtime Signal Suite" + func TestSource(t *testing.T) { RegisterFailHandler(Fail) - suiteName := "Runtime Signal Suite" - RunSpecsWithDefaultAndCustomReporters(t, suiteName, []Reporter{printer.NewlineReporter{}, printer.NewProwReporter(suiteName)}) + RunSpecs(t, suiteName) } var _ = BeforeSuite(func() { signal.Reset() }) + +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 +}) diff --git a/pkg/predicate/predicate_suite_test.go b/pkg/predicate/predicate_suite_test.go index 244d1ded86..ddeb4b081c 100644 --- a/pkg/predicate/predicate_suite_test.go +++ b/pkg/predicate/predicate_suite_test.go @@ -20,18 +20,25 @@ 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" "sigs.k8s.io/controller-runtime/pkg/log/zap" ) +var suiteName = "Predicate Suite" + func TestPredicate(t *testing.T) { RegisterFailHandler(Fail) - suiteName := "Predicate Suite" - RunSpecsWithDefaultAndCustomReporters(t, suiteName, []Reporter{printer.NewlineReporter{}, printer.NewProwReporter(suiteName)}) + RunSpecs(t, suiteName) } var _ = BeforeSuite(func() { logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true))) }) + +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 +}) diff --git a/pkg/reconcile/reconcile_suite_test.go b/pkg/reconcile/reconcile_suite_test.go index cccc4d609b..7c9074594a 100644 --- a/pkg/reconcile/reconcile_suite_test.go +++ b/pkg/reconcile/reconcile_suite_test.go @@ -20,18 +20,25 @@ 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" "sigs.k8s.io/controller-runtime/pkg/log/zap" ) +var suiteName = "Reconcile Suite" + func TestReconcile(t *testing.T) { RegisterFailHandler(Fail) - suiteName := "Reconcile Suite" - RunSpecsWithDefaultAndCustomReporters(t, suiteName, []Reporter{printer.NewlineReporter{}, printer.NewProwReporter(suiteName)}) + RunSpecs(t, suiteName) } var _ = BeforeSuite(func() { logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true))) }) + +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 +}) diff --git a/pkg/runtime/inject/inject_suite_test.go b/pkg/runtime/inject/inject_suite_test.go index 50398dcf90..26cdbe4d42 100644 --- a/pkg/runtime/inject/inject_suite_test.go +++ b/pkg/runtime/inject/inject_suite_test.go @@ -20,12 +20,19 @@ 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" ) +var suiteName = "Runtime Injection Suite" + func TestSource(t *testing.T) { RegisterFailHandler(Fail) - suiteName := "Runtime Injection Suite" - RunSpecsWithDefaultAndCustomReporters(t, suiteName, []Reporter{printer.NewlineReporter{}, printer.NewProwReporter(suiteName)}) + RunSpecs(t, suiteName) } + +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 +}) diff --git a/pkg/scheme/scheme_suite_test.go b/pkg/scheme/scheme_suite_test.go index d924c06431..c9ecd30e7e 100644 --- a/pkg/scheme/scheme_suite_test.go +++ b/pkg/scheme/scheme_suite_test.go @@ -20,13 +20,20 @@ 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" ) +var suiteName = "Scheme Suite" + func TestScheme(t *testing.T) { RegisterFailHandler(Fail) - suiteName := "Scheme Suite" - RunSpecsWithDefaultAndCustomReporters(t, suiteName, []Reporter{printer.NewlineReporter{}, printer.NewProwReporter(suiteName)}) + RunSpecs(t, suiteName) } + +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 +}) diff --git a/pkg/source/internal/internal_suite_test.go b/pkg/source/internal/internal_suite_test.go index edf2375b3e..dfa46ca4ff 100644 --- a/pkg/source/internal/internal_suite_test.go +++ b/pkg/source/internal/internal_suite_test.go @@ -20,18 +20,25 @@ 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" "sigs.k8s.io/controller-runtime/pkg/log/zap" ) +var suiteName = "Source Internal Suite" + func TestInternal(t *testing.T) { RegisterFailHandler(Fail) - suiteName := "Source Internal Suite" - RunSpecsWithDefaultAndCustomReporters(t, suiteName, []Reporter{printer.NewlineReporter{}, printer.NewProwReporter(suiteName)}) + RunSpecs(t, suiteName) } var _ = BeforeSuite(func() { logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true))) }) + +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 +}) diff --git a/pkg/source/source_suite_test.go b/pkg/source/source_suite_test.go index f91ef3ff07..b7d2a48e28 100644 --- a/pkg/source/source_suite_test.go +++ b/pkg/source/source_suite_test.go @@ -21,6 +21,7 @@ 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" @@ -31,10 +32,11 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) +var suiteName = "Source Suite" + func TestSource(t *testing.T) { RegisterFailHandler(Fail) - suiteName := "Source Suite" - RunSpecsWithDefaultAndCustomReporters(t, suiteName, []Reporter{printer.NewlineReporter{}, printer.NewProwReporter(suiteName)}) + RunSpecs(t, suiteName) } var testenv *envtest.Environment @@ -70,3 +72,8 @@ var _ = AfterSuite(func() { cancel() Expect(testenv.Stop()).To(Succeed()) }) + +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 +}) diff --git a/pkg/webhook/admission/admission_suite_test.go b/pkg/webhook/admission/admission_suite_test.go index 07c632b59e..243b9917f3 100644 --- a/pkg/webhook/admission/admission_suite_test.go +++ b/pkg/webhook/admission/admission_suite_test.go @@ -20,6 +20,7 @@ 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" @@ -27,12 +28,18 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) +var suiteName = "Admission Webhook Suite" + func TestAdmissionWebhook(t *testing.T) { RegisterFailHandler(Fail) - suiteName := "Admission Webhook Suite" - RunSpecsWithDefaultAndCustomReporters(t, suiteName, []Reporter{printer.NewlineReporter{}, printer.NewProwReporter(suiteName)}) + RunSpecs(t, suiteName) } var _ = BeforeSuite(func() { logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true))) }) + +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 +}) diff --git a/pkg/webhook/authentication/authentication_suite_test.go b/pkg/webhook/authentication/authentication_suite_test.go index c74fc2bac4..6fd049daf6 100644 --- a/pkg/webhook/authentication/authentication_suite_test.go +++ b/pkg/webhook/authentication/authentication_suite_test.go @@ -20,6 +20,7 @@ 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" @@ -27,12 +28,18 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) +var suiteName = "Authentication Webhook Suite" + func TestAuthenticationWebhook(t *testing.T) { RegisterFailHandler(Fail) - suiteName := "Authentication Webhook Suite" - RunSpecsWithDefaultAndCustomReporters(t, suiteName, []Reporter{printer.NewlineReporter{}, printer.NewProwReporter(suiteName)}) + RunSpecs(t, suiteName) } var _ = BeforeSuite(func() { logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true))) }) + +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 +}) diff --git a/pkg/webhook/conversion/conversion_suite_test.go b/pkg/webhook/conversion/conversion_suite_test.go index 7ebf10d538..0f75a44f32 100644 --- a/pkg/webhook/conversion/conversion_suite_test.go +++ b/pkg/webhook/conversion/conversion_suite_test.go @@ -19,6 +19,7 @@ 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" @@ -26,12 +27,18 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) +var suiteName = "CRD conversion Suite" + func TestConversionWebhook(t *testing.T) { RegisterFailHandler(Fail) - suiteName := "CRD conversion Suite" - RunSpecsWithDefaultAndCustomReporters(t, suiteName, []Reporter{printer.NewlineReporter{}, printer.NewProwReporter(suiteName)}) + RunSpecs(t, suiteName) } var _ = BeforeSuite(func() { logf.SetLogger(zap.New(zap.WriteTo(GinkgoWriter), zap.UseDevMode(true))) }) + +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 +}) diff --git a/pkg/webhook/webhook_suite_test.go b/pkg/webhook/webhook_suite_test.go index 99e6d71b4a..187c192994 100644 --- a/pkg/webhook/webhook_suite_test.go +++ b/pkg/webhook/webhook_suite_test.go @@ -21,6 +21,7 @@ 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" @@ -32,10 +33,11 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) +var suiteName = "Webhook Integration Suite" + func TestSource(t *testing.T) { RegisterFailHandler(Fail) - suiteName := "Webhook Integration Suite" - RunSpecsWithDefaultAndCustomReporters(t, suiteName, []Reporter{printer.NewlineReporter{}, printer.NewProwReporter(suiteName)}) + RunSpecs(t, suiteName) } var testenv *envtest.Environment @@ -105,3 +107,8 @@ 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 +}) From 3ba9150102bcf0014ad90d3691270a17d0449c8f Mon Sep 17 00:00:00 2001 From: acumino Date: Thu, 17 Feb 2022 00:32:34 +0530 Subject: [PATCH 08/13] Update dependency --- pkg/cache/internal/informers_map_test.go | 2 +- pkg/cache/internal/internal_suite_test.go | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/pkg/cache/internal/informers_map_test.go b/pkg/cache/internal/informers_map_test.go index 32a26fff4e..854a39c1f1 100644 --- a/pkg/cache/internal/informers_map_test.go +++ b/pkg/cache/internal/informers_map_test.go @@ -19,7 +19,7 @@ package internal import ( "fmt" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" diff --git a/pkg/cache/internal/internal_suite_test.go b/pkg/cache/internal/internal_suite_test.go index 4e7c2b2de5..8b0e734c64 100644 --- a/pkg/cache/internal/internal_suite_test.go +++ b/pkg/cache/internal/internal_suite_test.go @@ -19,13 +19,20 @@ package internal import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" + "github.com/onsi/ginkgo/v2/reporters" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/envtest/printer" ) +var suiteName = "Cache Internal Suite" + func TestSource(t *testing.T) { RegisterFailHandler(Fail) - suiteName := "Cache Internal Suite" - RunSpecsWithDefaultAndCustomReporters(t, suiteName, []Reporter{printer.NewlineReporter{}, printer.NewProwReporter(suiteName)}) + RunSpecs(t, suiteName) } + +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 +}) From f225518fe32cdd45e8ef8f2a2ea0ec23771a0a10 Mon Sep 17 00:00:00 2001 From: acumino Date: Thu, 17 Feb 2022 01:24:41 +0530 Subject: [PATCH 09/13] Address PR Review --- go.mod | 2 +- pkg/builder/builder_suite_test.go | 2 +- pkg/cache/cache_suite_test.go | 2 +- pkg/cache/internal/internal_suite_test.go | 2 +- pkg/client/apiutil/apiutil_suite_test.go | 2 +- pkg/client/client_suite_test.go | 2 +- pkg/client/config/config_suite_test.go | 2 +- pkg/client/fake/client_suite_test.go | 2 +- pkg/cluster/cluster_suite_test.go | 2 +- pkg/config/config_suite_test.go | 2 +- pkg/controller/controller_suite_test.go | 2 +- pkg/controller/controllerutil/controllerutil_suite_test.go | 2 +- pkg/envtest/envtest_suite_test.go | 2 +- pkg/finalizer/finalizer_test.go | 2 +- pkg/handler/eventhandler_suite_test.go | 2 +- pkg/healthz/healthz_suite_test.go | 2 +- pkg/internal/controller/controller_suite_test.go | 2 +- pkg/internal/recorder/recorder_suite_test.go | 2 +- pkg/internal/testing/addr/addr_suite_test.go | 2 +- pkg/internal/testing/certs/certs_suite_test.go | 2 +- pkg/internal/testing/controlplane/controlplane_suite_test.go | 2 +- pkg/internal/testing/process/process_suite_test.go | 2 +- pkg/log/log_suite_test.go | 2 +- pkg/log/zap/zap_suite_test.go | 2 +- pkg/manager/manager_suite_test.go | 2 +- pkg/manager/signals/signals_suite_test.go | 2 +- pkg/predicate/predicate_suite_test.go | 2 +- pkg/reconcile/reconcile_suite_test.go | 2 +- pkg/runtime/inject/inject_suite_test.go | 2 +- pkg/scheme/scheme_suite_test.go | 2 +- pkg/source/internal/internal_suite_test.go | 2 +- pkg/source/source_suite_test.go | 2 +- pkg/webhook/admission/admission_suite_test.go | 2 +- pkg/webhook/authentication/authentication_suite_test.go | 2 +- pkg/webhook/conversion/conversion_suite_test.go | 2 +- pkg/webhook/webhook_suite_test.go | 2 +- 36 files changed, 36 insertions(+), 36 deletions(-) diff --git a/go.mod b/go.mod index 2b7841dec0..921c3c79c0 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,6 @@ require ( github.com/fsnotify/fsnotify v1.5.1 github.com/go-logr/logr v1.2.0 github.com/go-logr/zapr v1.2.0 - github.com/onsi/ginkgo v1.16.5 github.com/onsi/ginkgo/v2 v2.1.1 github.com/onsi/gomega v1.18.1 github.com/prometheus/client_golang v1.12.1 @@ -54,6 +53,7 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect github.com/nxadm/tail v1.4.8 // indirect + github.com/onsi/ginkgo v1.16.5 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/prometheus/common v0.32.1 // indirect github.com/prometheus/procfs v0.7.3 // indirect diff --git a/pkg/builder/builder_suite_test.go b/pkg/builder/builder_suite_test.go index 59f9dd3f9e..6e861afcb4 100644 --- a/pkg/builder/builder_suite_test.go +++ b/pkg/builder/builder_suite_test.go @@ -37,7 +37,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/webhook" ) -var suiteName = "application Suite" +const suiteName = "application Suite" func TestBuilder(t *testing.T) { RegisterFailHandler(Fail) diff --git a/pkg/cache/cache_suite_test.go b/pkg/cache/cache_suite_test.go index 5361001aad..1c41593040 100644 --- a/pkg/cache/cache_suite_test.go +++ b/pkg/cache/cache_suite_test.go @@ -30,7 +30,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -var suiteName = "Cache Suite" +const suiteName = "Cache Suite" func TestSource(t *testing.T) { RegisterFailHandler(Fail) diff --git a/pkg/cache/internal/internal_suite_test.go b/pkg/cache/internal/internal_suite_test.go index 8b0e734c64..3f3af9d820 100644 --- a/pkg/cache/internal/internal_suite_test.go +++ b/pkg/cache/internal/internal_suite_test.go @@ -25,7 +25,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/envtest/printer" ) -var suiteName = "Cache Internal Suite" +const suiteName = "Cache Internal Suite" func TestSource(t *testing.T) { RegisterFailHandler(Fail) diff --git a/pkg/client/apiutil/apiutil_suite_test.go b/pkg/client/apiutil/apiutil_suite_test.go index ae5c3b1728..d3e26a31a8 100644 --- a/pkg/client/apiutil/apiutil_suite_test.go +++ b/pkg/client/apiutil/apiutil_suite_test.go @@ -29,7 +29,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -var suiteName = "API Utilities Test Suite" +const suiteName = "API Utilities Test Suite" func TestSource(t *testing.T) { RegisterFailHandler(Fail) diff --git a/pkg/client/client_suite_test.go b/pkg/client/client_suite_test.go index 73fc6962fd..3e5acc4a07 100644 --- a/pkg/client/client_suite_test.go +++ b/pkg/client/client_suite_test.go @@ -33,7 +33,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -var suiteName = "Client Suite" +const suiteName = "Client Suite" func TestSource(t *testing.T) { RegisterFailHandler(Fail) diff --git a/pkg/client/config/config_suite_test.go b/pkg/client/config/config_suite_test.go index 56e0389a97..7a97214a44 100644 --- a/pkg/client/config/config_suite_test.go +++ b/pkg/client/config/config_suite_test.go @@ -28,7 +28,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -var suiteName = "Client Config Test Suite" +const suiteName = "Client Config Test Suite" func TestConfig(t *testing.T) { RegisterFailHandler(Fail) diff --git a/pkg/client/fake/client_suite_test.go b/pkg/client/fake/client_suite_test.go index d22fbbb8bb..d5b42ed413 100644 --- a/pkg/client/fake/client_suite_test.go +++ b/pkg/client/fake/client_suite_test.go @@ -28,7 +28,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -var suiteName = "Fake client Suite" +const suiteName = "Fake client Suite" func TestSource(t *testing.T) { RegisterFailHandler(Fail) diff --git a/pkg/cluster/cluster_suite_test.go b/pkg/cluster/cluster_suite_test.go index 14c599fc1a..348b2bd5da 100644 --- a/pkg/cluster/cluster_suite_test.go +++ b/pkg/cluster/cluster_suite_test.go @@ -31,7 +31,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -var suiteName = "Cluster Suite" +const suiteName = "Cluster Suite" func TestSource(t *testing.T) { RegisterFailHandler(Fail) diff --git a/pkg/config/config_suite_test.go b/pkg/config/config_suite_test.go index f9728a575f..8b3eda86ae 100644 --- a/pkg/config/config_suite_test.go +++ b/pkg/config/config_suite_test.go @@ -26,7 +26,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/envtest/printer" ) -var suiteName = "Config Suite" +const suiteName = "Config Suite" func TestScheme(t *testing.T) { RegisterFailHandler(Fail) diff --git a/pkg/controller/controller_suite_test.go b/pkg/controller/controller_suite_test.go index df99f70f72..a76e05bf3c 100644 --- a/pkg/controller/controller_suite_test.go +++ b/pkg/controller/controller_suite_test.go @@ -37,7 +37,7 @@ import ( crscheme "sigs.k8s.io/controller-runtime/pkg/scheme" ) -var suiteName = "Controller Integration Suite" +const suiteName = "Controller Integration Suite" func TestSource(t *testing.T) { RegisterFailHandler(Fail) diff --git a/pkg/controller/controllerutil/controllerutil_suite_test.go b/pkg/controller/controllerutil/controllerutil_suite_test.go index e39805522f..11da263807 100644 --- a/pkg/controller/controllerutil/controllerutil_suite_test.go +++ b/pkg/controller/controllerutil/controllerutil_suite_test.go @@ -29,7 +29,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/envtest/printer" ) -var suiteName = "Controllerutil Suite" +const suiteName = "Controllerutil Suite" func TestControllerutil(t *testing.T) { RegisterFailHandler(Fail) diff --git a/pkg/envtest/envtest_suite_test.go b/pkg/envtest/envtest_suite_test.go index d4155601a1..278783093c 100644 --- a/pkg/envtest/envtest_suite_test.go +++ b/pkg/envtest/envtest_suite_test.go @@ -30,7 +30,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -var suiteName = "Envtest Suite" +const suiteName = "Envtest Suite" func TestSource(t *testing.T) { RegisterFailHandler(Fail) diff --git a/pkg/finalizer/finalizer_test.go b/pkg/finalizer/finalizer_test.go index a984fdd9b5..5c32b945b8 100644 --- a/pkg/finalizer/finalizer_test.go +++ b/pkg/finalizer/finalizer_test.go @@ -23,7 +23,7 @@ func (f mockFinalizer) Finalize(context.Context, client.Object) (Result, error) return f.result, f.err } -var suiteName = "Finalizer Suite" +const suiteName = "Finalizer Suite" func TestFinalizer(t *testing.T) { RegisterFailHandler(Fail) diff --git a/pkg/handler/eventhandler_suite_test.go b/pkg/handler/eventhandler_suite_test.go index 963bda0b80..bec74253cc 100644 --- a/pkg/handler/eventhandler_suite_test.go +++ b/pkg/handler/eventhandler_suite_test.go @@ -29,7 +29,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -var suiteName = "Eventhandler Suite" +const suiteName = "Eventhandler Suite" func TestEventhandler(t *testing.T) { RegisterFailHandler(Fail) diff --git a/pkg/healthz/healthz_suite_test.go b/pkg/healthz/healthz_suite_test.go index 5f779a7571..c1ca64b8b2 100644 --- a/pkg/healthz/healthz_suite_test.go +++ b/pkg/healthz/healthz_suite_test.go @@ -27,7 +27,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -var suiteName = "Healthz Suite" +const suiteName = "Healthz Suite" func TestHealthz(t *testing.T) { RegisterFailHandler(Fail) diff --git a/pkg/internal/controller/controller_suite_test.go b/pkg/internal/controller/controller_suite_test.go index 777a02be0d..b13639aa94 100644 --- a/pkg/internal/controller/controller_suite_test.go +++ b/pkg/internal/controller/controller_suite_test.go @@ -30,7 +30,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -var suiteName = "Controller internal Suite" +const suiteName = "Controller internal Suite" func TestSource(t *testing.T) { RegisterFailHandler(Fail) diff --git a/pkg/internal/recorder/recorder_suite_test.go b/pkg/internal/recorder/recorder_suite_test.go index 8a156fc754..77dc4d4f44 100644 --- a/pkg/internal/recorder/recorder_suite_test.go +++ b/pkg/internal/recorder/recorder_suite_test.go @@ -30,7 +30,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -var suiteName = "Recorder Integration Suite" +const suiteName = "Recorder Integration Suite" func TestRecorder(t *testing.T) { RegisterFailHandler(Fail) diff --git a/pkg/internal/testing/addr/addr_suite_test.go b/pkg/internal/testing/addr/addr_suite_test.go index 154a809766..4d4132fa7f 100644 --- a/pkg/internal/testing/addr/addr_suite_test.go +++ b/pkg/internal/testing/addr/addr_suite_test.go @@ -26,7 +26,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/envtest/printer" ) -var suiteName = "Addr Suite" +const suiteName = "Addr Suite" func TestAddr(t *testing.T) { t.Parallel() diff --git a/pkg/internal/testing/certs/certs_suite_test.go b/pkg/internal/testing/certs/certs_suite_test.go index b3201210bc..dc1217f6a5 100644 --- a/pkg/internal/testing/certs/certs_suite_test.go +++ b/pkg/internal/testing/certs/certs_suite_test.go @@ -26,7 +26,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/envtest/printer" ) -var suiteName = "TinyCA (Internal Certs) Suite" +const suiteName = "TinyCA (Internal Certs) Suite" func TestInternal(t *testing.T) { t.Parallel() diff --git a/pkg/internal/testing/controlplane/controlplane_suite_test.go b/pkg/internal/testing/controlplane/controlplane_suite_test.go index 3874a44d8e..209f51cb91 100644 --- a/pkg/internal/testing/controlplane/controlplane_suite_test.go +++ b/pkg/internal/testing/controlplane/controlplane_suite_test.go @@ -26,7 +26,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/envtest/printer" ) -var suiteName = "Control Plane Standup Unit Tests" +const suiteName = "Control Plane Standup Unit Tests" func TestIntegration(t *testing.T) { t.Parallel() diff --git a/pkg/internal/testing/process/process_suite_test.go b/pkg/internal/testing/process/process_suite_test.go index 039e82035d..614313aa40 100644 --- a/pkg/internal/testing/process/process_suite_test.go +++ b/pkg/internal/testing/process/process_suite_test.go @@ -26,7 +26,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/envtest/printer" ) -var suiteName = "Envtest Process Launcher Suite" +const suiteName = "Envtest Process Launcher Suite" func TestInternal(t *testing.T) { t.Parallel() diff --git a/pkg/log/log_suite_test.go b/pkg/log/log_suite_test.go index bb276b41f3..bdc75d2912 100644 --- a/pkg/log/log_suite_test.go +++ b/pkg/log/log_suite_test.go @@ -25,7 +25,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/envtest/printer" ) -var suiteName = "Log Suite" +const suiteName = "Log Suite" func TestSource(t *testing.T) { RegisterFailHandler(Fail) diff --git a/pkg/log/zap/zap_suite_test.go b/pkg/log/zap/zap_suite_test.go index 65e5f33e15..c151a07e06 100644 --- a/pkg/log/zap/zap_suite_test.go +++ b/pkg/log/zap/zap_suite_test.go @@ -25,7 +25,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/envtest/printer" ) -var suiteName = "Zap Log Suite" +const suiteName = "Zap Log Suite" func TestSource(t *testing.T) { RegisterFailHandler(Fail) diff --git a/pkg/manager/manager_suite_test.go b/pkg/manager/manager_suite_test.go index 283976e90b..96b5eb4e76 100644 --- a/pkg/manager/manager_suite_test.go +++ b/pkg/manager/manager_suite_test.go @@ -33,7 +33,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/metrics" ) -var suiteName = "Manager Suite" +const suiteName = "Manager Suite" func TestSource(t *testing.T) { RegisterFailHandler(Fail) diff --git a/pkg/manager/signals/signals_suite_test.go b/pkg/manager/signals/signals_suite_test.go index 9dbdd28bd5..dc8375648b 100644 --- a/pkg/manager/signals/signals_suite_test.go +++ b/pkg/manager/signals/signals_suite_test.go @@ -26,7 +26,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/envtest/printer" ) -var suiteName = "Runtime Signal Suite" +const suiteName = "Runtime Signal Suite" func TestSource(t *testing.T) { RegisterFailHandler(Fail) diff --git a/pkg/predicate/predicate_suite_test.go b/pkg/predicate/predicate_suite_test.go index ddeb4b081c..a98b4b5a28 100644 --- a/pkg/predicate/predicate_suite_test.go +++ b/pkg/predicate/predicate_suite_test.go @@ -27,7 +27,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -var suiteName = "Predicate Suite" +const suiteName = "Predicate Suite" func TestPredicate(t *testing.T) { RegisterFailHandler(Fail) diff --git a/pkg/reconcile/reconcile_suite_test.go b/pkg/reconcile/reconcile_suite_test.go index 7c9074594a..da1a99dd4d 100644 --- a/pkg/reconcile/reconcile_suite_test.go +++ b/pkg/reconcile/reconcile_suite_test.go @@ -27,7 +27,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -var suiteName = "Reconcile Suite" +const suiteName = "Reconcile Suite" func TestReconcile(t *testing.T) { RegisterFailHandler(Fail) diff --git a/pkg/runtime/inject/inject_suite_test.go b/pkg/runtime/inject/inject_suite_test.go index 26cdbe4d42..c7d4244976 100644 --- a/pkg/runtime/inject/inject_suite_test.go +++ b/pkg/runtime/inject/inject_suite_test.go @@ -25,7 +25,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/envtest/printer" ) -var suiteName = "Runtime Injection Suite" +const suiteName = "Runtime Injection Suite" func TestSource(t *testing.T) { RegisterFailHandler(Fail) diff --git a/pkg/scheme/scheme_suite_test.go b/pkg/scheme/scheme_suite_test.go index c9ecd30e7e..26c46ce0a4 100644 --- a/pkg/scheme/scheme_suite_test.go +++ b/pkg/scheme/scheme_suite_test.go @@ -26,7 +26,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/envtest/printer" ) -var suiteName = "Scheme Suite" +const suiteName = "Scheme Suite" func TestScheme(t *testing.T) { RegisterFailHandler(Fail) diff --git a/pkg/source/internal/internal_suite_test.go b/pkg/source/internal/internal_suite_test.go index dfa46ca4ff..75af16a26e 100644 --- a/pkg/source/internal/internal_suite_test.go +++ b/pkg/source/internal/internal_suite_test.go @@ -27,7 +27,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -var suiteName = "Source Internal Suite" +const suiteName = "Source Internal Suite" func TestInternal(t *testing.T) { RegisterFailHandler(Fail) diff --git a/pkg/source/source_suite_test.go b/pkg/source/source_suite_test.go index b7d2a48e28..13f580cf31 100644 --- a/pkg/source/source_suite_test.go +++ b/pkg/source/source_suite_test.go @@ -32,7 +32,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -var suiteName = "Source Suite" +const suiteName = "Source Suite" func TestSource(t *testing.T) { RegisterFailHandler(Fail) diff --git a/pkg/webhook/admission/admission_suite_test.go b/pkg/webhook/admission/admission_suite_test.go index 243b9917f3..b3955a73cf 100644 --- a/pkg/webhook/admission/admission_suite_test.go +++ b/pkg/webhook/admission/admission_suite_test.go @@ -28,7 +28,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -var suiteName = "Admission Webhook Suite" +const suiteName = "Admission Webhook Suite" func TestAdmissionWebhook(t *testing.T) { RegisterFailHandler(Fail) diff --git a/pkg/webhook/authentication/authentication_suite_test.go b/pkg/webhook/authentication/authentication_suite_test.go index 6fd049daf6..9e9ecd81f1 100644 --- a/pkg/webhook/authentication/authentication_suite_test.go +++ b/pkg/webhook/authentication/authentication_suite_test.go @@ -28,7 +28,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -var suiteName = "Authentication Webhook Suite" +const suiteName = "Authentication Webhook Suite" func TestAuthenticationWebhook(t *testing.T) { RegisterFailHandler(Fail) diff --git a/pkg/webhook/conversion/conversion_suite_test.go b/pkg/webhook/conversion/conversion_suite_test.go index 0f75a44f32..44d7f0f28f 100644 --- a/pkg/webhook/conversion/conversion_suite_test.go +++ b/pkg/webhook/conversion/conversion_suite_test.go @@ -27,7 +27,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -var suiteName = "CRD conversion Suite" +const suiteName = "CRD conversion Suite" func TestConversionWebhook(t *testing.T) { RegisterFailHandler(Fail) diff --git a/pkg/webhook/webhook_suite_test.go b/pkg/webhook/webhook_suite_test.go index 187c192994..4e18903ba8 100644 --- a/pkg/webhook/webhook_suite_test.go +++ b/pkg/webhook/webhook_suite_test.go @@ -33,7 +33,7 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -var suiteName = "Webhook Integration Suite" +const suiteName = "Webhook Integration Suite" func TestSource(t *testing.T) { RegisterFailHandler(Fail) From 46ea91ffe4df77b7127b122f0164ba466363bb99 Mon Sep 17 00:00:00 2001 From: acumino Date: Thu, 3 Mar 2022 14:01:31 +0530 Subject: [PATCH 10/13] Adpat custom reporter chnages --- go.sum | 7 ++ 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, 50 insertions(+), 252 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 e0a4ee16d9..f771e62e60 100644 --- a/go.sum +++ b/go.sum @@ -363,24 +363,31 @@ github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vv github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= <<<<<<< HEAD +<<<<<<< HEAD github.com/onsi/ginkgo/v2 v2.0.0 h1:CcuG/HvWNkkaqCUpJifQY8z7qEMBJya6aLPx6ftGyjQ= github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= ======= github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= +======= +>>>>>>> beb43d9b (Adpat custom reporter chnages) github.com/onsi/ginkgo/v2 v2.1.1 h1:LCnPB85AvFNr91s0B2aDzEiiIg6MUwLYbryC1NSlWi8= github.com/onsi/ginkgo/v2 v2.1.1/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= >>>>>>> 369575cf (tidy) 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= <<<<<<< HEAD +<<<<<<< HEAD github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= ======= github.com/onsi/gomega v1.18.0 h1:ngbYoRctxjl8SiF7XgP0NxBFbfHcg3wfHMMaFHWwMTM= github.com/onsi/gomega v1.18.0/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= >>>>>>> 369575cf (tidy) +======= +>>>>>>> beb43d9b (Adpat custom reporter chnages) 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 51df53c5ae..4b694dcf45 100644 --- a/pkg/builder/controller_test.go +++ b/pkg/builder/controller_test.go @@ -552,7 +552,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 d3e26a31a8..2502afa735 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) }) From 50edea9a1599a4873d96df9e1c5f8b3af29ad67e Mon Sep 17 00:00:00 2001 From: acumino Date: Thu, 3 Mar 2022 14:10:14 +0530 Subject: [PATCH 11/13] Minor edit --- pkg/envtest/printer/prow.go | 4 +++- pkg/internal/controller/controller_test.go | 18 +++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/pkg/envtest/printer/prow.go b/pkg/envtest/printer/prow.go index 815aade8f1..c67976e129 100644 --- a/pkg/envtest/printer/prow.go +++ b/pkg/envtest/printer/prow.go @@ -46,6 +46,8 @@ func AddReport(report ginkgo.Report, suiteName string) { 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()) + if err != nil { + fmt.Printf("Failed to generate report\n\t%s", err.Error()) + } } } diff --git a/pkg/internal/controller/controller_test.go b/pkg/internal/controller/controller_test.go index df539273e6..cb50ec999b 100644 --- a/pkg/internal/controller/controller_test.go +++ b/pkg/internal/controller/controller_test.go @@ -210,7 +210,7 @@ var _ = Describe("controller", func() { }() <-sourceSynced - }, 10.0) + }) It("should process events from source.Channel", func() { // channel to be closed when event is processed @@ -521,8 +521,8 @@ var _ = Describe("controller", func() { By("Removing the item from the queue") Eventually(queue.Len).Should(Equal(0)) - Eventually(func() int { return queue.NumRequeues(request) }).Should(Equal(0)) - }, 1.0) + Eventually(func() int { return queue.NumRequeues(request) }, 1.0).Should(Equal(0)) + }) // TODO(directxman12): we should ensure that backoff occurrs with error requeue @@ -698,7 +698,7 @@ var _ = Describe("controller", func() { } return nil }, 2.0).Should(Succeed()) - }, 2.0) + }) It("should get updated on reconcile errors", func() { Expect(func() error { @@ -727,7 +727,7 @@ var _ = Describe("controller", func() { } return nil }, 2.0).Should(Succeed()) - }, 2.0) + }) It("should get updated when reconcile returns with retry enabled", func() { Expect(func() error { @@ -757,7 +757,7 @@ var _ = Describe("controller", func() { } return nil }, 2.0).Should(Succeed()) - }, 2.0) + }) It("should get updated when reconcile returns with retryAfter enabled", func() { Expect(func() error { @@ -786,7 +786,7 @@ var _ = Describe("controller", func() { } return nil }, 2.0).Should(Succeed()) - }, 2.0) + }) }) Context("should update prometheus metrics", func() { @@ -827,7 +827,7 @@ var _ = Describe("controller", func() { By("Removing the item from the queue") Eventually(queue.Len).Should(Equal(0)) Eventually(func() int { return queue.NumRequeues(request) }).Should(Equal(0)) - }, 2.0) + }) It("should add a reconcile time to the reconcile time histogram", func() { var reconcileTime dto.Metric @@ -868,7 +868,7 @@ var _ = Describe("controller", func() { } return nil }, 2.0).Should(Succeed()) - }, 4.0) + }) }) }) }) From a2667946622c36098f44d71a75d6d079b2747af1 Mon Sep 17 00:00:00 2001 From: acumino Date: Mon, 14 Mar 2022 23:37:09 +0530 Subject: [PATCH 12/13] Rebase --- go.mod | 1 - go.sum | 17 ----------------- 2 files changed, 18 deletions(-) diff --git a/go.mod b/go.mod index 921c3c79c0..3ea2cbbd9a 100644 --- a/go.mod +++ b/go.mod @@ -67,7 +67,6 @@ require ( google.golang.org/appengine v1.6.7 // indirect google.golang.org/protobuf v1.27.1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect - gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect k8s.io/kube-openapi v0.0.0-20220328201542-3ee0da9b0b42 // indirect diff --git a/go.sum b/go.sum index f771e62e60..d244d89bb7 100644 --- a/go.sum +++ b/go.sum @@ -362,32 +362,15 @@ 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= -<<<<<<< HEAD -<<<<<<< HEAD -github.com/onsi/ginkgo/v2 v2.0.0 h1:CcuG/HvWNkkaqCUpJifQY8z7qEMBJya6aLPx6ftGyjQ= github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -======= -github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= -======= ->>>>>>> beb43d9b (Adpat custom reporter chnages) github.com/onsi/ginkgo/v2 v2.1.1 h1:LCnPB85AvFNr91s0B2aDzEiiIg6MUwLYbryC1NSlWi8= github.com/onsi/ginkgo/v2 v2.1.1/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= ->>>>>>> 369575cf (tidy) 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= -<<<<<<< HEAD -<<<<<<< HEAD github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= -======= -github.com/onsi/gomega v1.18.0 h1:ngbYoRctxjl8SiF7XgP0NxBFbfHcg3wfHMMaFHWwMTM= -github.com/onsi/gomega v1.18.0/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= ->>>>>>> 369575cf (tidy) -======= ->>>>>>> beb43d9b (Adpat custom reporter chnages) 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= From 1a677d06bb1683ade81f1258325477484f8efe6a Mon Sep 17 00:00:00 2001 From: acumino Date: Fri, 3 Jun 2022 19:40:28 +0530 Subject: [PATCH 13/13] Rebase --- go.mod | 1 - pkg/envtest/crd_test.go | 2 +- pkg/manager/manager_options_test.go | 2 +- pkg/webhook/admission/defaulter_test.go | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 3ea2cbbd9a..f6f2f7a2d8 100644 --- a/go.mod +++ b/go.mod @@ -52,7 +52,6 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/nxadm/tail v1.4.8 // indirect github.com/onsi/ginkgo v1.16.5 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/prometheus/common v0.32.1 // indirect diff --git a/pkg/envtest/crd_test.go b/pkg/envtest/crd_test.go index 2c12ba57b4..92dc48e963 100644 --- a/pkg/envtest/crd_test.go +++ b/pkg/envtest/crd_test.go @@ -17,7 +17,7 @@ limitations under the License. package envtest import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "k8s.io/apimachinery/pkg/util/sets" ) diff --git a/pkg/manager/manager_options_test.go b/pkg/manager/manager_options_test.go index 048441e56f..3718bedcbe 100644 --- a/pkg/manager/manager_options_test.go +++ b/pkg/manager/manager_options_test.go @@ -1,7 +1,7 @@ package manager import ( - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" "sigs.k8s.io/controller-runtime/pkg/config" diff --git a/pkg/webhook/admission/defaulter_test.go b/pkg/webhook/admission/defaulter_test.go index 93c3eda7c2..e9e41f5420 100644 --- a/pkg/webhook/admission/defaulter_test.go +++ b/pkg/webhook/admission/defaulter_test.go @@ -4,7 +4,7 @@ import ( "context" "net/http" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" admissionv1 "k8s.io/api/admission/v1"