WardrikTesting. Server
(wardrik_testing v0.1.0-rc.1)
Copy Markdown
A Wardrik.Server that answers from a script, for testing packages without Wardrik.
setup do
:ok = WardrikTesting.Server.start(:my_test, secrets: ["wrk_good"])
%{scope: Wardrik.Scope.new(WardrikTesting.Server, :my_test, "acme/@maria")}
endMessages
The calling test is sent:
{:ran, id, input}for each operation.{:streamed, id, input}for each stream.{:asked, conversation, text, principal_id}for each message.{:offered, worker, tools}for each worker's tools.
Answers
- An operation returns the protocol's example output, or
nilif it has none. acme/missing, and any conversation under it, isn't found.- The agents given as
:offeredare listed and defined with their channels. agent.readreports whether the conversation is waiting on a person, as its last turn left it.- A message is answered as
WardrikTesting.Scriptdescribes. The events are written to the conversation's log if the test startedevents/1. - A stream with
"after" => "nope"fails with:invalid_request. - Following
acme/brokenfails partway. Followingacme/waitingwaits oncall_1. Following any other agent replies"Re: "followed by the input.
Summary
Functions
Adds the agent id to those offered, answering in channels.
Returns the name to start WardrikEvents under, so turns are written to it.
Replaces the agents offered with offered, each as {id, channels}.
Revokes secret, so it no longer authenticates.
Starts the server for the calling test under name.
Functions
Adds the agent id to those offered, answering in channels.
Returns the name to start WardrikEvents under, so turns are written to it.
Replaces the agents offered with offered, each as {id, channels}.
Revokes secret, so it no longer authenticates.
Starts the server for the calling test under name.
Registers the test process as name, and stops the server when the test ends.
Options
:secrets- API tokens it accepts. Each acts foracme/@mariaas an owner.[]unless set.:offered- agents it offers, each as{id, channels}or{id, channels, description}.[]unless set.