Skip to content

Commit 5d2d302

Browse files
author
Ish Shah
committed
Add todo comments and remove extra error
Signed-off-by: Ish Shah <[email protected]>
1 parent 33a480f commit 5d2d302

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

internal/cmd/operator-sdk/scorecard/cmd.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,7 @@ func (c *scorecardCmd) printOutput(output v1alpha3.TestList) error {
105105
}
106106
fmt.Printf("%s\n", string(bytes))
107107
case "xunit":
108-
xunitOutput, err := c.convertXunit(output)
109-
if err != nil {
110-
return fmt.Errorf("xunit conversion error: %v", err)
111-
}
108+
xunitOutput := c.convertXunit(output)
112109
bytes, err := xml.MarshalIndent(xunitOutput, "", " ")
113110
if err != nil {
114111
return fmt.Errorf("marshal xml error: %v", err)
@@ -175,7 +172,7 @@ type xUnitComplexSkipped struct {
175172
Message string `json:"message,omitempty"`
176173
}
177174

178-
func (c *scorecardCmd) convertXunit(output v1alpha3.TestList) (TestSuites, error) {
175+
func (c *scorecardCmd) convertXunit(output v1alpha3.TestList) TestSuites {
179176
var resultSuite TestSuites
180177
resultSuite.Name = "scorecard"
181178
resultSuite.Tests = ""
@@ -199,11 +196,12 @@ func (c *scorecardCmd) convertXunit(output v1alpha3.TestList) (TestSuites, error
199196
}
200197
tSuite.TestCases = append(tSuite.TestCases, tCase)
201198
tSuite.URL = item.Spec.Image
199+
//TODO: Add TestStuite ID when API updates version
202200
//tSuite.ID = item.Spec.UniqueID
203201
}
204202
}
205203

206-
return resultSuite, nil
204+
return resultSuite
207205
}
208206

209207
func (c *scorecardCmd) run() (err error) {

internal/scorecard/scorecard.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,8 @@ func (o Scorecard) runTest(ctx context.Context, test v1alpha3.TestConfiguration)
132132
}
133133

134134
out := v1alpha3.NewTest()
135-
//out.TimeStamp = time.Now().Format(time.RFC850)
135+
//TODO: Add timestamp to result when API version updates
136+
//out.Tstamp = time.Now().Format(time.RFC850)
136137
out.Spec = test
137138
out.Status = *result
138139
return out

0 commit comments

Comments
 (0)