FortuneN / FineCodeCoverage

Visualize unit test code coverage easily for free in Visual Studio Community Edition (and other editions too)
https://marketplace.visualstudio.com/items?itemName=FortuneNgwenya.FineCodeCoverage
Other
526 stars 40 forks source link

Coverage and Summary tabs not updating when tests run, remaining empty. Margins not displaying coverage either #409

Closed MythosPantheon closed 6 months ago

MythosPantheon commented 6 months ago

Installed product versions

Description

FCC successfully generates the report when tests are run, but coverage and summary tabs are left empty, with Inline representation not showing either

Steps to recreate

  1. Create a project (tried with both .net 7.0 and framework 4.8)
  2. Create a method and a test (MSTest or XUnit)
  3. Run the test
  4. Coverage and Summary tabs remain empty, log does update

Current behavior

Coverage tab is completely empty while all rows in the Summary have a value of 0 (except line coverage which is empty). Inline representation is not showing either

Expected behavior

Coverage should display the line and branch coverage, summary should have values other than 0 and margins should be green, yellow or red

Side Notes

WyrmUK commented 6 months ago

I have a similar issue with Visual Studio Enterprise 2022 (64-bit) 17.9.4 and FCC 1.1.214. The margins don't show the coverage at all. The coverage and summary tabs seem to work for me.

tonyhallett commented 6 months ago

@MythosPantheon Please can you share the solution with the project with a single unit test.

@WyrmUK I am going to need more to go on.
Have you turned it off by chance ?

image
MythosPantheon commented 6 months ago

Sandbox.zip

I have checked the settings and mine match the image you have shared

tonyhallett commented 6 months ago

@MythosPantheon You have not included the test project

MythosPantheon commented 6 months ago

Apologies

TestProject1.zip

tonyhallett commented 6 months ago

@MythosPantheon

Perhaps you have set ShowCoverageInGlyphMargin false.

image

MythosPantheon commented 6 months ago

ShowCoverageInGlyphMargin is set to true, and doesn't explain why the coverage and summary tabs are not showing

MythosPantheon commented 6 months ago

The buttons for Open Coberatura and Open Hotspots are also disabled, despite the coberatura report being generated, and accessible from the file explorer

MythosPantheon commented 6 months ago

Settings are as shown

image image

WyrmUK commented 6 months ago

I'm using the same settings as MythosPantheon except: IncludeTestAssembly: True RunMsCodeCoverage: No

Looking closer, the margin glyphs are actually showing, but very faintly (I had to change display settings on the monitor). I suspect that might be because I am not using Dark mode (will raise in a separate issue). image

tonyhallett commented 6 months ago

@WyrmUK

Looking closer, the margin glyphs are actually showing, but very faintly (I had to change display settings on the monitor). I suspect that might be because I am not using Dark mode (will raise in a separate issue).

You control the colours yourself in Fonts and Colors.

image
tonyhallett commented 6 months ago

@MythosPantheon

The project you provided has launchSettings.json { "profiles": { "WSL": { "commandName": "WSL2", "distributionName": "" } } }

Could this be causing the problem ?

From the FCC Output Window Pane can you check again that there are no errors and that the coverage.xml, Cobertura.xml and index.html files have been generated. Perhaps diagnostics.log has some information.

MythosPantheon commented 6 months ago

Unfortunately it isn't responsible, I am seeing this issue across multiple solutions, most of which don't have that file. Removing that file also does not change the results

The FCC Output Window is not showing any errors and the 3 files are being generated correctly

tonyhallett commented 6 months ago

Can you switch to RunMsCodeCoverage Yes and see if that makes any difference.

MythosPantheon commented 6 months ago

Switching RunMsCodeCoverage to Yes has not made a difference

tonyhallett commented 6 months ago

Can you open the index.html file in the browser

MythosPantheon commented 6 months ago

There are 2 versions of index.html in coverage-tool-output, both open fine and appear identical

image

tonyhallett commented 6 months ago

I am afraid I cannot help any further without debugging FCC on your machine.

Visual Studio: 2022 Professional, 2022 Community This extension: 1.1.214, 1.1.194

Is this occuring for both 1.1.214 and 1.1.194 ?

This has been seen on 2 different machines, with slight differences in the settings, including the version. The most up to date machine was fine on 08/03/2024, with this issue noticed on 12/03/2024

I cannot see how the code that I merged in from the 8-12 of March could have had an impact.

Is there anything unusual about the machines you are running ? Has there been any other change at your end ?

MythosPantheon commented 6 months ago

I have experienced the issue on 2 machines, one with 2022Professional with 1.1.214 and the other with 2022 community with 1.1.194. The latter when trying to replicate the issue.

I was using FCC without issue on the 8th, but came back on the 12th to find this issue. There is no change that I am aware of that happened on both machines in that time frame

tonyhallett commented 6 months ago

Are you using the same machine for both Professional and Community ?

MythosPantheon commented 6 months ago

No, Professional is on one machine, Community on the other

tonyhallett commented 6 months ago

Is Community working still ?

MythosPantheon commented 6 months ago

No, both versions have this issue

tonyhallett commented 6 months ago

@MythosPantheon

If you are getting the same result ( lack of ) with different versions of FCC ( 1.1.194 was released Jul 2 2023) that is strange.

FCC uses tools that are installed in C:\Users\tonyh\AppData\Local\FineCodeCoverage. Do the machines map to the same path ?

uLinck commented 6 months ago

i'm with the same problem and I can't resolve :/

tonyhallett commented 6 months ago

@uLinck Exact same problem ?

uLinck commented 6 months ago

@uLinck Exact same problem ?

yes, same config too only the summary and coverage tabs are not updated

tonyhallett commented 6 months ago

@uLinck Have you been using VS Professional and Community with the same FCC versions as Mythos ?

uLinck commented 6 months ago

Community 17.9.5 I already managed to solve it, just uninstall the plugin and install it again.

MythosPantheon commented 6 months ago

I have also fortunately solved the issue. I had tried reinstalling the extension, without success. However after updating visual studio it is now working as expected