Skip to main content

Test suites

A test suite is a list of saved inputs for one agent, each with what a correct answer must look like. Run the suite after every change and before you publish, and you find out right away if the change broke something that used to work.

Each test case has:

  • a name, such as Refund outside the window;
  • an input: exactly what a user would send the agent;
  • one to ten expectations that the answer must meet.

An agent can have up to 25 test cases.

Where tests live​

Open an agent's canvas and click Tests in the toolbar, or go to /agents/<agent-id>/tests. The page shows:

  • the Latest run, with each case's outcome, every expectation with ✓ / ✗ / ?, and the answer the agent gave;
  • the Test cases, each with the outcome it got last time.

Use Add test to write a case by hand, the pencil to edit one, and Run all tests to run the suite.

Expectations​

ExpectationPasses whenExample value
Output containsThe answer includes the text. Case and extra spaces are ignored.30 days
Output does not containThe answer does not include the text.guarantee
Output matches regexThe regular expression matches the answer (case-insensitive).order #\d+
Output equalsThe whole answer equals the text, ignoring case and extra spaces.positive
Finishes within (seconds)The run took at most that many seconds.10
A reviewer agrees thatA model reads the input and the answer and agrees the criterion is met.politely declines and offers to connect a human

The reviewer expectation​

A reviewer agrees that… is graded by Convolution's own model, not by your LLM key. It is shown the criterion, the test input and the answer, judges only that criterion, and gives a one-sentence reason, which you see next to the check.

If that model isn't available on your deployment, or can't be reached, the check can't be decided. The case then ends as Error, never as passed.

Outcomes​

Each case ends in one of three outcomes:

OutcomeMeaning
PassedThe run completed and every expectation passed.
FailedThe run completed, and at least one expectation failed.
ErrorNothing could be judged: the run failed or was stopped, or a check couldn't be decided (an invalid regex, no reviewer model, an unknown duration).

An error is not a failed expectation. It means the test told you nothing, so read the error or the check detail and run it again.

Running a suite​

Run all tests starts every case at once. Each case is a real run of the agent's current version. It's charged like any run, and your spend cap applies. A suite of 12 cases is 12 runs.

  • Only one suite runs per agent at a time. Starting another while one is running is refused.
  • Only the agent's owner can add, edit, delete or run its tests.
  • An agent that can't start (a broken canvas, a reached spend cap) still gets a result: its cases end as Error.

When every case has a result, you get a notification: Tests passed or Tests failed, with the agent name, how many passed, and the version they ran on. Open results takes you to the Tests page.

Tests from chat​

Every request comes back as a proposal card. Nothing is saved or run until you approve it. Ask from a new chat, not from the agent's own conversation (there, a message starting with "Run" runs the agent), and type the agent's name without @: an @mention runs the agent.

Write tests. Ask for tests and name the agent:

write tests for Support Replies

When the platform model is configured, it reads the agent's prompts, rules and tools, plus your request, and drafts up to five cases. The card lists each one (the input and its expectations). Add tests saves them.

You can also spell out one case yourself:

add a test to Support Replies: input "Can I return shoes after 45 days?" should mention "30 days"

Without the platform model, this is the only form that works: an input "…" followed by one or more should contain "…", should mention "…" or should not say "…".

Run tests.

run Support Replies' tests

The card shows how many cases will run and that each is charged as a run. Run tests starts the suite, and you get the notification when it finishes.

Covers the current version​

A suite run records a fingerprint of the agent: a hash of its canvas (nodes and edges) and its configuration, which includes the prompt compiled from its rules. Layout is left out. Moving nodes around, selecting them or resizing them doesn't change the fingerprint, and neither does running the agent.

The fingerprint changes when what the agent does can change: a canvas edit, a rule edit, a rollback. A suite run "covers the current version" when its fingerprint matches the agent as it is now.

Tests before publishing​

In a team workspace, owners and managers can turn on Tests before publishing in Workspace → Security → Policies. With it on, an agent that has test cases can be published only when its latest suite run:

  • has finished;
  • covers the current version (same fingerprint);
  • ran every current case (no cases added since);
  • passed every case.

Otherwise publishing is refused with the reason, for example the agent changed since its tests last ran. Run them again. An agent with no test cases isn't affected by this policy.

See also Security scanning for the matching Scan before publishing policy.