-
-
Notifications
You must be signed in to change notification settings - Fork 837
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
feat: collect code coverage and integrate codecov #1170
Conversation
@tillig @alistairjevans ready to review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, a few tweaks.
I think the value in these changes comes if we can see the report during CI. It would be good to be able to access that report through the appveyor artifacts somehow, even if it's bit manual for now.
Possibly worth considering the AppVeyor CodeCov integration: https://www.appveyor.com/blog/2017/03/17/codecov/ The dotnet test output might be able to feed into it? Not sure. |
Will try it out and put together the steps required, since I can't do it for this repository. |
Okay, that's pretty easy to use. Good idea @alistairjevans Here a sample from my fork (report still being processed). Steps done for this:
Should we add it to this repo for the beginning? Then at someone needs to get a Token for the actual organization repository. Edit: |
It looks like the generated dashboard from codecov you linked to is not excluding the specified files, did you test with a different data source? As you say, it currently seems to generate quite different results from the code cover report. |
Got it now, the I could create the sample using my fork and check it in for now, someone else has to configure it completely for Organization level access though. How should we proceed? |
@alsami, where do we call the codecov bash file from? Is it from inside our own build script? Just that I can't see any changes in this PR to do that, so wondered how it works. |
Yes, didn't add because I'd need to set variables for the runners (token for codecov).
Should I add it? Then pipeline would fail now. Secondly, should we additional keep the manual reports, in case someone want to download them? |
@tillig, did you want to check whether you're happy with integrating CodeCov? If so, you would need to set up the account and whatnot as described by @alsami. We should end up with CodeCov posting code coverage results into our issues (should look something like dotnet/roslyn-analyzers#3643 (comment)). @alsami, I'd say commit all the changes into this PR, the build will break, but once the other setup is in place, this PR should show us our first CodeCov results right? As for whether to retain the report...I'd say maybe no? Just because CodeCov already let's you view a drill-down, and I'd probably rather have the single source of truth? But I'm not 100% certain, so if you'd rather keep the downloadable report I don't mind. |
Yes, as far as I've understood, this is how it should work, maybe it will also just work on the next PR. Then it will definitely display regressions in the coverage.
Agree, someone still might wants to download it for offline access just before a flight or something to waste time writing tests? 😆 |
Looks like there are some merge conflicts based on the Linux build changes I pushed into I attached it to the Autofac repo at the org level. It says you don't need an upload token from AppVeyor on public repositories, though try it out and let me know if it turns out we do. I have such a token, but if we don't need it, then no need to post it or secure it or whatever. |
Waiting for #1173 and then rebase. |
Looks like it is indeed working without a token. Here the link: It's also gonna start working from the second PR on, bc there are no previous reports available. |
@tillig could you get me the badge markdown data available here? I'd be able to add it to the |
Codecov Report
@@ Coverage Diff @@
## v6 #1170 +/- ##
=====================================
Coverage ? 80.11%
=====================================
Files ? 188
Lines ? 4370
Branches ? 945
=====================================
Hits ? 3501
Misses ? 416
Partials ? 453 Continue to review full report at Codecov.
|
There it is! Looks like it does only recognize it when the badge is available. Comparison does not work until there are previous reports available. Ready to review I'd say. |
I don't know if it made a difference, but when I went to get the badge there was a prompt at the top of the screen to click a button to "install the CodeCov app" in the org, which... is what I thought I did, but apparently signing the repos up for coverage doesn't also install the app. It could be that me clicking more buttons made magic happen. But, regardless, it's a pretty cool thing to see. Nice work! |
That actually makes more sense. Nice anyway that it is working now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking great. I'm excited to get this merged in; we can maybe use this as a template for other repos, too! Couple minor things to make sure it still works for Windows and local builds.
Woops, looks like the CI check doesn't work properly. |
I'll update the repos that are Linux compatible soon and integrate codecov as well 👍 Good to go now. Latest build successfully uploaded the report |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two minor changes that have one-click suggestions, should be good. I'm stoked!
Looking at the YAML page:
I assume it'll pick up that |
According to the docs, it does assume master as default, unless stated otherwise. Will add a YAML file changing that. |
Introduced basic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
netcoreapp3.1
, same forAutofac.Benchmark
coverlet.collector
andcoverlet.msbuild
toDirectory.Buiild.props
file located in/test
Pipeline that executed the report-generation:
https://ci.appveyor.com/project/Autofac/autofac/builds/34226546