2
votes

I am having problems configuring VSTest task in TFS 2015 vNext build definition to run with Visual Studio 2017.

Selecting "Latest" in VSTest version drop down list does not work for VS2017. I found some posts in forums describing to provide specific location of VSTest, that would probably work. Unfortunately, I do not have this option:

VSTest Options

Does anybody have an idea how to get it work?

Regards, WHBonney

2

2 Answers

2
votes

In the Visual Studio Test task of TFS 2017, it has the option to specific location of vstest.console.exe. In TFS 2015, the Visual Studio Test step is in an old version. You could upgrade to TFS 2017 to specify test version in Visual Studio Test step.

Or as a workaround, the source code of the newest version step is at this site: https://github.com/Microsoft/vsts-tasks/tree/master/Tasks/VsTest. You could download the source code and upload it to TFS 2015 as a custom build task.

You could use tfx-cli command to upload a custom task. For TFS 2015, use tfx login --auth-type basic to login before upload.

0
votes

I am having problems configuring VSTest task in TFS 2015 vNext build definition to run with Visual Studio 2017.

You didn't say what the specific problems were, but the problem I ran into was that the Visual Studio Test task was using an older VSTest version (from Visual Studio 2015 in my case) which by default wasn't detecting the unit tests in my test project that uses the newer .NET Core project format along with the MSTest.TestAdapter NuGet package.

The solution I found was under the Visual Studio Test task's "Advanced Execution Options" section to set "Path to Custom Test Adapters" to $(Build.SourcesDirectory) so that it could find the MSTest.TestAdapter assemblies that end up in the bin directory.