PublishTestResults@1 - 發佈測試結果 v1 工作
將測試結果發佈至 Azure Pipelines。
語法
# Publish test results v1
# Publish test results to Azure Pipelines.
- task: PublishTestResults@1
inputs:
testRunner: 'JUnit' # 'JUnit' | 'NUnit' | 'VSTest' | 'XUnit'. Required. Test Result Format. Default: JUnit.
testResultsFiles: '**/TEST-*.xml' # string. Required. Test Results Files. Default: **/TEST-*.xml.
#mergeTestResults: false # boolean. Merge Test Results. Default: false.
#testRunTitle: # string. Test Run Title.
# Advanced
#platform: # string. Platform.
#configuration: # string. Configuration.
#publishRunAttachments: true # boolean. Upload Test Attachments. Default: true.
輸入
testRunner
-
測試結果格式
string
。 必須的。 允許的值:JUnit
、、、NUnit
VSTest
。XUnit
預設值:JUnit
。
指定您想要發佈的結果檔案格式。 支援下列格式:CTest、JUnit、NUnit 2、NUnit 3、Visual Studio Test xUnit 2。
testResultsFiles
-
測試結果檔案
string
。 必須的。 預設值:**/TEST-*.xml
。
指定一或多個測試結果檔案。
- 您可以使用單一資料夾通配符 (
*
) 和遞歸通配符 (**
)。 例如,**/TEST-*.xml
搜尋所有子目錄中名稱開頭為TEST-
的所有 XML 檔案。 如果使用 VSTest 做為測試結果格式,則檔類型應變更為.trx
,例如**/TEST-*.trx
- 您可以指定多個路徑,並以新行分隔。
- 此外,接受迷你模式。
例如,!TEST[1-3].xml
會排除名為 TEST1.xml
、TEST2.xml
或 TEST3.xml
的檔案。
mergeTestResults
-
合併測試結果
boolean
。 預設值:false
。
當這個布林值 true
時,工作會針對單一 測試回合報告所有檔案的測試結果,。 如果值為 false
,工作會為每個測試結果檔案建立個別的測試回合。
備註
使用合併測試結果設定來合併來自相同測試架構的檔案,以確保正確計算結果對應和持續時間。
testRunTitle
-
測試回合標題
string
。
選擇性。 指定將報告結果的測試回合名稱。 您可以使用組建或發行管線中宣告的變數名稱。
platform
-
平臺
string
。
選擇性。 指定應該報告測試回合的組建平臺。 例如: x64
或 x86
。 如果您在建置工作中為平臺定義變數,請在這裡使用它。
configuration
-
組態
string
。
選擇性。 指定應該報告測試回合的組建組態。 例如: Debug
或 Release
。 如果您在建置工作中定義組態的變數,請在這裡使用它。
publishRunAttachments
-
上傳測試附件
boolean
。 預設值:true
。
選擇性。 當這個布爾值 true
時,工作會將所有測試結果檔案當做附件上傳至測試回合。
工作控制選項
除了工作輸入之外,所有工作都有控制選項。 如需詳細資訊,請參閱 控制項選項和一般工作屬性。
輸出變數
沒有。
備註
PublishTestResults@2 是這項工作的較新版本,可提供 NUnit3 支援和支援 Minimatch 檔案模式。
需求
要求 | 說明 |
---|---|
管線類型 | YAML、傳統組建、傳統版本 |
執行於 | Agent、DeploymentGroup |
需求 | 沒有 |
功能 | 此工作不符合作業中後續工作的任何需求。 |
命令限制 | 任意 |
Settable 變數 | 任意 |
代理程式版本 | 2.144.0 或更新 |
工作類別 | 測試 |
要求 | 說明 |
---|---|
管線類型 | YAML、傳統組建、傳統版本 |
執行於 | Agent、DeploymentGroup |
需求 | 沒有 |
功能 | 此工作不符合作業中後續工作的任何需求。 |
命令限制 | 任意 |
Settable 變數 | 任意 |
代理程式版本 | 1.83.0 或更新 |
工作類別 | 測試 |