Runtime: Need code coverage run for Unix

Created on 14 Mar 2017  路  17Comments  路  Source: dotnet/runtime

area-Meta enhancement increase-code-coverage os-linux tenet-reliability

Most helpful comment

Blowing my own trumpet here, but if you need something right now, following my comment from last August, I've dusted off my old project AltCover that does the instrumentation by weaving the extra IL as a separate step (based on the one I cited above), and that does work on .net framework, .net core, and Mono, on Windows and (at least) Linux. Line coverage only in classic NCover format, at the moment.

All 17 comments

Need code coverage run for Unix

First we need a code coverage tool that works on Unix.
https://github.com/dotnet/coreclr/issues/445#issuecomment-277821044

Ah - I would say this is very much Future then.
Ideally we would have a way to diff Windows and Unix coverage, I can think of some ways that could be useful.

This is really important. I've been working on our Linux socket implementation (which is very different than Windows) and there are definite testing gaps. It's really hard to have confidence in our testing when we have no code coverage. I hope we can get this done for 2.1.

In the days before OpenCover being available for .net4, I used this instrumenting tool as a stopgap for the coverage gathering I was doing at work. Rather than making use of the profiler API to inject instrumentation at run-time, it pre-instruments the assemblies with similar IL instead. The code ended up on Google Code, from whence I salvaged it, mainly for archival purposes.

It may be that it can serve the same stop-gap role here.

Any news?

Blowing my own trumpet here, but if you need something right now, following my comment from last August, I've dusted off my old project AltCover that does the instrumentation by weaving the extra IL as a separate step (based on the one I cited above), and that does work on .net framework, .net core, and Mono, on Windows and (at least) Linux. Line coverage only in classic NCover format, at the moment.

We are currently experimenting with coverlet. Instructions here: https://github.com/dotnet/corefx/blob/master/Documentation/building/code-coverage.md#cross-platform-coverage

@ViktorHofer, should this be closed, or if not, what's still needed?

Unix coverage runs are working now. This can be closed. We have other issues that are tracking adding a AzDO run.

@ViktorHofer can you please update us in how that is working now? this ended up being coverlet?

This is documented here: https://github.com/dotnet/corefx/blob/master/Documentation/building/code-coverage.md#local-code-coverage-runs

It is using coverlet and ReportGenerator repo tools for code coverage measurement and to generate an HTML report. Feel free to ping me for additional questions.

@ViktorHofer I did see that page, but since this issue still said it was experimental, I was in doubt if that page was the final version. Now I known its really using coverlet. Thank you for the explanation!

BTW, will this end up in dotnet core 3?

BTW, will this end up in dotnet core 3?

Will what end-up in .NET Core 3?

The code-coverage/coverlet/tooling support for gathering code coverage under unix/linux.

Coverlet offers that already. We don't offer an in-built tools as part of the BCL. Coverlet was recently integrated into dotnet test. Not sure if I understand your question correctly.

that was it! all of this (coverlet/bcl/dotnet test) will work with dotnet core 3. :-)

Absolutely 馃憤

Was this page helpful?
0 / 5 - 0 ratings