Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

No cobertura files for ms code coverage. #296

Discussion options

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?

You must be logged in to vote

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

Comment options

What is your RunMsCodeCoverage setting ?

You must be logged in to vote
0 replies
Comment options

It's set to Yes
image

You must be logged in to vote
0 replies
Comment options

Are you supplying a runsettings ?

You must be logged in to vote
7 replies
Comment options

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.

Comment options

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?

Comment options

(I'd have to put in some work to pare down the solution into a shareable state ...)

Comment options

Exposed with API.

await CombinedLogAsync("No cobertura files for ms code coverage.");
Comment options

So maybe test explorer is reporting the location wrong? Any way to control that?

Comment options

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 ?

You must be logged in to vote
5 replies
Comment options

I am also interested in the class.js file. Any ideas what that is ?

Comment options

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
 */
Comment options

Peculiar..

Comment options

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.

Comment options

Can you restart you machine and try again ?

Comment options

What project type is your test project ?

You must be logged in to vote
1 reply
Comment options

Net6.0 console app.

Comment options

Can you provide the generated runsettings in the test project fcc folder.

You must be logged in to vote
15 replies
Comment options

Microsoft Visual Studio Community 2022 (64-bit) - Current
Version 17.3.4

Comment options

I assume that you are not using this. If so please remove it and try again.

 <PackageReference Include="Microsoft.CodeCoverage" Version="17.3.1" />
Comment options

Remove? This?

Comment options

it was hiding - resolved

Comment options

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 ==================================
Comment options

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!

You must be logged in to vote
2 replies
Comment options

You could use the dotnet cli with the generated runsettings and see if that logs error information that Fcc may have missed

Comment options

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...)

Answer selected by alejandroemoreno
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /