assigner: a mover no machine holds has nothing to compose (H-A-179)
A package module with a required composition step and no node placing it ended could not run, so its pipeline could never pass. A step with nothing to judge ends nothing to run, which counts as passed, saying why. Builds: design 47 H H-A-179
This commit is contained in:
@@ -95,15 +95,17 @@ type machineEnd struct {
|
||||
|
||||
// run runs one composition step and answers what it came to: per machine not away it joins or starts the candidate's
|
||||
// composition run (§718), waits for each run's end in its key, and judges each machine from it; failed when a machine does not
|
||||
// compose, could not run when a machine could not be composed or was not judged, else passed with a warning per machine away.
|
||||
// compose, could not run when a machine could not be composed or was not judged, nothing to run when no node places the module on
|
||||
// the branch (H-A-179), else passed with a warning per machine away.
|
||||
func (r *compositionRun) run(ctx context.Context, id string, step meshwants.StepRun) stepOutcome {
|
||||
candidate, err := candidateKeyOf(step)
|
||||
if err != nil {
|
||||
return couldNotRun(err.Error())
|
||||
}
|
||||
nodes := r.inputs.machines(step.Module, step.Branch)
|
||||
if len(nodes) == 0 {
|
||||
return couldNotRun(fmt.Sprintf("no node places %s on the branch %q, so the composition step has no machine to compose", step.Module, step.Branch))
|
||||
if len(nodes) == 0 { // a mover no machine holds on the branch has nothing to judge: nothing to run, passed (H-A-179, ADR 0682 §8)
|
||||
return stepOutcome{Outcome: meshwants.StepEndedOutcomeNothingToRun,
|
||||
Said: fmt.Sprintf("no node places %s on the branch %q, so the composition step has no machine to compose", step.Module, step.Branch)}
|
||||
}
|
||||
reader := readerOf(id, step)
|
||||
prep := &runPrep{r: r, step: step}
|
||||
|
||||
@@ -259,7 +259,11 @@ func TestTheCompositionStepRunsOneAskPerMachine(t *testing.T) {
|
||||
}
|
||||
none := newRunStand(t, "src2:e1", "src2:e1", "d1")
|
||||
none.r.inputs.machines = func(string, string) []string { return machines }
|
||||
if out := none.r.run(context.Background(), "ask-step", step); out.Outcome != meshwants.StepEndedOutcomeCouldNotRun ||
|
||||
outcome := meshwants.StepEndedOutcomeCouldNotRun
|
||||
if len(machines) == 0 { // a mover no machine holds: nothing to run, saying why (H-A-179)
|
||||
outcome = meshwants.StepEndedOutcomeNothingToRun
|
||||
}
|
||||
if out := none.r.run(context.Background(), "ask-step", step); out.Outcome != outcome ||
|
||||
!strings.Contains(out.Said, want) || (len(machines) > 0 && !strings.Contains(out.Said, "shanks is away")) || len(none.asks) != 0 {
|
||||
t.Errorf("%s came to %+v, %d asks", name, out, len(none.asks))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user