【TIPS】Azure DevOpsのprivate agentでvstestがないエラー


Note: 本記事は、2018年11月時点の内容です。

【Q】Azure DevOpsのPrivate Agentでvstestがないとエラーになった。なんでエラーになるの?

  • ビルド時のエラーメッセージ例
No agent found in pool Default which satisfies the specified demands:
     msbuild
     visualstudio
     vstest
     Agent.Version -gtVersion 2.115.0 

【A】Private Agentの場合は、Visual Studo Test Platformのインストールが必要になる。

作業の手順

  1. Visual Studio Test Platform Installerタスクの追加
  2. Visual Studio Testタスクのオプション変更

【手順1】Visual Studio Test Platform Installerタスクの追加

  • Visual Studio Test Platform InstallerタスクをVisual Studio Testタスクの前に追加

【手順2】Visual Studio Testタスクのオプション変更

  • Visual Studio TestのオプションTest platform versionInstalled by Tools Installerに変更

参考資料

How can I set up VS Test Agent in Build tools enviroment.

vstest task fails with Error: Visual Studio 2015 is not found. Try again with a version that exists on your build agent machine."