From fc854eecfddc9a1da2f961251cc8d94642c6a182 Mon Sep 17 00:00:00 2001 From: uturunku1 Date: Wed, 15 Dec 2021 09:26:12 -0800 Subject: [PATCH] because it looks weird that the overall result only mentions the first mandatory task to fail and ignores the other mandatory tasks that failed too --- internal/cloud/backend_runTasks.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/cloud/backend_runTasks.go b/internal/cloud/backend_runTasks.go index ab00a6aaca09..6c4d4a270c2d 100644 --- a/internal/cloud/backend_runTasks.go +++ b/internal/cloud/backend_runTasks.go @@ -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" }