Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions internal/runner/parallel/parallel.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,13 @@ func handleExec(
}

parentTask := ctx.CurrentTask
if parentTask == nil {
// Group the run's output only when there is more than one task. GitHub log
// groups are always collapsed, so wrapping a single task's output hides the
// only thing worth reading behind a click, with no structure gained.
// EndGroup is guarded by the same condition rather than relying on the
// logger to ignore an unmatched call, so this is correct on older tuikit too.
groupOutput := parentTask == nil && len(execs) > 1
if groupOutput {
if tal, ok := logger.Log().(io.TaskAwareLogger); ok {
tal.BeginGroup(parent.Ref().String())
}
Expand All @@ -283,7 +289,9 @@ func handleExec(
parentTask.Children = append(parentTask.Children, tracker.Tasks()...)
} else {
if tal, ok := logger.Log().(io.TaskAwareLogger); ok {
tal.EndGroup()
if groupOutput {
tal.EndGroup()
}
tal.PrintTaskSummary(tracker.Tasks())
}
}
Expand Down
12 changes: 10 additions & 2 deletions internal/runner/serial/serial.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,13 @@ func handleExec(
}

parentTask := ctx.CurrentTask
if parentTask == nil {
// Group the run's output only when there is more than one task. GitHub log
// groups are always collapsed, so wrapping a single task's output hides the
// only thing worth reading behind a click, with no structure gained.
// EndGroup is guarded by the same condition rather than relying on the
// logger to ignore an unmatched call, so this is correct on older tuikit too.
groupOutput := parentTask == nil && len(execs) > 1
if groupOutput {
if tal, ok := logger.Log().(io.TaskAwareLogger); ok {
tal.BeginGroup(parent.Ref().String())
}
Expand All @@ -263,7 +269,9 @@ func handleExec(
parentTask.Children = append(parentTask.Children, tracker.Tasks()...)
} else {
if tal, ok := logger.Log().(io.TaskAwareLogger); ok {
tal.EndGroup()
if groupOutput {
tal.EndGroup()
}
tal.PrintTaskSummary(tracker.Tasks())
}
}
Expand Down
Loading