rename variables to something more descriptive
This commit is contained in:
parent
385589e1a4
commit
a9da859ee5
|
@ -19,31 +19,31 @@ type taskResultSummary struct {
|
||||||
type taskStageReadFunc func(b *Cloud, stopCtx context.Context) (*tfe.TaskStage, error)
|
type taskStageReadFunc func(b *Cloud, stopCtx context.Context) (*tfe.TaskStage, error)
|
||||||
|
|
||||||
func summarizeTaskResults(taskResults []*tfe.TaskResult) *taskResultSummary {
|
func summarizeTaskResults(taskResults []*tfe.TaskResult) *taskResultSummary {
|
||||||
var pe, er, erm, pa int
|
var pendingCount, errCount, errMandatoryCount, passedCount int
|
||||||
for _, task := range taskResults {
|
for _, task := range taskResults {
|
||||||
if task.Status == "unreachable" {
|
if task.Status == "unreachable" {
|
||||||
return &taskResultSummary{
|
return &taskResultSummary{
|
||||||
unreachable: true,
|
unreachable: true,
|
||||||
}
|
}
|
||||||
} else if task.Status == "running" || task.Status == "pending" {
|
} else if task.Status == "running" || task.Status == "pendingCountnding" {
|
||||||
pe++
|
pendingCount++
|
||||||
} else if task.Status == "passed" {
|
} else if task.Status == "passed" {
|
||||||
pa++
|
passedCount++
|
||||||
} else {
|
} else {
|
||||||
// Everything else is a failure
|
// Everything else is a failure
|
||||||
er++
|
errCount++
|
||||||
if task.WorkspaceTaskEnforcementLevel == "mandatory" {
|
if task.WorkspaceTaskEnforcementLevel == "mandatory" {
|
||||||
erm++
|
errMandatoryCount++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return &taskResultSummary{
|
return &taskResultSummary{
|
||||||
unreachable: false,
|
unreachable: false,
|
||||||
pending: pe,
|
pending: pendingCount,
|
||||||
failed: er,
|
failed: errCount,
|
||||||
failedMandatory: erm,
|
failedMandatory: errMandatoryCount,
|
||||||
passed: pa,
|
passed: passedCount,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue