The seat calls a gate that raised no machine the mesh composes an error, whatever judged it
A check asked by the controller before its own build of the issue 285 fix was registered was judged by the controller the mesh ran then, which passed 0 of 4 composing. The judge is the running controller by design, so the rule is read where the verdict is taken too: from the machines the verdict lists.
This commit is contained in:
@@ -429,3 +429,31 @@ func TestAFailedScriptIsSaidByWhatFailed(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// **Issue 285**: a judge from before the rule passed "every machine composes with the change as it did
|
||||
// without (0 of 4 compose)". The seat reads the machines itself: a machine the mesh composes that did not
|
||||
// compose in the gate's store makes the gate an error, whatever judged it.
|
||||
func TestTheSeatCallsAGateThatRaisedNoMachineAnError(t *testing.T) {
|
||||
old := "bus users without a credential: controller\n" + `{"verdict":"pass","summary":"every machine composes with the change as it did without (0 of 2 compose)",
|
||||
"machines":[{"described":"the hub","live-composes":true,"base":{"composes":false}},
|
||||
{"described":"a machine","live-composes":true,"base":{"composes":false}}]}`
|
||||
v, ok := readGateVerdict([]byte(old))
|
||||
if !ok {
|
||||
t.Fatal("a verdict after a line of composition's was not read")
|
||||
}
|
||||
verdict, summary, raised := gateRaisedTheMesh(v)
|
||||
if raised || verdict != "error" || !strings.Contains(summary, "2 of 2 machines") || !strings.Contains(summary, "the hub") {
|
||||
t.Errorf("0 of 2 composing is %q %q", verdict, summary)
|
||||
}
|
||||
good := `{"verdict":"pass","summary":"(2 of 2 compose)","machines":[{"described":"the hub","live-composes":true,"base":{"composes":true}},
|
||||
{"described":"a laptop","live-composes":false,"base":{"composes":false}}]}`
|
||||
v, _ = readGateVerdict([]byte(good))
|
||||
if _, _, raised := gateRaisedTheMesh(v); !raised {
|
||||
t.Error("a machine that does not compose on the mesh either was read as the gate's failure")
|
||||
}
|
||||
failed := `{"verdict":"fail","summary":"x","machines":[{"described":"the hub","live-composes":true,"base":{"composes":false}}]}`
|
||||
v, _ = readGateVerdict([]byte(failed))
|
||||
if _, _, raised := gateRaisedTheMesh(v); !raised {
|
||||
t.Error("a failing verdict is the change's, and stands")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user