TeamCity VSTest 2015

I am trying to configure TeamCity 9.1.7 on a server and I am encountering a problem 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 asked to add the Config parameter:

Title: 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 at the Unit Testing step:

[14:23:17] [Step 3/3] VSTest report watcher [14:23:17] [VSTest report Observer] There are no messages for the paths: [14:23:17] [VSTest report observer] C: \ BuildAgent \ work \ d28aa71801c772cb \ TestResults * .trx [14:23:17] [Step 3/3] Failed to perform test testing Step (Visual Studio tests)

I had to do several things differently in this setup (on the server), and then when I tested locally on my machine. For example, customize the Build Build 2015 tools. I'm not sure where to look to fix this problem.

Please inform.

+5
source share
3 answers

From the documentation:

Visual Studio Testing Tester combines the MSTest runner and the VSTest console. Support for both frameworks allows TeamCity to run tests and automatically import the results of its tests.

A Visual Studio test agent requires the Visual Studio validator or Microsoft Visual Studio installed in the build agent.

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

This way you can make excellent use of VSTests from version 10.

For VSTests, you need to specify a different directory for the configuration 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 an error, then something is wrong with the tests you specified, you probably incorrectly referenced the assemblies, make sure that the path and .dll files exist.

+3
source

There are two problems in the current configuration:

  • You are using TestEngine VSTest, which will behave differently than MsBuild

  • When running the test using MSBuild, this will not lead to the generation of .trx files, which the report observer needs to display the execution results.

So, to fix your problem, you need to change the test engine to [MSTest]

This link can help you understand the capabilities of each test module.

Select and configure a test runner

+2
source

Try to run the tests using the MSBuild step before the testing phase - it seems that if he cannot find the DLLs containing your tests, you will get the message "No messages found"

0
source

All Articles