X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/087d725b5ab41ad34ffd24938482d45a8b99a080..3b7a3676dc3614ee3099e8798b5d0c07cb116b93:/daemon_test.go?ds=inline diff --git a/daemon_test.go b/daemon_test.go index 6a8cd3e..bfb4efb 100644 --- a/daemon_test.go +++ b/daemon_test.go @@ -16,6 +16,7 @@ func TestClientsSeeTheTurnAsItHappens(t *testing.T) { server.reply = func(w http.ResponseWriter, call ModelFakeCall) { if call.number == 0 { modelWriteEvents(w, modelCompletedEvent([]any{modelFunctionCallItem("fc_1", "call_1", "shell", `{"command":"echo hi"}`)}, 100, 0, 5)) + return } @@ -29,6 +30,7 @@ func TestClientsSeeTheTurnAsItHappens(t *testing.T) { second.WaitFor(t, "[connected to OneChat]") first.Type("Run echo hi.") + for _, client := range []*TerminalTestClient{first, second} { client.WaitFor(t, "[done]") require.Equal(t, "[connected to OneChat]\n[working]\n[tool] shell {\"command\":\"echo hi\"}\n[result] hi\nIt said hi.\n[done]\n", client.Output()) @@ -121,6 +123,7 @@ func TestDaemonLogHasATimeStampOnlyOutsideTheJournal(t *testing.T) { t.Setenv("JOURNAL_STREAM", tc.journal) var out strings.Builder + daemonLogger(&out, "onechat: ").Print("the agent is ready") require.Regexp(t, tc.line, out.String()) })