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

Created on 27 Dec 2017  Â·  2Comments  Â·  Source: microsoft/vstest

Description

When used in release template in vsts, I have a deployment group for testing and I added this task to deployment group so that it Satisfies the ‘vstest’ demand, however when the deployment runs, the vstst task fails with error message "Error: Visual Studio 2015 is not found. Try again with a version that exists on your build agent machine."

Steps to reproduce

Create clean windows 10 VM, add to a deployment group, create new release in vsts with two tasks

  1. VSTS Platform Installer
  2. VSTS Test Assemblies
    Link to existing build artifact and create release, the first task executes but vstest task fails to start test run, fails with above error.

Expected behavior

Expected to continue the vstest task and discover the tests in given assembly and execute them.

Actual behavior

fails to start test execution, asking to install visual studio.

Diagnostic logs

2017-12-27T05:30:19.0259138Z ##[section]Starting: VsTest Platform Installer
2017-12-27T05:30:19.0261763Z ==============================================================================
2017-12-27T05:30:19.0261853Z Task : Visual Studio Test Platform Installer
2017-12-27T05:30:19.0262196Z Description : Acquires the test platform from nuget.org or the tools cache. Satisfies the ‘vstest’ demand and can be used for running tests and collecting diagnostic data using the Visual Studio Test task.
2017-12-27T05:30:19.0262431Z Version : 1.0.3
2017-12-27T05:30:19.0262501Z Author : Microsoft Corporation
2017-12-27T05:30:19.0262763Z Help : Acquires the test platform from nuget.org or the tools cache. Satisfies the ‘vstest’ demand and can be used for running tests and collecting diagnostic data using the ‘Visual Studio Test’ task.
2017-12-27T05:30:19.0263155Z ==============================================================================
2017-12-27T05:30:20.3820825Z Starting VsTest platform tools installer task.
2017-12-27T05:30:20.3821005Z ==============================================================================
2017-12-27T05:30:20.6329311Z Looking for the latest pre-release version of the Microsoft.Testplatform.
2017-12-27T05:30:21.2491458Z Found tool in cache: VsTest 15.6.0-preview-20171211-02 x64
2017-12-27T05:30:21.5188053Z VsTest will use the Test Platform package found in C:\vstsagent\A1_work_tool\VsTest\15.6.0-preview-20171211-02\x64
2017-12-27T05:30:21.8063796Z ##[section]Finishing: VsTest Platform Installer
2017-12-27T05:30:21.8304543Z ##[section]Starting: VsTest - testAssemblies
2017-12-27T05:30:21.8311246Z ==============================================================================
2017-12-27T05:30:21.8311423Z Task : Visual Studio Test
2017-12-27T05:30:21.8311552Z Description : Run tests with Visual Studio test runner
2017-12-27T05:30:21.8311673Z Version : 2.3.4
2017-12-27T05:30:21.8311789Z Author : Microsoft Corporation
2017-12-27T05:30:21.8311936Z Help : More Information
2017-12-27T05:30:21.8312083Z ==============================================================================
2017-12-27T05:30:22.8617611Z Run the tests locally using vstest.console.exe
2017-12-27T05:30:22.8617785Z ========================================================
2017-12-27T05:30:22.8618100Z Test selector : Test assemblies
2017-12-27T05:30:22.8618397Z Test assemblies : *My.IntegrationTest.dll,!*TestAdapter.dll,!\obj*
2017-12-27T05:30:22.8618690Z Test filter criteria : null
2017-12-27T05:30:22.8618946Z Search folder : C:\vstsagent\A1_work\r1\a
2017-12-27T05:30:22.8619302Z Run settings file : C:\vstsagent\A1_work\r1\a*
\Settings\PROD.runsettings
2017-12-27T05:30:22.8619604Z Run in parallel : true
2017-12-27T05:30:22.8619741Z Run in isolation : false
2017-12-27T05:30:22.8620614Z Path to custom adapters : null
2017-12-27T05:30:22.8620753Z Other console options : null
2017-12-27T05:30:22.8620925Z Code coverage enabled : false
2017-12-27T05:30:22.8621205Z Rerun failed tests: false
2017-12-27T05:30:22.8621428Z VisualStudio version selected for test execution : latest
2017-12-27T05:30:23.6471658Z ##[error]Error: Visual Studio 2015 is not found. Try again with a version that exists on your build agent machine.
2017-12-27T05:30:23.9070031Z ##[section]Finishing: VsTest - testAssemblies
2017-12-27T05:30:23.9302961Z ##[section]Finishing: Release

Environment

Windows 10 VM

question

Most helpful comment

@GitHubSachin : Please choose the option as "Installed by tools installer" for the "Test platform version" input

All 2 comments

@GitHubSachin : Please choose the option as "Installed by tools installer" for the "Test platform version" input

This happens with the new Windows 2019 Azure DevOps hosted agents too. Is the fix still to not choose "latest"?

Was this page helpful?
0 / 5 - 0 ratings