次の方法で共有


RunVisualStudioTestsusingTestAgent@1 - 機能テストの実行 v1 タスク

RunVisualStudioTestsusingTestAgent@1とそのコンパニオン タスク (Visual Studio テスト エージェントの配置) は非推奨になりました。 代わりに Visual Studio テスト タスクを使用してください。 VSTest タスクでは、単体テストと機能テストを実行できます。 マルチエージェント ジョブ設定を使用して、1 つ以上のエージェントでテストを実行します。 Visual Studio テスト プラットフォーム タスクを使用して、エージェントで Visual Studio を必要とせずにテストを実行します。 VSTest タスクでは、失敗したテストを自動的に再実行するなど、新しい機能も提供されます。

構文

# 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 File Copy タスクによってテスト バイナリがコピーされたテスト マシン上の場所を指定します。 テスト エージェント マシンのシステム ステージ変数を使用して、ドロップ場所を指定できます。 例: c:\tests および %systemdrive%\Tests


testSelection - テストの選択
string。 必須。 使用できる値: testAssembly (テスト アセンブリ)、testPlan (テスト 計画)。 既定値: testAssembly.

テストの実行方法を指定します。テスト アセンブリまたはテスト計画を使用します。


テスト計画testPlan -
stringtestSelection = testPlanする場合に必要です。

この組織用に既に構成されているテスト 計画を指定します。


testSuite - テストスイート
stringtestSelection = testPlanする場合に必要です。

選択したテスト 計画のテスト スイートを指定します。


テスト構成testConfiguration -
stringtestSelection = testPlanする場合に必要です。

選択したテスト計画のテスト構成を指定します。


sourcefilters - テスト アセンブリの
stringtestSelection = testAssemblyする場合に必要です。 既定値: **\*test*.dll.

テストを実行するテスト バイナリを指定します。 ワイルドカードを使用することができます。 たとえば、ファイル名に **\*test*.dll; を含むすべての .dll ファイルに対して test します。


testFilterCriteria - テスト フィルター条件
string。 任意 testSelection = testAssemblyするときに使用します。

テスト アセンブリ ファイル内で実行するテストを指定するフィルター。 /TestCaseFiltervstest.console.exe オプションと同じように動作します。 例: Owner=james&Priority=1


runSettingsFile - 実行設定ファイルの
string

テストで使用する runsettings または testsettings ファイルへのファイル パスを指定します。


テスト実行パラメーターをオーバーライドする overrideRunParams -
string

TestRunParameters ファイルの runsettings セクションまたは Properties ファイルの testsettings セクションで定義されているオーバーライド パラメーターを指定します。 例: AppURL=$(DeployURL);Port=8080

testsettings ファイルで指定されたプロパティには、テスト エージェント 2017 Update 4 以降を使用して TestContext 経由でアクセスできます。


codeCoverageEnabled - コード カバレッジが有効になっている
boolean。 既定値: false.

タスクに対してコード カバレッジが有効かどうかを指定します。


customSlicingEnabled - のマシン数別にテストを配布する
boolean。 既定値: false.

このブール値の値を trueに設定すると、テスト コンテナーの数ではなく、指定されたマシンの数に基づいてテストが分散されます。

.dll 内のテストは、複数のマシンに配布される場合もあります。


テスト実行タイトルtestRunTitle -
string

テスト実行の名前を指定します。


platform - プラットフォーム
string

テストを報告するプラットフォームを指定します。 ビルド タスクで platform の変数を定義した場合は、その変数を値として使用します。


configuration - 構成
string

テストを報告する必要がある構成を指定します。 ビルド タスクで configuration の変数を定義した場合は、その変数を値として使用します。


testConfigurations - テスト構成の
string

任意 テスト ケース フィルターをテスト構成 ID に関連付けます。 構文: <Filter1>:<Id1>;DefaultTestConfiguration:<Id3>. 例: FullyQualifiedName~Chrome:12


テスト マシンでのアプリケーションの autMachineGroup -
string

W3WP.exeなどのサーバー プロセスが実行されているコンピューター、出力変数、またはマシン グループ名のコンマ区切りの一覧。


タスク コントロールのオプション

すべてのタスクには、タスク入力に加えて制御オプションがあります。 詳細については、「コントロール オプションと一般的なタスク プロパティを参照してください。

出力変数

なし。

必要条件

要件 説明
パイプラインの種類 YAML、クラシック ビルド、クラシック リリース
実行日 エージェント
の需要 なし
機能の このタスクは、ジョブ内の後続のタスクに対する要求を満たしていません。
コマンドの制限 どれでも
設定可能な変数 どれでも
エージェントのバージョン 1.104.0 以上
タスク カテゴリ テスト