Code coverage with dotcover and .NET core doesnt work

I've a teamcity configuration with one build step using .NET CLI 0.9.7 .

In this step I've configured a test command on a NUnit project and enabled coverage with dotcover 2018.1.4 .

At the same conditions (including same code) coverage some times doesnt work and It results in

DotCover statement coverage was: 0 of 0 ( -1.0%)

In those rare cases where the coverage doesnt work the only difference is .dcvr file that seems to be truncated (small size).

Is this a known issue?

I'm using:

Teamcity version 2017.1.3

.NET Core 2.1

.NET CLI plugin 0.9.7

Nunit 3.10.1

Nunit console runner 3.8.0

Dotcover 2018.1.4 (same problem using 2018.1.3 and 2018.1.2)

 

 

0
2 comments

There is a related issue https://youtrack.jetbrains.com/issue/TW-55606

Briefly, it happens because of vstest host might be killed by the vstest test engine before dotCover has a chance to save coverage snapshot completely.

There is a workaround: https://dotnettools-support.jetbrains.com/hc/en-us/articles/360001627210-Inconsistent-coverage-results-using-dotCover-console-runner-with-NET-Core-unit-tests-, but it is too complex from my point of view. So I've created the PR: https://github.com/Microsoft/vstest/pull/1741 which allows to avoid this issue, but it is still not accepted by the vstest team unfortunately.

0

The PR is closed now, do you have any alternativo or insist in ahoter PR to fix this?

0

Please sign in to leave a comment.