Skip to content

Commit

Permalink
Differentiate jobs that failed from jobs with failures (exit code 42).
Browse files Browse the repository at this point in the history
  • Loading branch information
gnutix committed Nov 10, 2023
1 parent 62a11ac commit 4a4be14
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions client/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ var watchCmd = &cobra.Command{
queued := []string{}
running := []string{}
aborted := []string{}
failed := []string{}
crashed := []string{}
failures := []string{}
completed := []string{}

tasks = lo.Map(msg.Tasks, func(t *proto.TaskStatus, _ int) string { return t.Name })
Expand All @@ -85,7 +86,11 @@ var watchCmd = &cobra.Command{
case proto.TaskStatus_ABORTED:
aborted = append(aborted, t.Name)
case proto.TaskStatus_FAILED:
failed = append(failed, t.Name)
if *t.ExitCode == 42 {
failures = append(failures, t.Name)
} else {
crashed = append(crashed, t.Name)
}
case proto.TaskStatus_COMPLETED:
completed = append(completed, t.Name)
}
Expand All @@ -99,10 +104,13 @@ var watchCmd = &cobra.Command{
statItems = append(statItems, fmt.Sprintf("⚙️ %s", itemsPrinter(running, false)))
}
if len(aborted) > 0 {
statItems = append(statItems, fmt.Sprintf("💥 %s", itemsPrinter(aborted, true)))
statItems = append(statItems, fmt.Sprintf("🛑 %s", itemsPrinter(aborted, true)))
}
if len(failed) > 0 {
statItems = append(statItems, fmt.Sprintf("❌ %s", itemsPrinter(failed, true)))
if len(crashed) > 0 {
statItems = append(statItems, fmt.Sprintf("💥 %s", itemsPrinter(crashed, true)))
}
if len(failures) > 0 {
statItems = append(statItems, fmt.Sprintf("⚠️ %s", itemsPrinter(failures, true)))
}
if len(completed) > 0 {
statItems = append(statItems, fmt.Sprintf("✅ %s", itemsPrinter(completed, true)))
Expand Down

0 comments on commit 4a4be14

Please sign in to comment.