steprun: the line of an ask's end names a pipeline step's own outcome
An ask's end read 'passed' when its end was said, whatever the step's outcome: five pipeline steps read passed after 0 s and nothing said whether they ran tests, carried them or had nothing to run (failure must be loud).
This commit is contained in:
@@ -816,8 +816,8 @@ func (p *Puller) run(ctx context.Context, msg *Pulled, ask sdkstep.StepAsk, key
|
||||
} else {
|
||||
p.sayEnded(msg, ask, sdkstep.OutcomePassed, "", result, written.OutputObject)
|
||||
}
|
||||
p.logf("the %s ask %s ended on %s after %s, in its phase %q; %s", ask.Kind, ask.ID, p.Node,
|
||||
now().Sub(step.Started).Round(time.Second), step.Phase, outcome)
|
||||
p.logf("the %s ask %s ended on %s after %s, in its phase %q; %s%s", ask.Kind, ask.ID, p.Node,
|
||||
now().Sub(step.Started).Round(time.Second), step.Phase, outcome, stepOutcomeWords(result))
|
||||
if aerr := msg.Ack(); aerr != nil {
|
||||
p.logf("the ask %s ended on %s and its acknowledgement failed: %v", ask.ID, p.Node, aerr)
|
||||
}
|
||||
@@ -1055,3 +1055,28 @@ func runAnswerOf(ask sdkstep.StepAsk, result any) (sdkstep.RunAnswer, bool) {
|
||||
}
|
||||
return runAnswerIn(result)
|
||||
}
|
||||
|
||||
// stepOutcomeWords is a pipeline step's own outcome, as its step-ended says it, for the line that says the ask ended: the ask
|
||||
// passing only says its end was said, which a step that could not run or had nothing to run also does (lead-47, 2026-11-15:
|
||||
// steps "passed" in 0 s and nobody could read what they did). Empty for an ask that is no pipeline step.
|
||||
func stepOutcomeWords(result any) string {
|
||||
a, ok := result.(StepAnswer)
|
||||
if !ok {
|
||||
return ""
|
||||
}
|
||||
words := "; the step's outcome: " + a.Ended.Outcome
|
||||
if a.Ended.Said != "" {
|
||||
said := a.Ended.Said
|
||||
if len(said) > 300 {
|
||||
said = said[:300] + "..."
|
||||
}
|
||||
words += " (" + said + ")"
|
||||
}
|
||||
if t := a.Ended.Tests; t != nil {
|
||||
words += fmt.Sprintf(", %d unit and %d integration tests", t.Unit, t.Integration)
|
||||
}
|
||||
if len(a.Ended.Carried) > 0 {
|
||||
words += fmt.Sprintf(", %d carried from an earlier run", len(a.Ended.Carried))
|
||||
}
|
||||
return words
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user