From f9c9f37e2549e0f6c2337e6d4e72c357e00788e8 Mon Sep 17 00:00:00 2001 From: Daniel Haus Date: Mon, 2 Jan 2023 09:17:45 +0100 Subject: [PATCH] Fix unit test failure. --- main.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index f5a59c0..c054e97 100644 --- a/main.go +++ b/main.go @@ -297,12 +297,11 @@ type testCase struct { func NewTestCase(tc junit.Test, env map[string]string) testCase { jobSpec := env["JOB_SPEC"] baseLink := gjson.Get(jobSpec, "refs.base_link").String() - return testCase{ + c := testCase{ Name: tc.Name, Message: tc.Message, Stdout: tc.SystemOut, Stderr: tc.SystemErr, - Error: tc.Error.Error(), Suite: tc.Classname, BuildId: env["BUILD_ID"], Cluster: env["CLUSTER_NAME"], @@ -311,6 +310,11 @@ func NewTestCase(tc junit.Test, env map[string]string) testCase { BuildTag: env["STACKROX_BUILD_TAG"], BaseLink: baseLink, } + + if tc.Error != nil { + c.Error = tc.Error.Error() + } + return c } func (tc *testCase) description() (string, error) {