DotCover covers tests, but code highlighting says "statement uncovered" and can't find covering tests

Completed

Hi,

I installed ReSharper Ultimate 2016.3.2 on Visual Studio Ultimate 2013 12.0.40629.00 Update 5 with .NET 4.6.01055 and MSTest as a test runner. I also tested the following scenarios in Visual Studio Enterprise 2015 version 14.0.25431.01 Update 3.

I opened a small solution and covered all tests. The Coverage tab in the Unit Test Sessions window shows the coverage nicely:

But when I open any file, the code highlight says “Statement uncovered by tests in session All tests in Solution":

Also, right clicking on a class with coverage on the Coverage Tree and clicking on Show covering tests says “Code is not covered by tests in session All tests from Solution”.

A Warning appears in the execution log:

I tried the same thing with Continuous testing with the same results.

Then I switched Continuous testing off and the Coverage tab in the Unit Test Sessions window no longer shows percentages, everything’s 0%.

Restarting Visual Studio fixed that.

I tried clearing Resharper’s caches and restarting without success.

I have updated to 2017.1 EAP 1, but won't fix the issue.

Also I exported the coverage data in HTML and surprisingly the html webpage was showing the code highlighted properly:

I have uploaded the source code, the JetLogs obtained with "devenv.exe /ReSharper.LogLevel VERBOSE /ReSharper.LogFile", a Snapshot and the HTML export in my gdrive:

FluidMath_snapshot_jetlog_exportHTML.rar

Any help would be appreciated.

5 comments

I have found my issue: The MStest settings come from a .testsettings file instead of a .runsettings one.

Unfortunately looks like ReSharper 2016.3.2 is unable to run the tests in parallel with MaxCpuCount in a .runsettings file. So right now I have to choose between getting tests to run as fast as possible or cover them.

I found that a bug has already been submited 4 motnhs ago: Exploration failed for (TestProject1, MSTest) One or more errors occurred. Invalid settings 'RunConfiguration'. Unexpected XmlElement: 'MaxCpuCount'.

0

Hello Joan,

Unfortunately neither ReSharper nor dotCover supports parallelism in MsTests: MaxCpuCount parameter in .runsettings doesn't lead to any errors but is just ignored.

In case of tests coverage you can try to turn on assemblies-level parallelism in ReSharper options (ReSharper >> Options >> Unit Testing >> General >> Run up to N assemblies in parallel). But in this case there can be a noticeable overhead because of merging of multiple coverage snapshots obtained from different processes.

0

Hello Ekaterina,

Thanks a lot for the tip. This will still be a slow solution for me, so I will abandon the code highlight feature until I can update to Visual Studio 2015/2017.

0

Hi,

we are having a similar issue, but with the coverage data of child processes, which is shown in the HTML Report but not in the VS highlighting. Highlighting the coverage of the test process is working as expected.

Is this a known issue, is there a known Workaround?

(ReSharper Ultimate 2016.3.2, VS 2015 Update 3)

0

Hi Michael,

Unfortunately, it's a known problem https://youtrack.jetbrains.com/issue/DCVR-8805, we plan to fix it in the next release.

0

Please sign in to leave a comment.