-
-
Notifications
You must be signed in to change notification settings - Fork 46
No cobertura files for ms code coverage. #296
-
Can't get any coverage results.
I've pared the test project down to the minimum.
- Used to have coverlet.collector package - removed it
- Used to have coverlet.runsettings file - removed it
- Added Microsoft.CodeCoverage
Still nothing.
This used to work several months ago. When it stopped working I did not have time to dig into it.
- Tests are running fine
- FCC 1.1.180
- Microsoft.CodeCoverage 17.3.1
- Microsoft.NET.Test.Sdk 17.3.1
FCC output:
Fine Code Coverage : Ms code coverage
Fine Code Coverage : No cobertura files for ms code coverage.
Fine Code Coverage : ================================== DONE ==================================
Help?
Beta Was this translation helpful? Give feedback.
All reactions
Well, it looks like one of the tests is breaking the coverage.
Another dev on my team removed all tests except one, and the coverage worked.
We're slowly bringing them back into the project.
Once I figure out the culprit I'll share it here.
@tonyhallett, thank you so much for your help!
Replies: 7 comments 30 replies
-
What is your RunMsCodeCoverage setting ?
Beta Was this translation helpful? Give feedback.
All reactions
-
It's set to Yes
image
Beta Was this translation helpful? Give feedback.
All reactions
-
Are you supplying a runsettings ?
Beta Was this translation helpful? Give feedback.
All reactions
-
Of course, apologies.
The error is specific and as yet has not been encountered. The test explorer should provide the location of the cobertura file but has failed to do so.
Is there anything unusual with your solution? Perhaps you can share it or a stripped down version of it.
Beta Was this translation helpful? Give feedback.
All reactions
-
Nothing that I can think of.
The file is being created:
image
How does Test Explorer expose the cobertura file?
How does FCC look for it?
Beta Was this translation helpful? Give feedback.
All reactions
-
(I'd have to put in some work to pare down the solution into a shareable state ...)
Beta Was this translation helpful? Give feedback.
All reactions
-
Exposed with API.
FineCodeCoverage/SharedProject/Core/MsTestPlatform/CodeCoverage/MsCodeCoverageRunSettingsService.cs
Line 352 in ca33352
Beta Was this translation helpful? Give feedback.
All reactions
-
So maybe test explorer is reporting the location wrong? Any way to control that?
Beta Was this translation helpful? Give feedback.
All reactions
-
It is reporting no location which is odd given you can find it.
Can you delete the Test results folder and try again. What does FCC report and is a cobertura file created ?
Beta Was this translation helpful? Give feedback.
All reactions
-
I am also interested in the class.js file. Any ideas what that is ?
Beta Was this translation helpful? Give feedback.
All reactions
-
The beginning of class.js:
/* Chartist.js 0.11.4 * Copyright © 2019 Gion Kunz * Free to use under either the WTFPL license or the MIT license. * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-WTFPL * https://raw.githubusercontent.com/gionkunz/chartist-js/master/LICENSE-MIT */
Beta Was this translation helpful? Give feedback.
All reactions
-
Peculiar..
Beta Was this translation helpful? Give feedback.
All reactions
-
Removing the test results and running the tests again did NOT generate coverage results. Those files must have been from a previous attempts earlier today.
FCC again responded with "No cobertura files ...".
I think there's a chance my test project is configured funny. Seriously considering creating a new test project and copy my .cs files over.
Beta Was this translation helpful? Give feedback.
All reactions
-
Can you restart you machine and try again ?
Beta Was this translation helpful? Give feedback.
All reactions
-
What project type is your test project ?
Beta Was this translation helpful? Give feedback.
All reactions
-
Net6.0 console app.
Beta Was this translation helpful? Give feedback.
All reactions
-
Can you provide the generated runsettings in the test project fcc folder.
Beta Was this translation helpful? Give feedback.
All reactions
-
Microsoft Visual Studio Community 2022 (64-bit) - Current
Version 17.3.4
Beta Was this translation helpful? Give feedback.
All reactions
-
I assume that you are not using this. If so please remove it and try again.
<PackageReference Include="Microsoft.CodeCoverage" Version="17.3.1" />
Beta Was this translation helpful? Give feedback.
All reactions
-
Remove? This?
Beta Was this translation helpful? Give feedback.
All reactions
-
it was hiding - resolved
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
Removed. No difference.
Test Explorer ran all tests, created a new {GUID} folder in the ResultsDirectory, but it has zero files.
FCC's output is pretty much the same:
Fine Code Coverage : Initializing
Fine Code Coverage : Initialized
Fine Code Coverage : Ms code coverage
Fine Code Coverage : No cobertura files for ms code coverage.
Fine Code Coverage : ================================== DONE ==================================
Beta Was this translation helpful? Give feedback.
All reactions
-
Well, it looks like one of the tests is breaking the coverage.
Another dev on my team removed all tests except one, and the coverage worked.
We're slowly bringing them back into the project.
Once I figure out the culprit I'll share it here.
@tonyhallett, thank you so much for your help!
Beta Was this translation helpful? Give feedback.
All reactions
-
You could use the dotnet cli with the generated runsettings and see if that logs error information that Fcc may have missed
Beta Was this translation helpful? Give feedback.
All reactions
-
👀 1
-
Problem solved!
Two tests made use of temp files and, during clean up, we accidentally attempted to clear the entire Temp folder. 🤦♂️
Once we ensured we only attempted to delete the relevant file, FCC was able to find the cobertura file. (I imagine we were accidentally clobbering some of the test runner's working files...)
Beta Was this translation helpful? Give feedback.