This is a migrated thread and some comments may be shown as answers.

JustMock, xUnit, dotCover, TeamCity problem

2 Answers 171 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Freek
Top achievements
Rank 1
Freek asked on 05 Apr 2017, 03:58 PM

I'm having an issue with running xUnit with JustMock and dotCover on TeamCity.

I've setup my environment parameter JUSTMOCK_INSTANCE=1 on the build configuration and linked the dotCover profiler on the "Telerik JustMock Configuration" interface. 

I'm using the "xUnit.net + dotCover 💕" metarunner and it is executing the tests. But after it has executed the tests (no errors), dotCover does not finish generating the coverage data file. The process just "hangs", so to speak, after the last test.

When I unlink the dotCover profiler on the "Telerik JustMock Configuration" interface, and use JustMockRunner.exe, the process does finish, but no coverage data is generated. 

TeamCity Command Line script (in stead of meta runner):

%teamcity.tool.dotCover%\dotcover cover /TargetExecutable="%just_mock_Path%\JustMockRunner.exe" /TargetArguments="%system.teamcity.build.workingDir%\packages\xunit.runner.console.2.2.0\tools\xunit.console.exe mytestassembly.dll" /ReturnTargetExitCode

 

When running xUnit directly is does not execute most of the unit tests, because JustMock is not in elevated mode of course, but it does finish the process generate the coverage data. Indicating for me, that dotCover is working fine.

TeamCity command line script (in stead of meta runner):

%teamcity.tool.dotCover%\dotcover cover /TargetExecutable="%system.teamcity.build.workingDir%\packages\xunit.runner.console.2.2.0\tools\xunit.console.exe" /TargetArguments="mytestassembly.dll" /ReturnTargetExitCode

 

It makes sense that the dotCover profiler should run together with JustMock so the data can be generated, but every time I link the profiler, the process hangs after all tests have been executed. 

Different test assemblies show the same result.

Versions:

JustMock: 2016.3.914.2

Team City 10.0.2 (build 42234)

xUnit: 2.2.0

dotCover: 2016.2.2

 

Is this a known issue? Please let me know if you need more information.

Thanks.

2 Answers, 1 is accepted

Sort by
0
Freek
Top achievements
Rank 1
answered on 05 Apr 2017, 04:36 PM
Actually to add to this. The problem is not with TeamCity at all. I run into the same issues when running the commands from any console.
0
Kamen Ivanov
Telerik team
answered on 10 Apr 2017, 02:51 PM
Hi Freek,

Thank you for your interest in JustMock.

This is a known issue. Unfortunately JetBrains have changed their behavior in version 2016.2 of dotCover and since then the integration is not working.
You could still use dotCover 2016.1.2 or earlier version and the code coverage will pass and show results.

We have logged an issue in our backlog and will try to resolve it in upcoming releases.

Regards,
Kamen Ivanov
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Freek
Top achievements
Rank 1
Answers by
Freek
Top achievements
Rank 1
Kamen Ivanov
Telerik team
Share this question
or