sentry-dotnet icon indicating copy to clipboard operation
sentry-dotnet copied to clipboard

Get codecov report uploaded from CI

Open bruno-garcia opened this issue 4 years ago • 2 comments

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.

bruno-garcia avatar Jan 05 '21 18:01 bruno-garcia

Coverage removed here: https://github.com/getsentry/sentry-dotnet/pull/1541 Removed badge: https://github.com/getsentry/sentry-dotnet/pull/1558

bruno-garcia avatar Mar 30 '22 17:03 bruno-garcia

Removed restore depth (https://github.com/getsentry/sentry-dotnet/pull/1624):

            fetch-depth: 2 # default is 1 and codecov needs > 1

bruno-garcia avatar May 01 '22 16:05 bruno-garcia

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.

mattjohnsonpint avatar Feb 16 '23 17:02 mattjohnsonpint

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

bruno-garcia avatar Nov 29 '23 03:11 bruno-garcia

This doesn't look right for a start: image

jamescrosswell avatar Nov 29 '23 05:11 jamescrosswell

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?

bruno-garcia avatar Nov 29 '23 18:11 bruno-garcia

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?

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 🤷🏻‍♂️

jamescrosswell avatar Nov 30 '23 07:11 jamescrosswell

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.

vaind avatar Dec 01 '23 08:12 vaind

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

bruno-garcia avatar Dec 01 '23 18:12 bruno-garcia

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.

jamescrosswell avatar Dec 21 '23 04:12 jamescrosswell

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

bruno-garcia avatar Dec 22 '23 00:12 bruno-garcia

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

bruno-garcia avatar Dec 22 '23 00:12 bruno-garcia

It looks like Microsoft has a CodeCoverage library as well. It does have the disadvantage (vs Coverlet) of being closed source.

jamescrosswell avatar Jan 04 '24 01:01 jamescrosswell

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)

bruno-garcia avatar Jan 05 '24 17:01 bruno-garcia

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

bruno-garcia avatar Jan 05 '24 20:01 bruno-garcia