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
506 stars 38 forks source link

Issue : FCC Always Failing to generate Report and Showing Coverage Lines when the test runs fine #416

Closed Khareem23 closed 2 months ago

Khareem23 commented 3 months ago

FFC Log.txt

Installed product versions

Description

It shows 0 all through in the table until i manually copy all the build files into the FFC build Ouput folder , then it shows the test coverage table in the log but not on the Coverage Report and it doesn't show line Covered as well . The attached is the log .

The issue is failure to generate the Report

"..coverage.xml is invalid. File does not exist netcoreapp3.1\fine-code-coverage\coverage-tool-output\scoring.dyslexia.testresponse.resolver.UnitTests.coverage.xml' No report files specified. "

This file actually do exist in the stated location.

The attached fine contains the full log

Steps to recreate

  1. Replace this
  2. text with
  3. the steps
  4. to recreate

Current behavior

Explain what it's doing and why it's wrong

Expected behavior

Explain what it should be doing after it's fixed.

tonyhallett commented 3 months ago

Can you share the solution ?

Have you tried with ms code coverage instead ?

tonyhallett commented 3 months ago

Is your file system preventing FCC creating directories ?

Khareem23 commented 3 months ago

Have you tried with ms code coverage instead ? I'm using VS Professional , not Enterprise . i believe MS Code Coverage is only available in Enterprise .

Can you share the solution ? It's a company solution , i won't be able to share it.

Is your file system preventing FCC creating directories ? No , i can see the directories and files created in this path ..\bin\Debug\netcoreapp3.1\fine-code-coverage which contains the build-output and coverage-tool-output

Khareem23 commented 3 months ago

image image image Here are the screenshots

tonyhallett commented 3 months ago

You can use ms code coverage with FCC. RunMsCodeCoverage Yes

tonyhallett commented 3 months ago

If the cobertura file does exist can you post it

Khareem23 commented 3 months ago

You can use ms code coverage with FCC. RunMsCodeCoverage Yes

This is the result when i did this ... -fcc-mscodecoverage-generated.runsettings was not created . only ..coverage.xml is in netcoreapp3.1\fine-code-coverage\coverage-tool-output directory image

Khareem23 commented 3 months ago

cobertura file The xml file in the coverage too output is attached below , i had to zip it so it can go through SCORIN~1.ZIP

tonyhallett commented 3 months ago

I will check the zip when I am at my laptop.

With both methods of collecting coverage there is the same issue. Perhaps we have hit windows file path length limitations. https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry#enable-long-paths-in-windows-10-version-1607-and-later

Khareem23 commented 3 months ago

I will check the zip when I am at my laptop.

With both methods of collecting coverage there is the same issue. Perhaps we have hit windows file path length limitations. https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry#enable-long-paths-in-windows-10-version-1607-and-later

This didn't work image

Same Outcome : image

But when i copy my build files into netcoreapp3.1\fine-code-coverage\build-output manually , i get this which is a little improvement image

There is till no Coverage Report image

and No Coverage Lines image

The error still persist as seen here image

Khareem23 commented 3 months ago

If the cobertura file does exist can you post it

This file was not generated

tonyhallett commented 3 months ago

It is due to the file path lengths.

Do you really need the unit test directory to be nested that deep ? C:\Workspace\scoring.dyslexia.testresponse.resolver\scoring.dyslexia.testresponse.resolver\scoring.dyslexia.testresponse.resolver.UnitTests

Can you not have C:\Workspace\scoring.dyslexia.testresponse.resolver\scoring.dyslexia.testresponse.resolver.UnitTests ?

Khareem23 commented 2 months ago

Resolved , it worked when i restructured the project with shorter path . Thanks