diff --git a/changelog/fragments/uid-output.yaml b/changelog/fragments/uid-output.yaml new file mode 100644 index 00000000000..18127490047 --- /dev/null +++ b/changelog/fragments/uid-output.yaml @@ -0,0 +1,5 @@ +entries: + - description: > + If an optional UniqueID is provided by a user in the scorecard config and the user generates XML output the UID will be appended to the test result output. + kind: "addition" + breaking: false diff --git a/internal/cmd/operator-sdk/scorecard/cmd.go b/internal/cmd/operator-sdk/scorecard/cmd.go index 98b18b93486..a42a95a5462 100644 --- a/internal/cmd/operator-sdk/scorecard/cmd.go +++ b/internal/cmd/operator-sdk/scorecard/cmd.go @@ -142,8 +142,11 @@ func (c *scorecardCmd) convertXunit(output v1alpha3.TestList) xunit.TestSuites { } tSuite.TestCases = append(tSuite.TestCases, tCase) tSuite.URL = item.Spec.Image - //TODO: Add TestStuite ID when API updates version - //tSuite.ID = item.Spec.UniqueID + if item.Spec.UniqueID != "" { + tSuite.ID = item.Spec.UniqueID + } else { + tSuite.ID = res.Name + } resultSuite.TestSuite = append(resultSuite.TestSuite, tSuite) } }