Creating a test set
Create a test set in Cloudera Agent Studio by importing test cases to run an agent against during an evaluation.
A test set is a named collection of test cases. You import the test cases from a file or paste them into the New test set page. The test set is displayed on the Test sets tab of the Evaluations page, and you can select it as the source of an evaluation run.
If you save a test set with the name of an existing test set and the content is different, Agent Studio creates a new version of the test set. If the content is identical to an existing version, Agent Studio does not create a new version.
The New test set page has the following sections:
- Test set details: The Name of the test set.
- Agent access: The Allowed agents list. If you leave the list empty, any agent can use the test set. Only agents that have a draft can be added.
- Test cases: The test cases, as a file or as pasted text.
The page accepts the test cases in one of the following formats:
- NDJSON, with one JSON object on each line.
- A JSON array of objects.
- Pretty-printed JSON objects, with a blank line between each object.
A test set can contain up to 100 test cases.
- Ensure that your user has the Admin or Builder role. The Test sets tab is not displayed for other roles. See User roles and capabilities.
- Prepare the test cases. Each test case is a JSON object that has the following fields:
- input: Required. A non-empty string of up to 64 KiB.
- id: Optional. A non-empty string. If you omit the field, Agent Studio generates an ID from the input and the run options. Agent Studio rejects a test set in which two test cases have the same ID.
- expectations: Optional. A JSON object.
- metadata: Optional. A JSON object. Do not set hitl_required to
true, because test cases that require human input are not supported. - run_options: Optional. A JSON object. The object cannot contain the keys agent or threadId.
- Ensure each serialized test case is
256 KiBor smaller. - Save the test cases in a file with the extension .ndjson, .jsonl, or .txt, or copy the test cases to paste them into the page.
- Optional: To limit the test set to specific agents, ensure that each agent has a draft in your authoring workspace. To use a published agent, first copy it to your drafts. In Agent Catalog, open the Actions menu of the agent, and then click Edit.
The message Created name vversion is displayed, and the page for the test set opens. If the content is identical to an existing version, the message name unchanged (vversion) is displayed instead.
The page for the test set is read-only. The title is the name and the version of the test set, and the page has the Test set details, Versions, Evaluation Runs, and Test cases sections.
On the Test sets tab, the table has the columns Test set, Agent, Size, Version, Last run, and Last result. A test set that no run has used displays Never run in the Last run column. To open the test set, click its row, or click in the row, and then click View test set.
If the save fails, an error message is displayed.
