sentry-dotnet
sentry-dotnet copied to clipboard
Get codecov report uploaded from CI
We removed codecov report from GH actions because it was flaky to generate reports Once there's a non-flaky alternative to getting coverage reports in CI, please address this.
Coverage removed here: https://github.com/getsentry/sentry-dotnet/pull/1541 Removed badge: https://github.com/getsentry/sentry-dotnet/pull/1558
Removed restore depth (https://github.com/getsentry/sentry-dotnet/pull/1624):
fetch-depth: 2 # default is 1 and codecov needs > 1
We should be using Codecov, now that it's part of Sentry.
Also, Covecov appears to be showing C# integration via OpenCover or SharpCover. (See https://about.codecov.io/language/c-sharp/ and linked GitHub samples). Either might work, but note that dotnet new xunit pulls in coverlet.collector. We should explore which approach is best, and update the Codecove docs and samples also.
Codecov has a Coverlet page (https://about.codecov.io/tool/coverlet/) but it's lacking any details.
Btw Jared Parsons recently went through this, maybe we can learn from his experience: https://twitter.com/jaredpar/status/1729558507035185384
https://github.com/jaredpar/complog/pull/79
This doesn't look right for a start:
This doesn't look right for a start:
Why? Isnt' it saying that it can't give coverage diff for the PR against main because it hasn't run on main yet. No?
Why? Isnt' it saying that it can't give coverage diff for the PR against
mainbecause it hasn't run onmainyet. No?
I read it as saying it would show code coverage results in this comment once the changes were merged into the default branch.
directly below that you can see Jared has already merged into the default branch (but codecov still doesn't show in that comment).
So it doesn't look like it's working. Maybe it's just poorly explained though 🤷🏻♂️
AFAIK it won't update the original comment on a merged PR since it's kinda "useless" at that point - but if you have the codecov collection running on the main branch then on any followup PRs you'll get diffs.
message will be updated to:
Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests
In terms of the earlier problems we were having, were these related to Coverlet (and so should we be considering something like AltCover) or was it about uploading the reports? I can look at adding Coverlet back again, but only if that makes sense.
In terms of the earlier problems we were having, were these related to Coverlet (and so should we be considering something like AltCover) or was it about uploading the reports? I can look at adding Coverlet back again, but only if that makes sense.
Iirc it was when generating the coverage file, it was some I/O or Stream exception
This:
- https://github.com/coverlet-coverage/coverlet/issues/1436
Worst case we could just avoid breaking the CI run ( || true or something if that's possible, better than no coverage. But hard to believe this is still an issue for so many years
It looks like Microsoft has a CodeCoverage library as well. It does have the disadvantage (vs Coverlet) of being closed source.
It looks like Microsoft has a CodeCoverage library as well. It does have the disadvantage (vs Coverlet) of being closed source.
Interesting. Any advantages? If so, we could get it working first back with coverlet, see how that works for a bit. Then change to this one and compare the results (in codecov)
It looks like Microsoft has a CodeCoverage library as well. It does have the disadvantage (vs Coverlet) of being closed source.
Interesting. Any advantages? If so, we could get it working first back with coverlet, see how that works for a bit. Then change to this one and compare the results (in codecov)
If this works, it's enough reason to change. Just hit the same issue that made us remove it:
- https://github.com/coverlet-coverage/coverlet/issues/1436#issuecomment-1879191857