Skip to content

Commit

Permalink
kola/testiso: modify printResult to update snooze info
Browse files Browse the repository at this point in the history
  • Loading branch information
c4rt0 committed Jun 30, 2023
1 parent a8a43e4 commit 57760f8
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion mantle/cmd/kola/testiso.go
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,19 @@ func printResult(test string, duration time.Duration, err error) bool {
if err != nil {
result = "FAIL"
}
fmt.Printf("%s: %s (%s)\n", result, test, duration.Round(time.Millisecond).String())
if harness.ParseDenyListYaml.obj.snoozeDate != "" {
snoozeDate, err := time.Parse(snoozeFormat, obj.SnoozeDate)
if err != nil {
return err
} else if today.After(snoozeDate) {
// if snoozeDate within last 7 days, print aditional info
if snoozeDate.Before(snoozeDate.AddDate(0, 0, 7)) {
fmt.Printf("%s: %s (%s) Snooze expired %s\n", result, test, duration.Round(time.Millisecond).String(), snoozeDate.Format("Jan 02 2006"))
}
}
} else {
fmt.Printf("%s: %s (%s)\n", result, test, duration.Round(time.Millisecond).String())
}
if err != nil {
fmt.Printf(" %s\n", err)
return true
Expand Down

0 comments on commit 57760f8

Please sign in to comment.