3
votes

I'm trying to establish continuous integration with TeamCity and stuck at running unit tests step with Visual Studio Tests runner.

Loading [02:42:07]C:\TeamCity\buildAgent\work\f7a05248f49c57a1\LodCore\UserPresentationTests\bin\Release\UserPresentationTests.dll...

[02:42:07][Step 3/3] Starting execution...

[02:42:07][Step 3/3] No tests to execute.

All tests are discoverable, when I build test assemblies from Visual Studio. I've downloaded UserPresentationTests.dll from build agent to my computer and tried to execute same command with my local MSTest.exe, and it failed with the same issue. I've decompiled it with ILSpy and found no difference with dll built from Visual Studio. I've tried different build configurations on MSBuild, but it is not working.

My TeamCity version: Professional 2017.2 (build 50574)

Now my build configuration looks like that

Tests step looks like this

3

3 Answers

4
votes

If you are using MSTest v2, then you should use VSTest instead of MSTest:

enter image description here

0
votes

Can you check that there aren't any differences between the environments in terms of installed libraries, permissions, etc.

We have a couple pointers to troubleshoot the differences between a working local build and a failing TeamCity one, you might want to follow those steps: https://confluence.jetbrains.com/display/TCD10/Common+Problems#CommonProblems-BuildfailsorbehavesdifferentlyinTeamCitybutnotlocally

With this in mind, while the step 3 is the one pointing at the failure, I'd also check the build log of step 2, as it might have skipped some of the build parts for some reason.

Also it would be helpful if you could also add to the OP the TeamCity version you are using and the type of runner you are using in step 3.

0
votes

In addition of build configuration your solution you should create new configuration with Runner type MSTest. Example here