Codecoverage - Get Test Run Code Coverage

GET https://vstmr.dev.azure.com/{organization}/{project}/_apis/testresults/runs/{runId}/codecoverage?flags={flags}&api-version=7.1-preview.1

URI 参数

名称 必需 类型 说明
organization
path True

string

Azure DevOps 组织的名称。

project
path True

string

项目 ID 或项目名称

runId
path True

integer

int32
api-version
query True

string

要使用的 API 版本。 这应设置为“7.1-preview.1”才能使用此版本的 API。

flags
query True

integer

int32

响应

名称 类型 说明
200 OK

TestRunCoverage[]

成功的操作

安全性

oauth2

类型: oauth2
流向: accessCode
授权 URL: https://app.vssps.visualstudio.com/oauth2/authorize&response_type=Assertion
令牌 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

作用域

名称 说明
vso.test 授予读取测试计划、事例、结果和其他测试管理相关项目的能力。

定义

名称 说明
CoverageStatistics
FunctionCoverage
ModuleCoverage
ShallowReference

对某些其他资源的抽象引用。 此类用于为生成数据协定提供一种统一的方式来引用其他资源,以便轻松遍历链接。

TestRunCoverage

测试运行代码覆盖率详细信息

CoverageStatistics

名称 类型 说明
blocksCovered

integer

blocksNotCovered

integer

linesCovered

integer

linesNotCovered

integer

linesPartiallyCovered

integer

FunctionCoverage

名称 类型 说明
class

string

name

string

namespace

string

sourceFile

string

statistics

CoverageStatistics

ModuleCoverage

名称 类型 说明
blockCount

integer

blockData

string[]

fileUrl

string

代码覆盖率文件 URL

functions

FunctionCoverage[]

name

string

signature

string

signatureAge

integer

statistics

CoverageStatistics

ShallowReference

对某些其他资源的抽象引用。 此类用于为生成数据协定提供一种统一的方式来引用其他资源,以便轻松遍历链接。

名称 类型 说明
id

string

资源的 ID

name

string

链接资源的名称 (定义名称、控制器名称等 )

url

string

指向资源的完整 http 链接

TestRunCoverage

测试运行代码覆盖率详细信息

名称 类型 说明
lastError

string

上一个错误

modules

ModuleCoverage[]

模块覆盖率列表

state

string

状态

testRun

ShallowReference

测试运行的参考。