go/cli: an outcome not known is not a refusal; the Go binding is checked in the Go toolchain
mesh/merge-gate pass: builds mesh-sdk, sent nowhere; no bus step; every machine composes with the change as it did without (4 of 4 compose)
mesh/repo-check pass: THE CHANGE ALTERS ITS OWN CHECK (merge-check.sh): main's version judged it; the change's judges the pull requests after it merges; it…
mesh/delivery delivered
mesh/merge-gate pass: builds mesh-sdk, sent nowhere; no bus step; every machine composes with the change as it did without (4 of 4 compose)
mesh/repo-check pass: THE CHANGE ALTERS ITS OWN CHECK (merge-check.sh): main's version judged it; the change's judges the pull requests after it merges; it…
mesh/delivery delivered
Review of hq ADR 0272: a line whose answer did not come in time may have run, and saying "nothing ran" there is a lie. Answer.Unknown and NotKnown say it may have run and name the call to look at. The SDK's repo-check ran in the TypeScript toolchain only and said "NOT TESTED HERE: go/". go/merge-check.sh now runs the Go binding in the Go toolchain, declared by the root check (mesh-check-also), as the lab does. Released as go/v0.1.9 (go/v0.1.8 is mesh-sdk #12's).
This commit is contained in:
+15
-2
@@ -26,7 +26,8 @@ func TestARequestAndAnAnswerSurviveTheirRoundTrip(t *testing.T) {
|
||||
}
|
||||
|
||||
b.Reset()
|
||||
sent := Answer{Stdout: []byte("ok\n\xff"), Stderr: []byte("said"), Exit: 3, Terminal: true, Why: "the terminal", Cut: true}
|
||||
sent := Answer{Stdout: []byte("ok\n\xff"), Stderr: []byte("said"), Exit: 3, Terminal: true, Why: "the terminal", Cut: true,
|
||||
Unknown: "no answer; the line may have run — see the call call-1"}
|
||||
if err := WriteAnswer(&b, sent); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -34,7 +35,8 @@ func TestARequestAndAnAnswerSurviveTheirRoundTrip(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !bytes.Equal(a.Stdout, sent.Stdout) || string(a.Stderr) != "said" || a.Exit != 3 || !a.Terminal || a.Why != sent.Why || !a.Cut {
|
||||
if !bytes.Equal(a.Stdout, sent.Stdout) || string(a.Stderr) != "said" || a.Exit != 3 || !a.Terminal || a.Why != sent.Why || !a.Cut ||
|
||||
a.Unknown != sent.Unknown {
|
||||
t.Fatalf("the answer came back as %+v", a)
|
||||
}
|
||||
}
|
||||
@@ -90,3 +92,14 @@ func TestAskSpeaksTheProtocolOverASocket(t *testing.T) {
|
||||
t.Fatalf("a missing socket was not said: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
// An outcome not known is never a refusal: it says the line may have run, and exits non-zero.
|
||||
func TestAnUnknownOutcomeIsNotARefusal(t *testing.T) {
|
||||
a := NotKnown("call-7", "no answer within 6m0s")
|
||||
if a.Refused != "" || a.Exit == 0 || !strings.Contains(a.Unknown, "may have run") || !strings.Contains(a.Unknown, "call-7") {
|
||||
t.Fatalf("an unknown outcome reads as %+v", a)
|
||||
}
|
||||
if b := NotKnown("", "no answer"); strings.Contains(b.Unknown, "call ") {
|
||||
t.Fatalf("an unknown outcome with no call names one: %+v", b)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user