RunVisualStudioTestsusingTestAgent@1 - 執行功能測試 v1 工作

RunVisualStudioTestsusingTestAgent@1及其隨附工作 (Visual Studio 測試代理程式部署) 已被取代。 請改用 Visual Studio 測試工作。 VSTest 工作可以執行單元和功能測試。 使用多代理程式作業設定在一或多個代理程式上執行測試。 使用 Visual Studio 測試平臺工作來執行測試,而不需要代理程式上的 Visual Studio。 VSTest 工作也會帶來新功能,例如自動重新執行失敗的測試。

Syntax

# Run functional tests v1
# Deprecated: This task and it’s companion task (Visual Studio Test Agent Deployment) are deprecated. Use the 'Visual Studio Test' task instead. The VSTest task can run unit as well as functional tests. Run tests on one or more agents using the multi-agent job setting. Use the 'Visual Studio Test Platform' task to run tests without needing Visual Studio on the agent. VSTest task also brings new capabilities such as automatically rerunning failed tests.
- task: RunVisualStudioTestsusingTestAgent@1
  inputs:
  # Setup Options
    testMachineGroup: # string. Required. Machines. 
    dropLocation: # string. Required. Test Drop Location. 
  # Execution Options
    testSelection: 'testAssembly' # 'testAssembly' | 'testPlan'. Required. Test Selection. Default: testAssembly.
    #testPlan: # string. Required when testSelection = testPlan. Test Plan. 
    #testSuite: # string. Required when testSelection = testPlan. Test Suite. 
    #testConfiguration: # string. Required when testSelection = testPlan. Test Configuration. 
    sourcefilters: '**\*test*.dll' # string. Required when testSelection = testAssembly. Test Assembly. Default: **\*test*.dll.
    #testFilterCriteria: # string. Optional. Use when testSelection = testAssembly. Test Filter criteria. 
    #runSettingsFile: # string. Run Settings File. 
    #overrideRunParams: # string. Override Test Run Parameters. 
    #codeCoverageEnabled: false # boolean. Code Coverage Enabled. Default: false.
    #customSlicingEnabled: false # boolean. Distribute tests by number of machines. Default: false.
  # Reporting Options
    #testRunTitle: # string. Test Run Title. 
    #platform: # string. Platform. 
    #configuration: # string. Configuration. 
    #testConfigurations: # string. Test Configurations. 
    #autMachineGroup: # string. Application Under Test Machines.
# Run Functional Tests v1
# Deprecated: This task and it’s companion task (Visual Studio Test Agent Deployment) are deprecated. Use the 'Visual Studio Test' task instead. The VSTest task can run unit as well as functional tests. Run tests on one or more agents using the multi-agent job setting. Use the 'Visual Studio Test Platform' task to run tests without needing Visual Studio on the agent. VSTest task also brings new capabilities such as automatically rerunning failed tests.
- task: RunVisualStudioTestsusingTestAgent@1
  inputs:
  # Setup Options
    testMachineGroup: # string. Required. Machines. 
    dropLocation: # string. Required. Test Drop Location. 
  # Execution Options
    testSelection: 'testAssembly' # 'testAssembly' | 'testPlan'. Required. Test Selection. Default: testAssembly.
    #testPlan: # string. Required when testSelection = testPlan. Test Plan. 
    #testSuite: # string. Required when testSelection = testPlan. Test Suite. 
    #testConfiguration: # string. Required when testSelection = testPlan. Test Configuration. 
    sourcefilters: '**\*test*.dll' # string. Required when testSelection = testAssembly. Test Assembly. Default: **\*test*.dll.
    #testFilterCriteria: # string. Optional. Use when testSelection = testAssembly. Test Filter criteria. 
    #runSettingsFile: # string. Run Settings File. 
    #overrideRunParams: # string. Override Test Run Parameters. 
    #codeCoverageEnabled: false # boolean. Code Coverage Enabled. Default: false.
    #customSlicingEnabled: false # boolean. Distribute tests by number of machines. Default: false.
  # Reporting Options
    #testRunTitle: # string. Test Run Title. 
    #platform: # string. Platform. 
    #configuration: # string. Configuration. 
    #testConfigurations: # string. Test Configurations. 
    #autMachineGroup: # string. Application Under Test Machines.

