Skip to content

Commit

Permalink
because it looks weird that the overall result only mentions the firs…
Browse files Browse the repository at this point in the history
…t mandatory task to fail and ignores the other mandatory tasks that failed too
  • Loading branch information
uturunku1 committed Dec 15, 2021
1 parent 951ef61 commit fc854ee
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/cloud/backend_runTasks.go
Expand Up @@ -116,7 +116,11 @@ func (b *Cloud) runTasksWithTaskResults(context *IntegrationContext, output Inte
var overall string = "[green]Passed"
if firstMandatoryTaskFailed != nil {
overall = "[red]Failed"
taskErr = fmt.Errorf("the run failed because the run task, %s, is required to succeed", *firstMandatoryTaskFailed)
if summary.failedMandatory > 1 {
taskErr = fmt.Errorf("the run failed because %d mandatory tasks are required to succeed", summary.failedMandatory)
} else {
taskErr = fmt.Errorf("the run failed because the run task, %s, is required to succeed", *firstMandatoryTaskFailed)
}
} else if summary.failed > 0 { // we have failures but none of them mandatory
overall = "[green]Passed with advisory failures"
}
Expand Down

0 comments on commit fc854ee

Please sign in to comment.