Share via


VisualStudioTestPlatformInstaller@1 - Visual Studio 測試平臺安裝程式 v1 工作

使用此工作可從 nuget.org 或指定的摘要取得 Microsoft 測試平臺 ,並將它新增至工具快取。 安裝程式工作滿足 vstest 需求,而建置或發行管線中的後續Visual Studio測試工作可以執行,而不需要在代理程式電腦上安裝完整的Visual Studio。

Syntax

# Visual Studio test platform installer v1
# Acquire the test platform from nuget.org or the tool cache. Satisfies the ‘vstest’ demand and can be used for running tests and collecting diagnostic data using the Visual Studio Test task.
- task: VisualStudioTestPlatformInstaller@1
  inputs:
  # Package settings
    packageFeedSelector: 'nugetOrg' # 'nugetOrg' | 'customFeed' | 'netShare'. Required. Package Feed. Default: nugetOrg.
    #versionSelector: 'latestPreRelease' # 'latestPreRelease' | 'latestStable' | 'specificVersion'. Required when packageFeedSelector = nugetOrg || packageFeedSelector = customFeed. Version. Default: latestPreRelease.
    #testPlatformVersion: # string. Required when versionSelector = specificVersion. Test Platform Version. 
    #customFeed: # string. Required when packageFeedSelector = customFeed. Package Source. 
    #username: # string. Optional. Use when packageFeedSelector = customFeed. User Name. 
    #password: # string. Optional. Use when packageFeedSelector = customFeed. Password. 
    #netShare: # string. Required when packageFeedSelector = netShare. UNC Path.
# Visual Studio Test Platform Installer v1
# Acquires the test platform from nuget.org or the tools cache. Satisfies the ‘vstest’ demand and can be used for running tests and collecting diagnostic data using the Visual Studio Test task.
- task: VisualStudioTestPlatformInstaller@1
  inputs:
  # Package settings
    packageFeedSelector: 'nugetOrg' # 'nugetOrg' | 'customFeed' | 'netShare'. Required. Package Feed. Default: nugetOrg.
    #versionSelector: 'latestPreRelease' # 'latestPreRelease' | 'latestStable' | 'specificVersion'. Required when packageFeedSelector = nugetOrg || packageFeedSelector = customFeed. Version. Default: latestPreRelease.
    #testPlatformVersion: # string. Required when versionSelector = specificVersion. Test Platform Version. 
    #customFeed: # string. Required when packageFeedSelector = customFeed. Package Source. 
    #username: # string. Optional. Use when packageFeedSelector = customFeed. User Name. 
    #password: # string. Optional. Use when packageFeedSelector = customFeed. Password. 
    #netShare: # string. Required when packageFeedSelector = netShare. UNC Path.

輸入

packageFeedSelector - 套件摘要
string. 必要。 允許的值: nugetOrg (官方 Nuget) 、 customFeed (自定義摘要) , netShare (網路路徑) 。 預設值:nugetOrg

指定工作擷取 Visual Studio Test Platform NuGet 套件的摘要。

nugetOrg - 官方 NuGet從 NuGet 取得測試平臺套件。 此選項需要代理程式電腦上的因特網連線能力。

customFeed - 自訂摘要:從 Azure DevOps 或 TFS 中的自定義摘要或套件管理摘要取得測試平臺套件。

netShare - 網路路徑:從網路共用安裝測試平臺。 必須從 NuGet 下載指定的 Microsoft.TestPlatform.nupkg 版本,並放置在組建/發行代理程式可以存取的網路共用上。


versionSelector - 版本
string. 當 packageFeedSelector = nugetOrg || packageFeedSelector = customFeed 時為必要。 允許的值: latestPreRelease (最新 (包含發行前版本) ) 、 latestStable (最新穩定) , specificVersion (特定版本) 。 預設值:latestPreRelease

安裝最新版本或 Visual Studio 測試平臺的特定版本。 如果您使用測試平臺安裝程式來執行自動程式化 UI 測試,所選的 Visual Studio 測試平台必須符合建置測試二進位檔之 Visual Studio 安裝的主要版本。 例如,如果使用 Visual Studio 2017 (15.x 版) 建置自動程式化 UI 測試專案,您必須使用測試平臺 15.x 版。


testPlatformVersion - 測試平臺版本
string. 當 versionSelector = specificVersion 時為必要。

指定要在代理程式上安裝的 Visual Studio 測試平臺版本。 您可以在 NuGet 上檢視可用的版本。


customFeed - 套件來源
string. 當 packageFeedSelector = customFeed 時為必要。

指定包含測試平臺套件的 Azure DevOps 或 TFS 中自定義摘要或套件管理摘要的 URL。 您可以指定公用和私人摘要。


username - 用戶名稱
string. 選擇性。 使用時機 packageFeedSelector = customFeed

指定要驗證 封裝來源 自變數中所指定摘要的用戶名稱。 如果 password 輸入使用個人存取令牌 (PAT) ,則不需要此輸入。


password - 密碼
string. 選擇性。 使用時機 packageFeedSelector = customFeed

指定用於驗證輸入中所 customFeed 指定摘要的密碼或個人存取令牌 (PAT) 。


netShare - UNC 路徑
string. 當 packageFeedSelector = netShare 時為必要。

指定檔案的完整 UNC 路徑 Microsoft.TestPlatform.nupkg 。 必須從 NuGet 下載指定的Microsoft.TestPlatform.nupkg版本,並放置在組建/發行代理程式可以存取的網路共用上。


工作控制選項

除了工作輸入之外,所有工作都有控制選項。 如需詳細資訊,請參閱 控件選項和一般工作屬性

輸出變數

無。

備註

注意

如果您使用託管的代理程式,請檢查您用來查看是否已安裝 Visual Studio 之代理程式 的軟體資料表 。 如果已安裝 Visual Studio,則不需要執行 Visual Studio 測試平臺安裝程式工作。

使用此工作可從 nuget.org 或指定的摘要取得 Microsoft 測試平臺 ,並將它新增至工具快取。 安裝程式工作滿足 vstest 需求,而建置或發行管線中的後續 Visual Studio測試工作 可以執行,而不需要在代理程式電腦上安裝完整的Visual Studio。

注意

  • Visual Studio Test Platform Installer 工作必須出現在建置或發行管線中的 Visual Studio 測試工作之前。
  • Visual Studio 測試工作中的 [測試平臺版本] 選項必須設定為 [工具安裝程式已安裝]。

請參閱 從測試計劃執行自動化測試

規格需求

需求 描述
管線類型 YAML、傳統組建、傳統版本
執行於 Agent、DeploymentGroup
要求
Capabilities 針對相同作業中的任何後續工作,執行此工作符合下列 需求 :VsTest
命令限制 任何
Settable 變數 任何
代理程式版本 2.144.0 或更新版本
工作類別 工具
需求 描述
管線類型 YAML、傳統組建、傳統版本
執行於 Agent、DeploymentGroup
要求
Capabilities 針對相同作業中的任何後續工作,執行此工作符合下列 需求 :VsTest
命令限制 任何
Settable 變數 任何
代理程式版本 2.103.0 或更新版本
工作類別 工具