Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TeamCity VSTest 2015

I'm trying to setup TeamCity 9.1.7 on a server and I'm encountering an issue when trying to add a Testing step.

Runner Type: Visual Studio Tests

Test engine type: VSTest

Test engine version: VSTest 2015

Test file names: C2.Tests\bin\Debug\C2.Tests.dll

Target platform: x86

When I added this Step, I was prompted to add a Config parameter:

Name: teamcity.dotnet.vstest.14.0

Value: C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe

When I run all my steps I get an error in the Unit Testing step:

[14:23:17][Step 3/3] VSTest report watcher [14:23:17][VSTest report watcher] No reports found for paths: [14:23:17][VSTest report watcher] C:\BuildAgent\work\d28aa71801c772cb\TestResults*.trx [14:23:17][Step 3/3] Step Unit Testing (Visual Studio Tests) failed

I've had to do several things differently on this setup (on server) then when I was testing locally on my machine. For example setting up the 2015 Build Tools. I'm not sure where to look to correct this issue.

Please advise.

like image 544
webdad3 Avatar asked Jun 10 '16 18:06

webdad3


People also ask

Where can I find VSTest?

To run automated tests on an ARM architecture-based machine, you must use VSTest. Console.exe. Open Developer Command Prompt to use the command-line tool, or you can find the tool in %Program Files(x86)%\Microsoft Visual Studio\<version>\<edition>\common7\ide\CommonExtensions\<Platform | Microsoft>.

What is the difference between Mstest and VSTest?

There is a difference between vstest and mstest - the former is a test runner and the later is a test framework. Both could be used independently.


1 Answers

From the documentation:

The Visual Studio Tests runner integrates MSTest runner and VSTest console runner. Support for both frameworks enables TeamCity to execute tests and automatically import their test results.

The Visual Studio Test Runner requires Visual Studio Test Agent or Microsoft Visual Studio installed on the build agent.

https://confluence.jetbrains.com/display/TCD10/Visual+Studio+Tests

So you can use VSTests perfectly fine from version 10.

For VSTests, you need to specify a different directory for the config parameter:

teamcity.dotnet.vstest.14.0: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe

This file will be available after installing the test agent (or visual studio).

If you still get the error then it means there is something wrong with the tests you have specified, you probably didn't reference to the assemblies correctly, make sure the path and .dll files exist.

like image 63
CularBytes Avatar answered Dec 28 '22 00:12

CularBytes