azure-pipelines-agent: vstest capability not detected when installed without Visual Studio

Agent version and platform

Version of your agent? v2.114.0
OS of the machine running the agent? Windows

I have a custom build server and I have installed the test agent from https://www.microsoft.com/en-us/download/details.aspx?id=48152 without installing Visual Studio.

As far as I can see the vsts capability is added by checking (for VS2015) for the existence of the registry value of InstallDir or ShellFolder in Software\Microsoft\VisualStudio\14.0

But that entry does not exist if the agent is installed separately. Instead it would seem that there is an entry under InstallDir in Software\Microsoft\VisualStudio\14.0\EnterpriseTools\QualityTools

Would it be a good solution to add that registry entry to the powershell script that scans for this capability?

It is possible to add the capability manually.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 35 (14 by maintainers)

Most upvoted comments

@InteXX we understand your concern and will be addressing it soon (it’s on our backlog). Currently to run the VsTest task, the task has dependency on Visual Studio IDE. We recommend to install VS IDE to run the tests.

@Intexx - we are picking up this work now. It is expected to be available on VSTS in a few sprints. We have decided to go with a ‘tools installer’ which can be used to get the test platform instead of needing the IDE. If you have the IDE, great. If you don’t, the tools installer will get the test platform on the agent for you.

In case you want to hotfix this yourself, add a file called Add-VisualStudioTestCapabilities.ps1 with code (check for your path)

[CmdletBinding()]
param()

if (Test-Path "C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent\Common7\IDE\CommonExtensions\Microsoft\TestWindow") {
    Write-Capability -Name 'VSTest' -Value "C:\Program Files (x86)\Microsoft Visual Studio\2017\TestAgent\Common7\IDE\CommonExtensions\Microsoft\TestWindow"
}

to C:\vstsagent\A1\bin\powershell. Restart the agent service to get the capabilities updated.

@PBoraMSFT Will there be any alternative for private agents, so that vstest can be added as a capability rather than installed on demand? i.e. by installing Test Agent.

@AndersSahlin - we are working on it this sprint (126) and the first preview of the tools installer task should be available when Sprint 126 deployment on VSTS rolls out. Will be announced in the release notes at https://docs.microsoft.com/en-us/vsts/release-notes/