Runs - Get Test Run Statistics
Get test run statistics , used when we want to get summary of a run by outcome.
GET https://dev.azure.com/{organization}/{project}/_apis/test/runs/{runId}/Statistics?api-version=7.1
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
organization
|
path | True |
string |
The name of the Azure DevOps organization. |
project
|
path | True |
string |
Project ID or project name |
run
|
path | True |
integer int32 |
ID of the run to get. |
api-version
|
query | True |
string |
Version of the API to use. This should be set to '7.1' to use this version of the api. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
successful operation |
Security
oauth2
Type:
oauth2
Flow:
accessCode
Authorization URL:
https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
Token URL:
https://app.vssps.visualstudio.com/oauth2/token?client_assertion_type=urn:ietf:params:oauth:client-assertion-type:jwt-bearer&grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer
Scopes
Name | Description |
---|---|
vso.test | Grants the ability to read test plans, cases, results and other test management related artifacts. |
Examples
Sample request
GET https://dev.azure.com/fabrikam/fabrikam-fiber-tfvc/_apis/test/runs/1/Statistics?api-version=7.1
Sample response
{
"run": {
"id": "1",
"name": "sprint1 (Manual)",
"url": "https://dev.azure.com/fabrikam/fabrikam-fiber-tfvc/_apis/test/Runs/1"
},
"runStatistics": [
{
"state": "Completed",
"outcome": "Passed",
"count": 1
}
]
}
Definitions
Name | Description |
---|---|
Result |
ResultMetadata for the given outcome/count. |
Run |
Test run statistics per outcome. |
Shallow |
An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links. |
Test |
Test Resolution State Details. |
Test |
Test run statistics. |
ResultMetadata
ResultMetadata for the given outcome/count.
Name | Type | Description |
---|---|---|
flaky |
string |
Flaky metadata |
rerun |
string |
Rerun metadata |
RunStatistic
Test run statistics per outcome.
Name | Type | Description |
---|---|---|
count |
integer |
Test result count fo the given outcome. |
outcome |
string |
Test result outcome |
resolutionState |
Test run Resolution State. |
|
resultMetadata |
ResultMetadata for the given outcome/count. |
|
state |
string |
State of the test run |
ShallowReference
An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links.
Name | Type | Description |
---|---|---|
id |
string |
ID of the resource |
name |
string |
Name of the linked resource (definition name, controller name, etc.) |
url |
string |
Full http link to the resource |
TestResolutionState
Test Resolution State Details.
Name | Type | Description |
---|---|---|
id |
integer |
Test Resolution state Id. |
name |
string |
Test Resolution State Name. |
project |
An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links. |
TestRunStatistic
Test run statistics.
Name | Type | Description |
---|---|---|
run |
An abstracted reference to some other resource. This class is used to provide the build data contracts with a uniform way to reference other resources in a way that provides easy traversal through links. |
|
runStatistics |
Test run statistics per outcome. |