Local Testing
These endpoints allow you to programmatically retrieve information about local test runs and results.
GEThttps://api.autoblocks.ai/testing/local/tests/<testExternalId>/runs
Get a list of local test runs
This endpoint returns a list of all runs for a specific local test.
Code samples for getting a list of local test runs
GET
https://api.autoblocks.ai/testing/local/tests/<testExternalId>/runscurl 'https://api.autoblocks.ai/testing/local/tests/<testExternalId>/runs' \
--header "Authorization: Bearer $AUTOBLOCKS_API_KEY"
{
"runs": [
{
"id": "cljzx8zhd00077w3sqredd0fz"
},
{
"id": "cljzxfcxr00077w1yvis84a72"
}
]
}
GEThttps://api.autoblocks.ai/testing/local/runs/<runId>/results
Get a list of local test results
This endpoint returns a list of all results for a specific local test run.
Code samples for getting a list of local test results
GET
https://api.autoblocks.ai/testing/local/runs/<runId>/resultscurl 'https://api.autoblocks.ai/testing/local/runs/<runId>/results' \
--header "Authorization: Bearer $AUTOBLOCKS_API_KEY"
{
"results": [
{
"id": "clvods6wq0003m44zc8sizv2l"
},
{
"id": "cljzxfcxr00077w1yvis84a72"
}
]
}
GEThttps://api.autoblocks.ai/testing/local/results/<testCaseResultId>
Get a specific local test result
This endpoint returns the details of a specific local test result.
Code samples for getting a specific local test result
GET
https://api.autoblocks.ai/testing/local/results/<testCaseResultId>curl 'https://api.autoblocks.ai/testing/local/results/<testCaseResultId>' \
--header "Authorization: Bearer $AUTOBLOCKS_API_KEY"
{
"testCaseResult": {
"id": "clvods6wq0003m44zc8sizv2l",
"runId": "cljzxfcxr00077w1yvis84a72",
"hash": "abc123def456",
"datasetItemId": "cljzx8zhd00077w3sqredd0fz",
"durationMs": 1500,
"events": [
{
"id": "cllmhfrrj0000q5php84hn6os",
"trace_id": "cljzx8zhd00077w3sqredd0fz",
"message": "local-event",
"timestamp": 1636329600000,
"properties" : {}
},
{
"id": "clvods6wq0003m44zc8sizv2l",
"trace_id": "cljzx8zhd00077w3sqredd0fz",
"message": "local-event-2",
"timestamp": 1636329600000,
"properties" : {}
},
],
"body": {
// Result body content (type depends on the test case)
},
"output": {
// Result output content (type depends on the test case)
},
"evaluations": [
{
"evaluatorId": "accuracy",
"score": 0.88,
"passed": true,
"threshold": {
"gte": 0.85
},
"assertions": [
{
"passed": true,
"required": true,
"criterion": "Test criterion",
"metadata": {
"notes": "Passed local requirements"
}
}
],
"metadata": {
"notes": "Performed well on key metrics"
}
}
]
}
}
Note: The body
and output
fields in the response will have types that depend on the specific test case. They are represented as generic objects in this schema.