Runs - Query
根據篩選條件執行查詢測試。 必要欄位為 minLastUpdatedDate 和 maxLastUpdatedDate。
GET https://dev.azure.com/{organization}/{project}/_apis/test/runs?minLastUpdatedDate={minLastUpdatedDate}&maxLastUpdatedDate={maxLastUpdatedDate}&api-version=7.1
GET https://dev.azure.com/{organization}/{project}/_apis/test/runs?minLastUpdatedDate={minLastUpdatedDate}&maxLastUpdatedDate={maxLastUpdatedDate}&state={state}&planIds={planIds}&isAutomated={isAutomated}&publishContext={publishContext}&buildIds={buildIds}&buildDefIds={buildDefIds}&branchName={branchName}&releaseIds={releaseIds}&releaseDefIds={releaseDefIds}&releaseEnvIds={releaseEnvIds}&releaseEnvDefIds={releaseEnvDefIds}&runTitle={runTitle}&$top={$top}&continuationToken={continuationToken}&api-version=7.1
URI 參數
| 名稱 | 位於 | 必要 | 類型 | Description |
|---|---|---|---|---|
|
organization
|
path | True |
string |
Azure DevOps 組織的名稱。 |
|
project
|
path | True |
string |
項目識別碼或項目名稱 |
|
api-version
|
query | True |
string |
要使用的 API 版本。 這應該設定為 『7.1』 以使用此版本的 API。 |
|
max
|
query | True |
string (date-time) |
要查詢的執行上次修改日期上限(強制,最小和最大日期之間的差異最多 7 天)。 |
|
min
|
query | True |
string (date-time) |
要查詢的執行上次修改日期下限(必要)。 |
|
$top
|
query |
integer (int32) |
要查詢的執行數目。 限制為 100 |
|
|
branch
|
query |
string |
要查詢的執行來源分支名稱。 |
|
|
build
|
query |
string (array (int32)) |
要查詢的執行定義識別碼,以逗號分隔的有效標識符清單(限制標識元 10)。 |
|
|
build
|
query |
string (array (int32)) |
要查詢的執行組建標識碼,以逗號分隔的有效標識符清單(限制標識元 10)。 |
|
|
continuation
|
query |
string |
continuationToken 從前一個批次接收,或第一個批次的 null。 使用者不應該建立它(或改變,如果從最後一批收到的話)。 |
|
|
is
|
query |
boolean |
要查詢的執行自動化類型。 |
|
|
plan
|
query |
string (array (int32)) |
要查詢的執行計劃識別碼,以逗號分隔的有效標識符清單(限制標識元 10)。 |
|
|
publish
|
query |
要查詢之執行的 PublishContext。 |
||
|
release
|
query |
string (array (int32)) |
要查詢的執行版本定義識別碼,以逗號分隔的有效標識符清單(限制標識元 10)。 |
|
|
release
|
query |
string (array (int32)) |
要查詢的執行環境定義識別碼,以逗號分隔的有效標識符清單(限制標識元 10 的限制)。 |
|
|
release
|
query |
string (array (int32)) |
要查詢的執行環境標識碼,以逗號分隔的有效標識符清單(限制標識元 10 的限制)。 |
|
|
release
|
query |
string (array (int32)) |
要查詢的執行版本識別碼,以逗號分隔的有效標識符清單(限制標識元 10)。 |
|
|
run
|
query |
string |
執行要查詢的執行標題。 |
|
|
state
|
query |
要查詢的執行目前狀態。 |
回應
| 名稱 | 類型 | Description |
|---|---|---|
| 200 OK |
Test |
成功作業 |
安全性
oauth2
類型:
oauth2
Flow:
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
範圍
| 名稱 | Description |
|---|---|
| vso.test | 授與讀取測試計劃、案例、結果和其他測試管理相關成品的能力。 |
定義
| 名稱 | Description |
|---|---|
|
Build |
BuildConfiguration 詳細數據。 |
|
Custom |
自訂欄位資訊。 允許的索引鍵:值組 - (AttemptId: int value, IsTestResultFlaky: bool) |
|
Dtl |
這是暫存類別,可提供測試回合環境的詳細數據。 |
|
Identity |
|
|
Job |
管線中的作業。 這與 YAML 中的矩陣相關。 |
|
Phase |
管線中的階段 |
|
Pipeline |
管線參考 |
|
Reference |
表示 REST 參考連結集合的類別。 |
|
Release |
版本的參考。 |
|
Result |
所指定結果/計數的 ResultMetadata。 |
|
Run |
這個類別用來提供用於探索的篩選條件 |
|
Run |
測試每個結果的執行統計數據。 |
|
Shallow |
一些其他資源的抽象參考。 這個類別可用來提供建置數據合約,以統一的方式參考其他資源,以提供簡單的透過連結周遊的方式。 |
|
Stage |
管線中的階段 |
|
Test |
測試環境詳細數據。 |
|
Test |
測試解析狀態詳細數據。 |
|
Test |
測試回合詳細數據。 |
|
Test |
要查詢之執行的 PublishContext。 |
|
Test |
|
|
Test |
測試回合的子狀態類型。 |
|
Test |
附加至執行或結果的標籤。 |
BuildConfiguration
BuildConfiguration 詳細數據。
| 名稱 | 類型 | Description |
|---|---|---|
| branchName |
string |
產生組建的分支名稱。 |
| buildDefinitionId |
integer (int32) |
BuildDefinitionId for build。 |
| buildSystem |
string |
建置系統。 |
| creationDate |
string (date-time) |
組建建立日期。 |
| flavor |
string |
組建類別(例如組建/發行)。 |
| id |
integer (int32) |
BuildConfiguration識別符。 |
| number |
string |
組建編號。 |
| platform |
string |
BuildConfiguration Platform。 |
| project |
與此 BuildConfiguration 相關聯的專案。 |
|
| repositoryGuid |
string |
組建的存放庫 Guid。 |
| repositoryType |
string |
存放庫類型(例如TFSGit)。 |
| sourceVersion |
string |
已觸發組建的來源版本(/第一次認可)。 |
| targetBranchName |
string |
Target BranchName。 |
| uri |
string |
組建 URI。 |
CustomTestField
自訂欄位資訊。 允許的索引鍵:值組 - (AttemptId: int value, IsTestResultFlaky: bool)
| 名稱 | 類型 | Description |
|---|---|---|
| fieldName |
string |
功能變數名稱。 |
| value |
object |
域值。 |
DtlEnvironmentDetails
這是暫存類別,可提供測試回合環境的詳細數據。
| 名稱 | 類型 | Description |
|---|---|---|
| csmContent |
string |
|
| csmParameters |
string |
|
| subscriptionName |
string |
IdentityRef
| 名稱 | 類型 | Description |
|---|---|---|
| _links |
此欄位包含圖表主旨的相關零或更多有趣連結。 您可以叫用這些連結,以取得此圖表主題的其他關聯性或更詳細的資訊。 |
|
| descriptor |
string |
描述元是在系統執行時參考圖表主旨的主要方式。 此欄位會唯一識別帳戶和組織之間的相同圖表主題。 |
| directoryAlias |
string |
已淘汰 - 查詢 IdentityRef “_links” 字典中參考的 Graph 使用者,即可擷取 |
| displayName |
string |
這是圖形主體的非唯一顯示名稱。 若要變更此欄位,您必須在來源提供者中變更其值。 |
| id |
string |
|
| imageUrl |
string |
已淘汰 - 可在 IdentityRef “_links” 字典的 “avatar” 專案中取得 |
| inactive |
boolean |
已淘汰 - 可藉由查詢 GraphUser “_links” 字典的 “membershipState” 專案中參考的 Graph 成員資格狀態來擷取 |
| isAadIdentity |
boolean |
已淘汰 - 可以從描述元的主體類型推斷 (Descriptor.IsAadUserType/Descriptor.IsAadGroupType) |
| isContainer |
boolean |
已淘汰 - 可以從描述元的主體類型推斷 (Descriptor.IsGroupType) |
| isDeletedInOrigin |
boolean |
|
| profileUrl |
string |
已淘汰 - 未在 ToIdentityRef 的大部分預先存在實作中使用 |
| uniqueName |
string |
已淘汰 - 請改用 Domain+PrincipalName |
| url |
string |
此 URL 是此圖表主體來源資源的完整路由。 |
JobReference
管線中的作業。 這與 YAML 中的矩陣相關。
| 名稱 | 類型 | Description |
|---|---|---|
| attempt |
integer (int32) |
嘗試作業數目 |
| jobName |
string |
YAML 中的矩陣會產生具有矩陣中不同輸入之作業的複本。 JobName 是這些輸入的名稱。 名稱支援的長度上限為 256 個字元。 |
PhaseReference
管線中的階段
| 名稱 | 類型 | Description |
|---|---|---|
| attempt |
integer (int32) |
嘗試階段數目 |
| phaseName |
string |
階段的名稱。 名稱支援的長度上限為 256 個字元。 |
PipelineReference
管線參考
| 名稱 | 類型 | Description |
|---|---|---|
| jobReference |
作業的參考 |
|
| phaseReference |
階段的參考。 |
|
| pipelineId |
integer (int32) |
與此管線實例相關的管線參考。 |
| stageReference |
階段的參考。 |
ReferenceLinks
表示 REST 參考連結集合的類別。
| 名稱 | 類型 | Description |
|---|---|---|
| links |
object |
連結的只讀檢視。 因為參考連結是只讀的,所以我們只想要將其公開為只讀。 |
ReleaseReference
版本的參考。
| 名稱 | 類型 | Description |
|---|---|---|
| attempt |
integer (int32) |
發行嘗試次數。 |
| creationDate |
string (date-time) |
發行建立日期(UTC)。 |
| definitionId |
integer (int32) |
發行定義標識碼。 |
| environmentCreationDate |
string (date-time) |
環境建立日期(UTC)。 |
| environmentDefinitionId |
integer (int32) |
發行環境定義標識碼。 |
| environmentDefinitionName |
string |
釋放環境定義名稱。 |
| environmentId |
integer (int32) |
發行環境標識碼。 |
| environmentName |
string |
發行環境名稱。 |
| id |
integer (int32) |
版本標識碼。 |
| name |
string |
版本名稱。 |
ResultMetadata
所指定結果/計數的 ResultMetadata。
| 值 | Description |
|---|---|
| flaky |
Flaky 元數據 |
| rerun |
重新執行元數據 |
RunFilter
這個類別用來提供用於探索的篩選條件
| 名稱 | 類型 | Description |
|---|---|---|
| sourceFilter |
string |
測試案例來源的篩選 (測試容器) |
| testCaseFilter |
string |
測試案例的篩選 |
RunStatistic
測試每個結果的執行統計數據。
| 名稱 | 類型 | Description |
|---|---|---|
| count |
integer (int32) |
給定結果的測試結果計數。 |
| outcome |
string |
測試結果結果 |
| resolutionState |
測試回合解析狀態。 |
|
| resultMetadata |
所指定結果/計數的 ResultMetadata。 |
|
| state |
string |
測試回合的狀態 |
ShallowReference
一些其他資源的抽象參考。 這個類別可用來提供建置數據合約,以統一的方式參考其他資源,以提供簡單的透過連結周遊的方式。
| 名稱 | 類型 | Description |
|---|---|---|
| id |
string |
資源的標識碼 |
| name |
string |
連結資源名稱(定義名稱、控制器名稱等) |
| url |
string |
資源的完整 HTTP 連結 |
StageReference
管線中的階段
| 名稱 | 類型 | Description |
|---|---|---|
| attempt |
integer (int32) |
嘗試階段數目 |
| stageName |
string |
階段的名稱。 名稱支援的長度上限為 256 個字元。 |
TestEnvironment
測試環境詳細數據。
| 名稱 | 類型 | Description |
|---|---|---|
| environmentId |
string (uuid) |
測試環境標識碼。 |
| environmentName |
string |
測試環境名稱。 |
TestResolutionState
測試解析狀態詳細數據。
| 名稱 | 類型 | Description |
|---|---|---|
| id |
integer (int32) |
測試解析狀態標識碼。 |
| name |
string |
測試解析狀態名稱。 |
| project |
一些其他資源的抽象參考。 這個類別可用來提供建置數據合約,以統一的方式參考其他資源,以提供簡單的透過連結周遊的方式。 |
TestRun
測試回合詳細數據。
| 名稱 | 類型 | Description |
|---|---|---|
| build |
與此測試回合相關聯的組建。 |
|
| buildConfiguration |
建立與此測試回合相關聯的組態詳細數據。 |
|
| comment |
string |
分析回合的批注。 |
| completedDate |
string (date-time) |
執行完成的日期時間。 |
| controller |
string |
測試執行控制器。 |
| createdDate |
string (date-time) |
測試回合 CreatedDate。 |
| customFields |
TestRun 的自定義欄位清單。 |
|
| dropLocation |
string |
卸除測試回合的位置。 |
| dtlAutEnvironment |
一些其他資源的抽象參考。 這個類別可用來提供建置數據合約,以統一的方式參考其他資源,以提供簡單的透過連結周遊的方式。 |
|
| dtlEnvironment |
一些其他資源的抽象參考。 這個類別可用來提供建置數據合約,以統一的方式參考其他資源,以提供簡單的透過連結周遊的方式。 |
|
| dtlEnvironmentCreationDetails |
這是暫存類別,可提供測試回合環境的詳細數據。 |
|
| dueDate |
string (date-time) |
測試回合的到期日期和時間。 |
| errorMessage |
string |
與執行相關聯的錯誤訊息。 |
| filter |
這個類別用來提供用於探索的篩選條件 |
|
| id |
integer (int32) |
測試回合的標識碼。 |
| incompleteTests |
integer (int32) |
不完整的測試數目。 |
| isAutomated |
boolean |
如果測試回合是自動化的,則為 true,否則為 false。 |
| iteration |
string |
執行所屬的反覆專案。 |
| lastUpdatedBy |
上次更新測試回合的小組基礎標識碼。 |
|
| lastUpdatedDate |
string (date-time) |
上次更新的日期和時間 |
| name |
string |
測試回合的名稱。 |
| notApplicableTests |
integer (int32) |
不適用的測試數目。 |
| owner |
執行擁有者的Team Foundation識別碼。 |
|
| passedTests |
integer (int32) |
執行中通過的測試數目 |
| phase |
string |
testRun 的階段/狀態。 |
| pipelineReference |
這個測試回合所屬之管線的參考。 |
|
| plan |
與此測試回合相關聯的測試計劃。 |
|
| postProcessState |
string |
後續處理狀態。 |
| project |
與此執行相關聯的專案。 |
|
| release |
測試回合的版本參考。 |
|
| releaseEnvironmentUri |
string |
TestRun 的版本環境 URI。 |
| releaseUri |
string |
TestRun 的版本 URI。 |
| revision |
integer (int32) |
|
| runStatistics |
依結果執行 RunSummary。 |
|
| startedDate |
string (date-time) |
執行的開始日期時間。 |
| state |
string |
執行的狀態。 類型 TestRunState 有效狀態 - 未指定、NotStarted、InProgress、Completed、Waiting、Aborted、NeedsInvestigation |
| substate |
TestRun Substate。 |
|
| tags |
Test |
附加至此測試回合的標籤。 |
| testEnvironment |
與執行相關聯的測試環境。 |
|
| testMessageLogId |
integer (int32) |
|
| testSettings |
一些其他資源的抽象參考。 這個類別可用來提供建置數據合約,以統一的方式參考其他資源,以提供簡單的透過連結周遊的方式。 |
|
| totalTests |
integer (int32) |
執行中的測試總數 |
| unanalyzedTests |
integer (int32) |
執行中失敗的測試數目。 |
| url |
string |
測試回合的 URL |
| webAccessUrl |
string |
TestRun 的 Web 存取 URL。 |
TestRunPublishContext
要查詢之執行的 PublishContext。
| 值 | Description |
|---|---|
| all |
執行會針對任何內容發佈。 |
| build |
執行是針對建置內容發佈的。 |
| release |
執行已針對發行內容發佈。 |
TestRunState
| 值 | Description |
|---|---|
| aborted |
執行已停止,且已中止剩餘的測試 |
| completed |
所有測試都已完成或已略過。 |
| inProgress |
測試正在執行中。 |
| needsInvestigation |
執行需要調查,因為測試點失敗這是舊版狀態,不應再使用 |
| notStarted |
執行仍在建立中。 尚未開始測試。 |
| unspecified |
只在更新期間使用,以保留現有的值。 |
| waiting |
執行目前正在初始化 這是舊版狀態,不應再使用 |
TestRunSubstate
測試回合的子狀態類型。
| 值 | Description |
|---|---|
| abortedBySystem |
由系統中止時執行狀態。 |
| analyzed |
分析之後執行狀態。 |
| canceledByUser |
建立環境時執行狀態。 |
| cancellationInProgress |
取消進行時執行狀態。 |
| creatingEnvironment |
建立環境時執行狀態。 |
| none |
使用 noState 執行。 |
| pendingAnalysis |
暫止分析時執行狀態。 |
| runningTests |
執行測試時執行狀態。 |
| timedOut |
運行時間為 timedOut 時執行狀態。 |
TestTag
附加至執行或結果的標籤。
| 名稱 | 類型 | Description |
|---|---|---|
| name |
string |
標記的名稱,英數位元值小於 30 個字元 |