Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept .NET 7 coverage.json format #377

Closed
Bonifatius94 opened this issue Sep 17, 2022 · 3 comments
Closed

Accept .NET 7 coverage.json format #377

Bonifatius94 opened this issue Sep 17, 2022 · 3 comments

Comments

@Bonifatius94
Copy link

Is your feature request related to a problem? Please describe.
The new .NET 7 doesn't seem to accept MSBuild coverage flags like in .NET 6 when I call my xUnit tests like this:

dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=lcov /p:CoverletOutput=lcov.info

This only generates a coverage.json file instead of the lcov.info file.

Describe the solution you'd like
Add support for parsing / converting the coverage.json file format in coverage gutters.

Describe alternatives you've considered
Adding a middleware as a build job that does the conversion like this guy. But I really didn't like the thought.

Additional context
I can provide a coverage.json file if you need to figure out what the format even is.

@aburgett87
Copy link

Hey @Bonifatius94
this is an open issue .net 7.0-rc.1 and later. See microsoft/vstest#4014. From the commentary on various issues this will be fixed before the release.

The workaround is to use environment variables.

@Bonifatius94
Copy link
Author

Hey @aburgett87, thanks for your reply 😉

Just for understanding, you're saying that the final .NET 7 MSBuild tooling will output a lcov.info like before and everything will be fine again?

Ok, that's a bit annoying, but I can live with that. Let's close the issue for now and I'll reopen it if the .NET 7 release does something different 😂

@ryanluker
Copy link
Owner

Thanks for the issue @Bonifatius94 and thanks for the extra info and workaround @aburgett87 (I am not familiar with the .Net space so I am glad you could assist!).

We can leave this closed for now but don't hesitate to reopen or create a new issue if the 7 release starts causing you issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants