layer-groupUnit Test Sets

Group unit tests into suites with configurable run counts for batch execution.

Manage grouped collections of unit tests that form a test suite. A unit test set bundles multiple unit tests together, each with a configurable run count, so you can execute an entire suite in a single operation.

circle-info

Run Counts

Each unit test in a set has a run_count that determines how many times it will be executed during a run. Running tests multiple times provides statistical significance -- for example, running each test 5 times helps distinguish consistent failures from flaky behavior.

Create a Unit Test Set

Create a new simulation unit test set.

curl --request POST \
     --url 'https://api.amigo.ai/v1/<YOUR-ORG-ID>/simulation/unit_test_set/' \
     --header 'Authorization: Bearer <AUTH-TOKEN>' \
     --header 'Content-Type: application/json' \
     --data '{
       "name": "Onboarding Suite - Release Validation",
       "description": "Full onboarding test suite for release candidate validation.",
       "unit_test_runs": [
         {"unit_test_id": "6618791275130b73714e8d5d", "run_count": 5},
         {"unit_test_id": "6618791275130b73714e8d6e", "run_count": 3}
       ],
       "tags": {"suite": "onboarding", "stage": "release"}
     }'

Response (201):

Create a simulation unit test set

post
/v1/{organization}/simulation/unit_test_set/

Create a new simulation unit test set.

Permissions

This endpoint requires the following permissions:

  • Simulation:CreateSimulationUnitTestSet for the simulation unit test set.
Authorizations
AuthorizationstringRequired

The username should be set to {org_id}_{user_id}, and the password should be the Amigo issued JWT token that identifies the user.

AuthorizationstringRequired

Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.

X-ORG-IDstringRequired

An optional organization identifier that indicates from which organization the token is issued. This is used in rare cases where the user to authenticate is making a request for resources in another organization.

Path parameters
organizationstringRequired
Header parameters
x-mongo-cluster-nameany ofOptional

The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.

stringOptional
or
nullOptional
Sec-WebSocket-Protocolstring[]OptionalDefault: []
Body
namestring · min: 1Required

The name of the simulation unit test set.

descriptionany ofRequired

The description of the simulation unit test set.

string · min: 1Optional
or
nullOptional
Responses
post
/v1/{organization}/simulation/unit_test_set/

List Unit Test Sets

Retrieve simulation unit test sets that match the given filters. Only sets the authenticated user has Simulation:GetSimulationUnitTestSet permission for are returned.

Common filters:

  • id=<id> (repeatable) -- filter by specific set IDs

  • is_deleted=true|false -- filter by deletion status

  • creator=<org_id,user_id> (repeatable) -- filter by creator

  • tag=key:value (repeatable; value may be * for any value, or empty for null)

  • sort_by=+created_at|-created_at|+name|-name (repeatable)

  • limit (0--20, default 20), continuation_token (int, default 0)

Get simulation unit test sets

get
/v1/{organization}/simulation/unit_test_set/

Retrieve the simulation unit test sets that match the given filters.

Permissions

This endpoint may be impacted by the following permissions:

  • Only simulation unit test sets that the authenticated user has Simulation:GetSimulationUnitTestSet permission for will be retrieved.
Authorizations
AuthorizationstringRequired

The username should be set to {org_id}_{user_id}, and the password should be the Amigo issued JWT token that identifies the user.

AuthorizationstringRequired

Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.

X-ORG-IDstringRequired

An optional organization identifier that indicates from which organization the token is issued. This is used in rare cases where the user to authenticate is making a request for resources in another organization.

Path parameters
organizationstringRequired
Query parameters
idstring[]Optional

The IDs of the simulation unit test sets to retrieve.

Default: []
limitinteger · max: 20Optional

The maximum number of simulation unit test sets to return.

Default: 20
continuation_tokenintegerOptional

The continuation token from the previous request used to retrieve the next page of simulation unit test sets.

Default: 0
is_deletedany ofOptional

Whether the simulation unit test set is deleted.

booleanOptional
or
nullOptional
unit_test_idstring[]Optional

The IDs of the unit tests that are part of the simulation unit test sets.

Default: []
creatorstring[]Optional

The creators of the simulation unit test sets.

Default: []
tagstring[]Optional

The tags of the simulation unit test sets. Must be specified using the syntax key:value, which means to match all sets with the given key and value pair among its tags. If value is *, it means the value does not matter. If value is empty, it matches against when the value is None.

Default: []
sort_bystring[]Optional

The fields to sort the sets by. Supported fields are updated_at. Specify a + before the field name to indicate ascending sorting and - for descending sorting. Multiple fields can be specified to break ties.

Default: []
Header parameters
x-mongo-cluster-nameany ofOptional

The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.

stringOptional
or
nullOptional
Sec-WebSocket-Protocolstring[]OptionalDefault: []
Responses
chevron-right
200

Succeeded.

application/json
has_morebooleanRequired

Whether there are more simulation unit test sets to retrieve.

continuation_tokenany ofRequired

The continuation token to use to retrieve the next page of simulation unit test sets.

integerOptional
or
nullOptional
filter_valuesany ofRequired

For each filter that this endpoint supports that can take on dynamic values, this field includes what these values are. This is only provided for the first page in the pagination results.

Note that the values are counted assuming the authenticated user has access to all the simulation unit test sets, so they might differ from how many sets are actually retrieved.

or
nullOptional
get
/v1/{organization}/simulation/unit_test_set/

Search Unit Test Sets

Search for simulation unit test sets by text query. Matches against the set name and description. Returns the top 50 results sorted by relevance.

  • query (required) -- the search text

  • creator=<org_id,user_id> (repeatable) -- filter by creator

  • tag=key:value (repeatable)

get
/v1/{organization}/simulation/unit_test_set/search/

Search for simulation unit test sets that match the given filters and whose name or description contains the specified query.

Permissions

This endpoint may be impacted by the following permissions:

  • Only simulation unit test sets that the authenticated user has Simulation:GetSimulationUnitTestSet permission for will be retrieved.
Authorizations
AuthorizationstringRequired

The username should be set to {org_id}_{user_id}, and the password should be the Amigo issued JWT token that identifies the user.

AuthorizationstringRequired

Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.

X-ORG-IDstringRequired

An optional organization identifier that indicates from which organization the token is issued. This is used in rare cases where the user to authenticate is making a request for resources in another organization.

Path parameters
organizationstringRequired
Query parameters
querystring · min: 1Required

The query to search for. Any simulation unit test sets containing the terms in its name or description would be returned.

creatorstring[]Optional

The creators of the simulation unit test sets. Each value must be of the format org_id,user_id.

Default: []
tagstring[]Optional

The tags of the simulation unit test sets. Must be specified using the syntax key:value, which means to match all sets with the given key and value pair among its tags. If value is *, it means the value does not matter. If value is empty, it matches against when the value is None.

Default: []
unit_test_idstring[]Optional

The IDs of the unit tests that are part of the simulation unit test sets.

Default: []
Header parameters
x-mongo-cluster-nameany ofOptional

The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.

stringOptional
or
nullOptional
Sec-WebSocket-Protocolstring[]OptionalDefault: []
Responses
chevron-right
200

Succeeded.

application/json
get
/v1/{organization}/simulation/unit_test_set/search/

Update a Unit Test Set

Update a simulation unit test set. All fields are optional -- only the fields you include will be updated. You can modify the name, description, unit test run list, and tags.

circle-info

For the description field, pass the new description string to update it, or pass null to clear it. Omitting the field (or passing an empty object {}) leaves the existing description unchanged.

Update a simulation unit test set

post
/v1/{organization}/simulation/unit_test_set/{simulation_unit_test_set_id}

Update a simulation unit test set.

Permissions

This endpoint requires the following permissions:

  • Simulation:ModifySimulationUnitTestSet for the simulation unit test set.
Authorizations
AuthorizationstringRequired

The username should be set to {org_id}_{user_id}, and the password should be the Amigo issued JWT token that identifies the user.

AuthorizationstringRequired

Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.

X-ORG-IDstringRequired

An optional organization identifier that indicates from which organization the token is issued. This is used in rare cases where the user to authenticate is making a request for resources in another organization.

Path parameters
organizationstringRequired
simulation_unit_test_set_idstringRequired

The ID of the simulation unit test set to update.

Pattern: ^[a-f0-9]{24}$
Header parameters
x-mongo-cluster-nameany ofOptional

The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.

stringOptional
or
nullOptional
Sec-WebSocket-Protocolstring[]OptionalDefault: []
Body
nameany ofOptional

The name of the simulation unit test set.

string · min: 1Optional
or
nullOptional
descriptionany ofOptional

The description of the simulation unit test set. If not specified or an empty object is provided, the description will not be updated.

Default: {}
string · min: 1Optional
or
object · _NotSetOptional

A specific type to indicate that a field is not set in the request.

or
nullOptional
unit_test_runsany ofOptional

The unit test runs that are part of this set.

or
nullOptional
tagsany ofOptional

The tags of the simulation unit test set.

or
nullOptional
Responses
post
/v1/{organization}/simulation/unit_test_set/{simulation_unit_test_set_id}

No content

Delete a Unit Test Set

Soft-delete a simulation unit test set.

Delete a simulation unit test set

delete
/v1/{organization}/simulation/unit_test_set/{simulation_unit_test_set_id}

Delete a simulation unit test set.

Permissions

This endpoint requires the following permissions:

  • Simulation:DeleteSimulationUnitTestSet for the simulation unit test set.
Authorizations
AuthorizationstringRequired

The username should be set to {org_id}_{user_id}, and the password should be the Amigo issued JWT token that identifies the user.

AuthorizationstringRequired

Amigo issued JWT token that identifies an user. It's issued either after logging in through the frontend, or manually through the SignInWithAPIKey endpoint.

X-ORG-IDstringRequired

An optional organization identifier that indicates from which organization the token is issued. This is used in rare cases where the user to authenticate is making a request for resources in another organization.

Path parameters
organizationstringRequired
simulation_unit_test_set_idstringRequired

The ID of the simulation unit test set to delete.

Pattern: ^[a-f0-9]{24}$
Header parameters
x-mongo-cluster-nameany ofOptional

The Mongo cluster name to perform this request in. This is usually not needed unless the organization does not exist yet in the Amigo organization infra config database.

stringOptional
or
nullOptional
Sec-WebSocket-Protocolstring[]OptionalDefault: []
Responses
delete
/v1/{organization}/simulation/unit_test_set/{simulation_unit_test_set_id}

No content

Last updated

Was this helpful?