輸入

testMachineGroup - 機器
string. 必要。

機器 FQDN 或 IP 位址的逗號分隔清單,其中可能包含埠號碼。 最大值為 32 部機器或 32 個代理程式。 清單專案可以是:

  • Azure 資源群組的名稱。
  • 以逗號分隔的電腦名稱稱清單。 範例: dbserver.fabrikam.com,dbserver_int.fabrikam.com:5986,192.168.34:5986
  • 上一個工作的輸出變數。

dropLocation - 測試置放位置
string. 必要。

指定測試電腦上 () 測試二進位檔的位置,其中測試二進位檔已由 Windows 電腦檔案複 本或 Azure 檔案複製工作複製 。 測試代理程式機器中的系統階段變數可用來指定置放位置。 範例:c:\tests%systemdrive%\Tests


testSelection - 測試選取專案
string. 必要。 允許的值: testAssembly (測試元件) , testPlan (測試計劃) 。 預設值:testAssembly

指定測試的執行方式:使用測試元件或測試計劃。


testPlan - 測試計劃
string. 當 testSelection = testPlan 時為必要。

指定已為此組織設定的測試計劃。


testSuite - Test Suite
string. 當 testSelection = testPlan 時為必要。

從選取的測試計劃指定測試套件。


testConfiguration - 測試組態
string. 當 testSelection = testPlan 時為必要。

從選取的測試計劃指定測試組態。


sourcefilters - 測試元件
string. 當 testSelection = testAssembly 時為必要。 預設值:**\*test*.dll

指定要執行測試的測試二進位檔。 可以使用萬用字元。 例如, **\*test*.dll; 針對檔案名中包含的 test 所有 .dll 檔案。


testFilterCriteria - 測試篩選準則
string. 選擇性。 使用 時機 testSelection = testAssembly

指定測試元件檔案內執行之測試的篩選。 的運作方式與 /TestCaseFilter 中的 vstest.console.exe 選項相同。 範例: Owner=james&Priority=1.


runSettingsFile - 執行設定檔案
string.

指定要與測試搭配使用的 或 testsettings 檔案的檔案路徑 runsettings


overrideRunParams - 覆寫測試回合參數
string.

指定檔案區段或 Properties 檔案區段中 testsettingsrunsettings 定義的 TestRunParameters 覆寫參數。 範例: AppURL=$(DeployURL);Port=8080.

注意

您可以使用測試代理程式 2017 Update 4 或更高版本來存取 TestContext 檔案中指定的 testsettings 屬性。


codeCoverageEnabled - 啟用程式碼涵蓋範圍
boolean. 預設值:false

指定是否為工作啟用程式碼涵蓋範圍。


customSlicingEnabled - 依電腦數目散發測試
boolean. 預設值:false

當此布林值設定為 true 時,測試會根據提供的機器數目來散發,而不是測試容器的數目。

注意

內的 .dll 測試也可能分散到多部電腦。


testRunTitle - 測試回合標題
string.

指定測試回合的名稱。


platform - 平臺
string.

指定應該報告測試的平臺。 如果您已在建置工作中定義 的 platform 變數,請使用 變數作為 值。


configuration - 配置
string.

指定應該報告測試的組態。 如果您已在建置工作中定義 的 configuration 變數,請使用 變數作為 值。


testConfigurations - 測試組態
string.

選擇性。 將測試案例篩選與測試組態識別碼產生關聯。 語法: <Filter1>:<Id1>;DefaultTestConfiguration:<Id3> 。 範例: FullyQualifiedName~Chrome:12.


autMachineGroup - 測試機器下的應用程式
string.

電腦、輸出變數或伺服器組名的逗號分隔清單,例如 正在執行的伺服器 W3WP.exe 群組名稱。


工作控制選項

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

輸出變數

無。

規格需求

需求 描述
管線類型 YAML、傳統組建、傳統版本
執行于 代理程式
要求
Capabilities 此工作不符合作業中後續工作的任何需求。
命令限制 任意
可設定變數 任意
代理程式版本 1.104.0 或更新版本
工作類別 測試