From 57813452a34a34e0b90286dc740879c36f2d6f48 Mon Sep 17 00:00:00 2001 From: Miciah Masters Date: Mon, 14 Nov 2022 16:03:26 -0500 Subject: [PATCH 1/2] NE-1184: Test_desiredHttpErrorCodeConfigMap: Kill dead code * pkg/operator/controller/sync-http-error-code-configmap/controller_test.go (Test_desiredHttpErrorCodeConfigMap): Delete some dead code. --- .../sync-http-error-code-configmap/controller_test.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/pkg/operator/controller/sync-http-error-code-configmap/controller_test.go b/pkg/operator/controller/sync-http-error-code-configmap/controller_test.go index 78eb47b79..f25e0215f 100644 --- a/pkg/operator/controller/sync-http-error-code-configmap/controller_test.go +++ b/pkg/operator/controller/sync-http-error-code-configmap/controller_test.go @@ -147,15 +147,5 @@ func TestDesiredHttpErrorCodeConfigMap(t *testing.T) { if !reflect.DeepEqual(expected.Data, actual.Data) { t.Errorf("expected #{expected} and actual #{actual} configmap don't match") } - - if expected == nil || actual == nil { - if expected != nil { - t.Errorf("%q: expected %v, got nil", tc.description, expected) - } - if actual != nil { - t.Errorf("%q: expected nil, got %v", tc.description, actual) - } - continue - } } } From 66defd0c2fdbe519767dc743e4d1f9001ec95ce2 Mon Sep 17 00:00:00 2001 From: Miciah Masters Date: Mon, 14 Nov 2022 16:04:48 -0500 Subject: [PATCH 2/2] NE-1185: Test_desiredHttpErrorCodeConfigMap: Fix format * pkg/operator/controller/sync-http-error-code-configmap/controller_test.go (Test_desiredHttpErrorCodeConfigMap): Replace Ruby-style #{} syntax for string interpolation with Go string formats. --- .../sync-http-error-code-configmap/controller_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/operator/controller/sync-http-error-code-configmap/controller_test.go b/pkg/operator/controller/sync-http-error-code-configmap/controller_test.go index f25e0215f..3591e808d 100644 --- a/pkg/operator/controller/sync-http-error-code-configmap/controller_test.go +++ b/pkg/operator/controller/sync-http-error-code-configmap/controller_test.go @@ -145,7 +145,7 @@ func TestDesiredHttpErrorCodeConfigMap(t *testing.T) { } if !reflect.DeepEqual(expected.Data, actual.Data) { - t.Errorf("expected #{expected} and actual #{actual} configmap don't match") + t.Errorf("expected configmap and actual configmap don't match\nexpected:\n%v\nactual:\n%v", expected, actual) } } }