From e8afe1466024ac6e216736c391c8d0f782fae4fe Mon Sep 17 00:00:00 2001 From: tariq-hasan Date: Tue, 16 Apr 2024 01:10:12 -0400 Subject: [PATCH] Introduced cmp for error comparison for util.ConvertStringToUnstructured --- pkg/controller.v1beta1/experiment/manifest/generator_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/controller.v1beta1/experiment/manifest/generator_test.go b/pkg/controller.v1beta1/experiment/manifest/generator_test.go index 9f89f5ac5f4..a2b9f295f0e 100644 --- a/pkg/controller.v1beta1/experiment/manifest/generator_test.go +++ b/pkg/controller.v1beta1/experiment/manifest/generator_test.go @@ -236,8 +236,8 @@ spec: - "--momentum=0.9"` expectedRunSpec, err := util.ConvertStringToUnstructured(expectedStr) - if err != nil { - t.Errorf("%v: %v", errConvertStringToUnstructuredFailed, err) + if diff := cmp.Diff(nil, err, cmpopts.EquateErrors()); len(diff) != 0 { + t.Errorf("ConvertStringToUnstructured failed (-want,+got):\n%s", diff) } cases := map[string]struct {