-
Notifications
You must be signed in to change notification settings - Fork 466
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
Use MS coverage instead of coverlet #6211
Conversation
Looks like this will require a change in arcade (or customization). I will sync with them to see how best to do so. In the meantime, moving this back to draft. |
This solves the "Unable to read beyond the end of the stream." we keep facing on CI builds
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #6211 +/- ##
===========================================
- Coverage 96.14% 89.17% -6.98%
===========================================
Files 1365 1165 -200
Lines 317523 70799 -246724
Branches 10269 6791 -3478
===========================================
- Hits 305295 63135 -242160
+ Misses 9790 6128 -3662
+ Partials 2438 1536 -902 |
To really complete this PR, it would be nice to add some |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
The cited issue looks like coverlet-coverage/coverlet#865. Switching away from coverlet to address it seems like a really big hammer. What functionality is gained / lost by switching from coverlet to mstest? |
@MarcoRossignoli is owner of coverlet and also working on MS coverage, I think he will give more accurate answers than what I can do. |
@Evangelink in the latest report, it appears the line numbers are off by 2 in a bunch of the new data |
Here's a file with confusing data: Looks like none of the local functions are tracked. |
I am not able to reproduce issue locally. Can we rerun this codecov logic? Maybe source changed in the meantime and we use old coverage report. |
@jakubch1 I'm looking at the .txt file uploaded to codecov.io (which contains the embedded Coburtura XML content) and it looks like the line numbers in the file above don't match the content of that file. |
@Evangelink normally I would avoid merging main into the PR branch unless there's a merge conflict, but in this case it seems like it will help us get a better understanding of the coverage difference. |
@sharwell I will try to have a look at this either during weekend or on Monday. |
If
we recommend switching to VS code coverage for better performance and reliability. |
Oh, that rules out using it in dotnet/runtime. |
We add local functions in separate classes in the report. It looks like reportgenerator doesn't like it. I will investigate it. |
The performance of this feature was so poor in Coverlet that we always disabled it anyway. I wouldn't consider removal of this feature a downside mostly because I never saw it work in practice.
I find this pretty concerning. Why would this tool not be open source? |
I don't want to say something wrong but I think it's technically possible for you to use coverlet for CoreLib and Code Coverage for the rest. @MarcoRossignoli @jakubch1 Am I wrong?
This was a collegial decision made with management based on proprietary code, tools and some business directions. I don't think there is any plan to revisit this decision in the short term. @jakubch1 and @pavelhorak might be able to give you more info. This PR was a proposition to fix recurring issue on this repo and at the same time move to a tool that seems more suited (i.e. whose benefits are bigger for the need of this repo). If you prefer to stick with coverlet for any reason, that's perfectly fine and so please feel free to close this PR. FYI I can file a different PR to do a small change in the way you are using coverlet that would fix the issue and leave the rest of the layout the same. |
Why would we want to complicate things by using two different tools? Is the perf difference so substantial as to warrant such complication? What's the technical limitation on supporting corelib? Note we frequently want to get the coverage for multiple libs, including corelib, in the same run. |
@stephentoub My understanding is the performance comparison was not run with |
I've run comparison for 1 test project from roslyn repository (Windows, Debug, .NET 7, Microsoft.CodeAnalysis.UnitTests project). I will try to use some tooling to run comparison for more projects also. I will need to investigate also difference between dynamic and static instrumentation because in past we were getting very similar performance.
|
@sharwell @stephentoub I've run comparison for all projects in roslyn repository. It shows with MS coverage ~3x faster tests execution. Attaching file with logs from execution where you can find results for specific projects.
|
FYI: We are frequently running into failures on PRs and CI due to code coverage, almost every other run. I think it is likely that we turn off code coverage on the repo until we have a stable and reliable story.
|
@mavasani to fix that issue you should move to the datacollector, here we're using msbuild task integration that suffers the "test platform process kill". Here the doc https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/VSTestIntegration.md |
@mavasani The coverlet story is quite reliable (we fixed the reliability issues 3-4 years ago). Unfortunately, this repository uses a large amount of build customization (Arcade) that makes it difficult to integrate with when tools have been designed for standard toolchains. Considering that the reliability issues are 100% self-inflicted (the company that owns this repository is responsible for all of Arcade, microsoft/vstest#1900, and the fact that coverlet's data collector integration is required to be so complex), I see no value in penalizing coverlet (the one working component in this) by disabling it even temporarily. |
What is the reason coverlet.collector integration is so complex? In this PR we proposed changing to MS data collector and all worked in terms of collector integration so I think we can do it in same way. |
This solves the "Unable to read beyond the end of the stream." we keep facing on CI builds
Full error: