rename variables to something more descriptive

This commit is contained in:
uturunku1 2022-01-04 16:39:43 -05:00 committed by Sebastian Rivera
parent 385589e1a4
commit a9da859ee5
1 changed files with 10 additions and 10 deletions

View File

@ -19,31 +19,31 @@ type taskResultSummary struct {
type taskStageReadFunc func(b *Cloud, stopCtx context.Context) (*tfe.TaskStage, error)
func summarizeTaskResults(taskResults []*tfe.TaskResult) *taskResultSummary {
var pe, er, erm, pa int
var pendingCount, errCount, errMandatoryCount, passedCount int
for _, task := range taskResults {
if task.Status == "unreachable" {
return &taskResultSummary{
unreachable: true,
}
} else if task.Status == "running" || task.Status == "pending" {
pe++
} else if task.Status == "running" || task.Status == "pendingCountnding" {
pendingCount++
} else if task.Status == "passed" {
pa++
passedCount++
} else {
// Everything else is a failure
er++
errCount++
if task.WorkspaceTaskEnforcementLevel == "mandatory" {
erm++
errMandatoryCount++
}
}
}
return &taskResultSummary{
unreachable: false,
pending: pe,
failed: er,
failedMandatory: erm,
passed: pa,
pending: pendingCount,
failed: errCount,
failedMandatory: errMandatoryCount,
passed: passedCount,
}
}