From a4ca8eb705f4ae2ca5a4b67c685be4ebd6251655 Mon Sep 17 00:00:00 2001 From: Jakob Schrettenbrunner Date: Thu, 25 Aug 2022 09:37:22 +0200 Subject: [PATCH] remove suitName constants --- pkg/builder/builder_suite_test.go | 4 +--- pkg/cache/cache_suite_test.go | 4 +--- pkg/cache/internal/internal_suite_test.go | 4 +--- pkg/certwatcher/certwatcher_suite_test.go | 7 +++---- 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 +--- pkg/controller/controllerutil/controllerutil_suite_test.go | 4 +--- pkg/envtest/envtest_suite_test.go | 4 +--- pkg/finalizer/finalizer_test.go | 4 +--- pkg/handler/eventhandler_suite_test.go | 4 +--- pkg/healthz/healthz_suite_test.go | 4 +--- pkg/internal/controller/controller_suite_test.go | 4 +--- pkg/internal/recorder/recorder_suite_test.go | 4 +--- pkg/internal/testing/addr/addr_suite_test.go | 4 +--- pkg/internal/testing/certs/certs_suite_test.go | 4 +--- .../testing/controlplane/controlplane_suite_test.go | 4 +--- pkg/internal/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 +--- pkg/webhook/authentication/authentication_suite_test.go | 4 +--- pkg/webhook/conversion/conversion_suite_test.go | 4 +--- pkg/webhook/webhook_suite_test.go | 4 +--- 36 files changed, 38 insertions(+), 109 deletions(-) diff --git a/pkg/builder/builder_suite_test.go b/pkg/builder/builder_suite_test.go index 8fb55b1e0b..aec31ddfcf 100644 --- a/pkg/builder/builder_suite_test.go +++ b/pkg/builder/builder_suite_test.go @@ -35,11 +35,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/webhook" ) -const suiteName = "application Suite" - func TestBuilder(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, suiteName) + RunSpecs(t, "application Suite") } var testenv *envtest.Environment diff --git a/pkg/cache/cache_suite_test.go b/pkg/cache/cache_suite_test.go index 3eeb77f545..a9a5152ce8 100644 --- a/pkg/cache/cache_suite_test.go +++ b/pkg/cache/cache_suite_test.go @@ -28,11 +28,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -const suiteName = "Cache Suite" - func TestSource(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, suiteName) + RunSpecs(t, "Cache Suite") } var testenv *envtest.Environment diff --git a/pkg/cache/internal/internal_suite_test.go b/pkg/cache/internal/internal_suite_test.go index 1bdfdca79f..25ec0f1dbc 100644 --- a/pkg/cache/internal/internal_suite_test.go +++ b/pkg/cache/internal/internal_suite_test.go @@ -23,9 +23,7 @@ import ( . "github.com/onsi/gomega" ) -const suiteName = "Cache Internal Suite" - func TestSource(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, suiteName) + RunSpecs(t, "Cache Internal Suite") } diff --git a/pkg/certwatcher/certwatcher_suite_test.go b/pkg/certwatcher/certwatcher_suite_test.go index a346c194d7..a44a968c89 100644 --- a/pkg/certwatcher/certwatcher_suite_test.go +++ b/pkg/certwatcher/certwatcher_suite_test.go @@ -27,14 +27,13 @@ import ( ) var ( - certPath = "testdata/tls.crt" - keyPath = "testdata/tls.key" - suiteName = "CertWatcher Suite" + certPath = "testdata/tls.crt" + keyPath = "testdata/tls.key" ) func TestSource(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, suiteName) + RunSpecs(t, "CertWatcher Suite") } var _ = BeforeSuite(func() { diff --git a/pkg/client/apiutil/apiutil_suite_test.go b/pkg/client/apiutil/apiutil_suite_test.go index 86350feb28..7fe960b917 100644 --- a/pkg/client/apiutil/apiutil_suite_test.go +++ b/pkg/client/apiutil/apiutil_suite_test.go @@ -27,11 +27,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -const suiteName = "API Utilities Test Suite" - func TestSource(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, suiteName) + RunSpecs(t, "API Utilities Test Suite") } var cfg *rest.Config diff --git a/pkg/client/client_suite_test.go b/pkg/client/client_suite_test.go index bfd29c840c..9bfe5eaf10 100644 --- a/pkg/client/client_suite_test.go +++ b/pkg/client/client_suite_test.go @@ -31,11 +31,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -const suiteName = "Client Suite" - func TestSource(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, suiteName) + RunSpecs(t, "Client Suite") } var testenv *envtest.Environment diff --git a/pkg/client/config/config_suite_test.go b/pkg/client/config/config_suite_test.go index 5eae6f5562..626613cef4 100644 --- a/pkg/client/config/config_suite_test.go +++ b/pkg/client/config/config_suite_test.go @@ -26,11 +26,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -const suiteName = "Client Config Test Suite" - func TestConfig(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, suiteName) + RunSpecs(t, "Client Config Test Suite") } var _ = BeforeSuite(func() { diff --git a/pkg/client/fake/client_suite_test.go b/pkg/client/fake/client_suite_test.go index 2eff1a60af..66590f0b58 100644 --- a/pkg/client/fake/client_suite_test.go +++ b/pkg/client/fake/client_suite_test.go @@ -26,11 +26,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -const suiteName = "Fake client Suite" - func TestSource(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, suiteName) + RunSpecs(t, "Fake client Suite") } var _ = BeforeSuite(func() { diff --git a/pkg/cluster/cluster_suite_test.go b/pkg/cluster/cluster_suite_test.go index dc804bdd82..dc1f9ac778 100644 --- a/pkg/cluster/cluster_suite_test.go +++ b/pkg/cluster/cluster_suite_test.go @@ -29,11 +29,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -const suiteName = "Cluster Suite" - func TestSource(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, suiteName) + RunSpecs(t, "Cluster Suite") } var testenv *envtest.Environment diff --git a/pkg/config/config_suite_test.go b/pkg/config/config_suite_test.go index d1ee19532b..4f316d9d75 100644 --- a/pkg/config/config_suite_test.go +++ b/pkg/config/config_suite_test.go @@ -23,9 +23,7 @@ import ( . "github.com/onsi/gomega" ) -const suiteName = "Config Suite" - func TestScheme(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, suiteName) + RunSpecs(t, "Config Suite") } diff --git a/pkg/controller/controller_suite_test.go b/pkg/controller/controller_suite_test.go index 1454e55aad..af818d12cd 100644 --- a/pkg/controller/controller_suite_test.go +++ b/pkg/controller/controller_suite_test.go @@ -35,11 +35,9 @@ import ( crscheme "sigs.k8s.io/controller-runtime/pkg/scheme" ) -const suiteName = "Controller Integration Suite" - func TestSource(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, suiteName) + RunSpecs(t, "Controller Integration Suite") } var testenv *envtest.Environment diff --git a/pkg/controller/controllerutil/controllerutil_suite_test.go b/pkg/controller/controllerutil/controllerutil_suite_test.go index 4d3640eec9..a4ac5cc746 100644 --- a/pkg/controller/controllerutil/controllerutil_suite_test.go +++ b/pkg/controller/controllerutil/controllerutil_suite_test.go @@ -27,11 +27,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/envtest" ) -const suiteName = "Controllerutil Suite" - func TestControllerutil(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, suiteName) + RunSpecs(t, "Controllerutil Suite") } var testenv *envtest.Environment diff --git a/pkg/envtest/envtest_suite_test.go b/pkg/envtest/envtest_suite_test.go index 64f9f34a45..f7788bf090 100644 --- a/pkg/envtest/envtest_suite_test.go +++ b/pkg/envtest/envtest_suite_test.go @@ -28,11 +28,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -const suiteName = "Envtest Suite" - func TestSource(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, suiteName) + RunSpecs(t, "Envtest Suite") } var env *Environment diff --git a/pkg/finalizer/finalizer_test.go b/pkg/finalizer/finalizer_test.go index b0376d1570..eb85bd020a 100644 --- a/pkg/finalizer/finalizer_test.go +++ b/pkg/finalizer/finalizer_test.go @@ -21,11 +21,9 @@ func (f mockFinalizer) Finalize(context.Context, client.Object) (Result, error) return f.result, f.err } -const suiteName = "Finalizer Suite" - func TestFinalizer(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, suiteName) + RunSpecs(t, "Finalizer Suite") } var _ = Describe("TestFinalizer", func() { diff --git a/pkg/handler/eventhandler_suite_test.go b/pkg/handler/eventhandler_suite_test.go index ff4d60ebc9..3f6b17f337 100644 --- a/pkg/handler/eventhandler_suite_test.go +++ b/pkg/handler/eventhandler_suite_test.go @@ -27,11 +27,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -const suiteName = "Eventhandler Suite" - func TestEventhandler(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, suiteName) + RunSpecs(t, "Eventhandler Suite") } var testenv *envtest.Environment diff --git a/pkg/healthz/healthz_suite_test.go b/pkg/healthz/healthz_suite_test.go index e5c3a91ef9..8e16a58aa0 100644 --- a/pkg/healthz/healthz_suite_test.go +++ b/pkg/healthz/healthz_suite_test.go @@ -25,11 +25,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -const suiteName = "Healthz Suite" - func TestHealthz(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, suiteName) + RunSpecs(t, "Healthz Suite") } var _ = BeforeSuite(func() { diff --git a/pkg/internal/controller/controller_suite_test.go b/pkg/internal/controller/controller_suite_test.go index 7a905349e2..3143d3dd74 100644 --- a/pkg/internal/controller/controller_suite_test.go +++ b/pkg/internal/controller/controller_suite_test.go @@ -28,11 +28,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -const suiteName = "Controller internal Suite" - func TestSource(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, suiteName) + RunSpecs(t, "Controller internal Suite") } var testenv *envtest.Environment diff --git a/pkg/internal/recorder/recorder_suite_test.go b/pkg/internal/recorder/recorder_suite_test.go index f785b63743..226982d1fd 100644 --- a/pkg/internal/recorder/recorder_suite_test.go +++ b/pkg/internal/recorder/recorder_suite_test.go @@ -28,11 +28,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -const suiteName = "Recorder Integration Suite" - func TestRecorder(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, suiteName) + RunSpecs(t, "Recorder Integration Suite") } var testenv *envtest.Environment diff --git a/pkg/internal/testing/addr/addr_suite_test.go b/pkg/internal/testing/addr/addr_suite_test.go index fa185306c1..3869bb0207 100644 --- a/pkg/internal/testing/addr/addr_suite_test.go +++ b/pkg/internal/testing/addr/addr_suite_test.go @@ -23,10 +23,8 @@ import ( . "github.com/onsi/gomega" ) -const suiteName = "Addr Suite" - func TestAddr(t *testing.T) { t.Parallel() RegisterFailHandler(Fail) - RunSpecs(t, suiteName) + RunSpecs(t, "Addr Suite") } diff --git a/pkg/internal/testing/certs/certs_suite_test.go b/pkg/internal/testing/certs/certs_suite_test.go index 42881d4743..3b3008c294 100644 --- a/pkg/internal/testing/certs/certs_suite_test.go +++ b/pkg/internal/testing/certs/certs_suite_test.go @@ -23,10 +23,8 @@ import ( . "github.com/onsi/gomega" ) -const suiteName = "TinyCA (Internal Certs) Suite" - func TestInternal(t *testing.T) { t.Parallel() RegisterFailHandler(Fail) - RunSpecs(t, suiteName) + RunSpecs(t, "TinyCA (Internal Certs) Suite") } diff --git a/pkg/internal/testing/controlplane/controlplane_suite_test.go b/pkg/internal/testing/controlplane/controlplane_suite_test.go index 0042acd2c4..9ac69047f0 100644 --- a/pkg/internal/testing/controlplane/controlplane_suite_test.go +++ b/pkg/internal/testing/controlplane/controlplane_suite_test.go @@ -23,10 +23,8 @@ import ( . "github.com/onsi/gomega" ) -const suiteName = "Control Plane Standup Unit Tests" - func TestIntegration(t *testing.T) { t.Parallel() RegisterFailHandler(Fail) - RunSpecs(t, suiteName) + RunSpecs(t, "Control Plane Standup Unit Tests") } diff --git a/pkg/internal/testing/process/process_suite_test.go b/pkg/internal/testing/process/process_suite_test.go index 428f1e3148..5a64e9d2f0 100644 --- a/pkg/internal/testing/process/process_suite_test.go +++ b/pkg/internal/testing/process/process_suite_test.go @@ -23,10 +23,8 @@ import ( . "github.com/onsi/gomega" ) -const suiteName = "Envtest Process Launcher Suite" - func TestInternal(t *testing.T) { t.Parallel() RegisterFailHandler(Fail) - RunSpecs(t, suiteName) + RunSpecs(t, "Envtest Process Launcher Suite") } diff --git a/pkg/log/log_suite_test.go b/pkg/log/log_suite_test.go index a4db38c605..f0e349aa86 100644 --- a/pkg/log/log_suite_test.go +++ b/pkg/log/log_suite_test.go @@ -23,9 +23,7 @@ import ( . "github.com/onsi/gomega" ) -const suiteName = "Log Suite" - func TestSource(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, suiteName) + RunSpecs(t, "Log Suite") } diff --git a/pkg/log/zap/zap_suite_test.go b/pkg/log/zap/zap_suite_test.go index d237a19077..d7a7f22866 100644 --- a/pkg/log/zap/zap_suite_test.go +++ b/pkg/log/zap/zap_suite_test.go @@ -23,9 +23,7 @@ import ( . "github.com/onsi/gomega" ) -const suiteName = "Zap Log Suite" - func TestSource(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, suiteName) + RunSpecs(t, "Zap Log Suite") } diff --git a/pkg/manager/manager_suite_test.go b/pkg/manager/manager_suite_test.go index 48d0a128f6..ab514ef1e9 100644 --- a/pkg/manager/manager_suite_test.go +++ b/pkg/manager/manager_suite_test.go @@ -31,11 +31,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/metrics" ) -const suiteName = "Manager Suite" - func TestSource(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, suiteName) + RunSpecs(t, "Manager Suite") } var testenv *envtest.Environment diff --git a/pkg/manager/signals/signals_suite_test.go b/pkg/manager/signals/signals_suite_test.go index 262795cc3c..bae6d72ed5 100644 --- a/pkg/manager/signals/signals_suite_test.go +++ b/pkg/manager/signals/signals_suite_test.go @@ -24,11 +24,9 @@ import ( . "github.com/onsi/gomega" ) -const suiteName = "Runtime Signal Suite" - func TestSource(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, suiteName) + RunSpecs(t, "Runtime Signal Suite") } var _ = BeforeSuite(func() { diff --git a/pkg/predicate/predicate_suite_test.go b/pkg/predicate/predicate_suite_test.go index 243cdf67cf..170594ca52 100644 --- a/pkg/predicate/predicate_suite_test.go +++ b/pkg/predicate/predicate_suite_test.go @@ -25,11 +25,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -const suiteName = "Predicate Suite" - func TestPredicate(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, suiteName) + RunSpecs(t, "Predicate Suite") } var _ = BeforeSuite(func() { diff --git a/pkg/reconcile/reconcile_suite_test.go b/pkg/reconcile/reconcile_suite_test.go index ce6ccfe756..9bab444ebd 100644 --- a/pkg/reconcile/reconcile_suite_test.go +++ b/pkg/reconcile/reconcile_suite_test.go @@ -25,11 +25,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -const suiteName = "Reconcile Suite" - func TestReconcile(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, suiteName) + RunSpecs(t, "Reconcile Suite") } var _ = BeforeSuite(func() { diff --git a/pkg/runtime/inject/inject_suite_test.go b/pkg/runtime/inject/inject_suite_test.go index 6456db4967..ce612f3177 100644 --- a/pkg/runtime/inject/inject_suite_test.go +++ b/pkg/runtime/inject/inject_suite_test.go @@ -23,9 +23,7 @@ import ( . "github.com/onsi/gomega" ) -const suiteName = "Runtime Injection Suite" - func TestSource(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, suiteName) + RunSpecs(t, "Runtime Injection Suite") } diff --git a/pkg/scheme/scheme_suite_test.go b/pkg/scheme/scheme_suite_test.go index 4336b69710..36ddd9decc 100644 --- a/pkg/scheme/scheme_suite_test.go +++ b/pkg/scheme/scheme_suite_test.go @@ -23,9 +23,7 @@ import ( . "github.com/onsi/gomega" ) -const suiteName = "Scheme Suite" - func TestScheme(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, suiteName) + RunSpecs(t, "Scheme Suite") } diff --git a/pkg/source/internal/internal_suite_test.go b/pkg/source/internal/internal_suite_test.go index 60ecbbbb9d..eeee8b22cd 100644 --- a/pkg/source/internal/internal_suite_test.go +++ b/pkg/source/internal/internal_suite_test.go @@ -25,11 +25,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -const suiteName = "Source Internal Suite" - func TestInternal(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, suiteName) + RunSpecs(t, "Source Internal Suite") } var _ = BeforeSuite(func() { diff --git a/pkg/source/source_suite_test.go b/pkg/source/source_suite_test.go index 6603d31fb0..131099f0b9 100644 --- a/pkg/source/source_suite_test.go +++ b/pkg/source/source_suite_test.go @@ -30,11 +30,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -const suiteName = "Source Suite" - func TestSource(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, suiteName) + RunSpecs(t, "Source Suite") } var testenv *envtest.Environment diff --git a/pkg/webhook/admission/admission_suite_test.go b/pkg/webhook/admission/admission_suite_test.go index e02983f622..f4e561b1b8 100644 --- a/pkg/webhook/admission/admission_suite_test.go +++ b/pkg/webhook/admission/admission_suite_test.go @@ -26,11 +26,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -const suiteName = "Admission Webhook Suite" - func TestAdmissionWebhook(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, suiteName) + RunSpecs(t, "Admission Webhook Suite") } var _ = BeforeSuite(func() { diff --git a/pkg/webhook/authentication/authentication_suite_test.go b/pkg/webhook/authentication/authentication_suite_test.go index ba5372ce34..29f7b3e17e 100644 --- a/pkg/webhook/authentication/authentication_suite_test.go +++ b/pkg/webhook/authentication/authentication_suite_test.go @@ -26,11 +26,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -const suiteName = "Authentication Webhook Suite" - func TestAuthenticationWebhook(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, suiteName) + RunSpecs(t, "Authentication Webhook Suite") } var _ = BeforeSuite(func() { diff --git a/pkg/webhook/conversion/conversion_suite_test.go b/pkg/webhook/conversion/conversion_suite_test.go index c75da0578b..7ca3c48ba2 100644 --- a/pkg/webhook/conversion/conversion_suite_test.go +++ b/pkg/webhook/conversion/conversion_suite_test.go @@ -25,11 +25,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -const suiteName = "CRD conversion Suite" - func TestConversionWebhook(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, suiteName) + RunSpecs(t, "CRD conversion Suite") } var _ = BeforeSuite(func() { diff --git a/pkg/webhook/webhook_suite_test.go b/pkg/webhook/webhook_suite_test.go index cc4357b8d6..ee9c1f4057 100644 --- a/pkg/webhook/webhook_suite_test.go +++ b/pkg/webhook/webhook_suite_test.go @@ -31,11 +31,9 @@ import ( "sigs.k8s.io/controller-runtime/pkg/log/zap" ) -const suiteName = "Webhook Integration Suite" - func TestSource(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, suiteName) + RunSpecs(t, "Webhook Integration Suite") } var testenv *envtest.Environment