JustMock, xUnit, dotCover, TeamCity problem

3 posts, 0 answers
  1. Freek
    Freek avatar
    2 posts
    Member since:
    Mar 2017

    Posted 05 Apr 2017 Link to this post

    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.


    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.


  2. Freek
    Freek avatar
    2 posts
    Member since:
    Mar 2017

    Posted 05 Apr 2017 in reply to Freek Link to this post

    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.
  3. Kamen Ivanov
    Kamen Ivanov avatar
    80 posts

    Posted 10 Apr 2017 Link to this post

    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.

    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
Back to Top