From 545c0d9b07250f0bf6d9c624143f97212d065f82 Mon Sep 17 00:00:00 2001 From: ayushsatyam146 Date: Fri, 3 May 2024 14:46:03 +0530 Subject: [PATCH] adding error handling in the TestTruncateCRDFieldTransformer yaml parsing --- pkg/common/util_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/common/util_test.go b/pkg/common/util_test.go index 8ed720b3..b60a2ad0 100644 --- a/pkg/common/util_test.go +++ b/pkg/common/util_test.go @@ -146,7 +146,8 @@ func TestTruncateCRDFieldTransformer(t *testing.T) { - tst ` u := &unstructured.Unstructured{} - yaml.Unmarshal([]byte(crdYaml), &u.Object) + err := yaml.Unmarshal([]byte(crdYaml), &u.Object) + Expect(err).NotTo(HaveOccurred()) TruncateCRDFieldTransformer("description", 10)(u) isDscriptionTruncated := CheckNestedFieldLengthWithinLimit(u.Object, 10, "description")