Skip to content

Commit fda35b2

Browse files
authored
fix: printout errors even if we have a timeout (#5628)
Signed-off-by: jesus m. rodriguez <[email protected]>
1 parent dda82e5 commit fda35b2

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# entries is a list of entries to include in
2+
# release notes and/or the migration guide
3+
entries:
4+
- description: >
5+
scorecard will now printout test results, if any, even when there is a context timeout.
6+
This will allow underlying errors from a test to be shown helping users address the issues.
7+
8+
# kind is one of:
9+
# - addition
10+
# - change
11+
# - deprecation
12+
# - removal
13+
# - bugfix
14+
kind: "change"
15+
16+
# Is this a breaking change?
17+
breaking: false

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,12 @@ func (c *scorecardCmd) run() (err error) {
233233

234234
scorecardTests, err = o.Run(ctx)
235235
if err != nil {
236+
// if we got a timeout; printout the test results if there are any
237+
if err == context.DeadlineExceeded {
238+
if errpo := c.printOutput(scorecardTests); errpo != nil {
239+
log.Fatal(errpo)
240+
}
241+
}
236242
return fmt.Errorf("error running tests %w", err)
237243
}
238244
}

0 commit comments

Comments
 (0)