dotnet Core xUnit tests are reported twice

We have a .net core solution with three test projects that have, in total 58 tests.

For executing the tests I created a build step with the 'Visual Studio Tests' runnter type.
The test engine type is set to 'VSTest' and the test engine version is set to custom with the path the to the test runner set to 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\TestPlatform\vstest.console.exe'.

The test file names ist set to '/test/*.Tests/bin/**/*.Tests.dll' and when I look in the build log, it exactly passes the correct test assemblies to the vstest call.
Also, the additional command line parameters state '/Framework:FrameworkCore10' to tell vstest that this is a .net core project.
The Use real-time test reporting is currectly disabled, however enabling it does not change anything.

The test run starts and displays this:

[12:49:18][Step 3/4] Custom logger detection logic disabled
[12:49:18][Step 3/4] VSTest will report tests to TeamCity after run
[12:49:18][Step 3/4] VSTest executable: C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\Extensions\TestPlatform\vstest.console.exe
[12:49:18][Step 3/4] Command line params: [[C:\BuildAgent\work\bf00d39e4c408afc\test\MyProject1.Api.Tests\bin\Debug\netcoreapp1.1\MyProject1.Api.Tests.dll] [C:\BuildAgent\work\bf00d39e4c408afc\test\MyProject1.Base.Tests\bin\Debug\netcoreapp1.1\MyProject1.Base.Tests.dll] [C:\BuildAgent\work\bf00d39e4c408afc\test\MyProject1.Shared.Tests\bin\Debug\netcoreapp1.1\MyProject1.Shared.Tests.dll] [/Logger:trx] [/Platform:x86] [/Framework:FrameworkCore10]]
[12:49:18][Step 3/4] Starting: C:\BuildAgent\plugins\dotnetPlugin\bin\JetBrains.BuildServer.NUnitLauncher.exe #TeamCityImplicit
[12:49:18][Step 3/4] in directory: C:\BuildAgent\work\bf00d39e4c408afc

The problem is that all tests (and all test failures) are reported twice.

Instead of 58 test results (6 tests in the first assembly, 42 in the second and 10 in the third) the build shows 114 passed and 2 failed tests, however the build shows that the tests are executed only once, and we only have one failure.

The first failure is reported as:
VSTest:MyProject1.Base.Tests.TestClass.TestMethod.MyProject1.Base.Tests.TestClass

The second failure is reported as:
Test collection for MyProject.Base.Tests.TestClass.TestMethod (1):MyProject1.Base.Tests.TestClass

Maybe the difference in the VSTest: and Test collection for: tells someone what the problem might be? I see that difference but I do not know what would be the cause of these different reportings.

 

Where does the second report come from, and how can I turn it off?
 
0
3 comments

Which version are you running? Have you set up the XML Report processing build feature? Can you send us the full build log via the "Submit a request" button on top?

0
Avatar
Permanently deleted user

I am also currently experiencing this, was there any resolution in the end?

0

Please sign in to leave a comment.