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:
@@ -627,3 +627,18 @@ func TestPullAnswersAnAskItCannotRead(t *testing.T) {
|
||||
t.Fatalf("the unread ask's step = %+v (%v)", s, ok)
|
||||
}
|
||||
}
|
||||
|
||||
// A pipeline step's own outcome is said beside the ask's end, so a step that had nothing to run never reads as a plain pass.
|
||||
func TestTheStepsOwnOutcomeIsSaid(t *testing.T) {
|
||||
got := stepOutcomeWords(StepAnswer{Ended: sdkstep.StepEnded{Outcome: sdkstep.OutcomeNothingToRun}})
|
||||
if !strings.Contains(got, sdkstep.OutcomeNothingToRun) {
|
||||
t.Errorf("words = %q", got)
|
||||
}
|
||||
got = stepOutcomeWords(StepAnswer{Ended: sdkstep.StepEnded{Outcome: sdkstep.OutcomePassed, Tests: &sdkstep.TestCounts{Unit: 12}}})
|
||||
if !strings.Contains(got, "12 unit") {
|
||||
t.Errorf("words = %q", got)
|
||||
}
|
||||
if stepOutcomeWords(map[string]string{"ran": "x"}) != "" {
|
||||
t.Error("an ask that is no step named an outcome")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user