Share via


Codecoverage - Fetch Source Code Coverage Report

GET https://vstmr.dev.azure.com/{organization}/{project}/_apis/testresults/codecoverage/sourceview?buildId={buildId}&api-version=7.2-preview.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

api-version
query True

string

Version of the API to use. This should be set to '7.2-preview.1' to use this version of the api.

buildId
query True

integer (int32)

Responses

Name Type Description
200 OK

SourceViewBuildCoverage[]

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.

Definitions

Name Description
BuildConfiguration

BuildConfiguration Details.

CoverageStatistics
FileCoverageData
FolderCoverageData
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.

SourceViewBuildCoverage

BuildConfiguration

BuildConfiguration Details.

Name Type Description
branchName

string

Branch name for which build is generated.

buildDefinitionId

integer (int32)

BuildDefinitionId for build.

buildSystem

string

Build system.

creationDate

string (date-time)

Build Creation Date.

flavor

string

Build flavor (eg Build/Release).

id

integer (int32)

BuildConfiguration Id.

number

string

Build Number.

platform

string

BuildConfiguration Platform.

project

ShallowReference

Project associated with this BuildConfiguration.

repositoryGuid

string

Repository Guid for the Build.

repositoryType

string

Repository Type (eg. TFSGit).

sourceVersion

string

Source Version(/first commit) for the build was triggered.

targetBranchName

string

Target BranchName.

uri

string

Build Uri.

CoverageStatistics

Name Type Description
blocksCovered

integer (int32)

blocksNotCovered

integer (int32)

branchesCovered

integer (int32)

branchesNotCovered

integer (int32)

linesCovered

integer (int32)

linesNotCovered

integer (int32)

linesPartiallyCovered

integer (int32)

FileCoverageData

Name Type Description
coverageStatistics

CoverageStatistics

name

string

FolderCoverageData

Name Type Description
coverageStatistics

CoverageStatistics

files

FileCoverageData[]

folders

FolderCoverageData[]

name

string

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

SourceViewBuildCoverage

Name Type Description
configuration

BuildConfiguration

Build Configuration

folderCoverageData

FolderCoverageData

Folder Level CoverageDetails