Skip to content

Commit

Permalink
OPCT-180: Fix report when plugin is failing on runtime (#56)
Browse files Browse the repository at this point in the history
https://issues.redhat.com/browse/OPCT-180

The plugin must not pass on `report` when the runtime reported failures.

The runtime fails creating a 'fake' JUnit with failed reason. When there
is only one failed test, the plugin evaluation must consider it and
ignore any filter.
  • Loading branch information
mtulio committed Apr 10, 2023
1 parent 18b3370 commit b0addd7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pkg/report/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -271,11 +271,18 @@ func showSummaryPlugin(p *summary.OPCTPluginSummary, bProcessed bool) {
}
fmt.Printf(" - Failed (Filter CI Flakes): %d\n", len(p.FailedFilterFlaky))

// rewrite the original status when pass on all filters
// checking for runtime failure
runtimeFailed := false
if p.Total == p.Failed {
runtimeFailed = true
}

// rewrite the original status when pass on all filters and not failed on runtime
status := p.Status
if len(p.FailedFilterFlaky) == 0 {
if (len(p.FailedFilterFlaky) == 0) && !runtimeFailed {
status = "pass"
}

fmt.Printf(" - Status After Filters : %s\n", status)
}

Expand Down

0 comments on commit b0addd7

Please sign in to comment.