-
Notifications
You must be signed in to change notification settings - Fork 63
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
Regarding coverage... #174
Comments
I, thank you for taking the time to read the post and propose a solution! Bear in mind that, although not rocket science, the CI config is somewhat unconventional: tests are run against multiplle versions and platforms in ruby, and generate a coverage config file; a post-step collects all generated coverage files, and collates them to generate the aggregate coverage + reports. From the current CI suite standpoint, I guess the requirements for the missing functionality are:
I had a look at your kettle-soup-cover. I may not have fully understood the full scope of it, however I can say that this repo wouldn't necessarily benefit from supporting multiple output formats (it only requires json/html, both supported OOTB by simplecov), nor targetting multiple coverage services (I'd prefer not relying on any and just host it in github somehow, I just didn't find docs on how to do it, but I can also be convinced that it's not worth the trouble, in which case I'd be open to integrate just a single third party for it). It also seems to integrate directly in the helper.rb file somehow, and as per above, the rake task collating several coverage outputs is the one doing the heavy lifting, not sure whether this would support it either. I'd also prefer to keep this barebones (if reasonable) and just use simplecov, if possible. LMK if this makes sense, and whether I didn't get confused with what features your gem provides. |
I agree, there's a significant gap between what this gem needs and what my coverage gem provides. I'd like to add more functionality around automating coverage aggregation and publishing, if there is a normalized "best practice" way we could accomplish that. Perhaps a GitHub Action could be built to do that... I'll close this for now, but love discussion of ways to consolidate community understanding of the "hard fiddly bits" of what we do. |
Just read the blog post on the migration from http-2-next back here to http-2, and saw the request for assistance with coverage.
It may not be everyone's cup of tea, but I consolidated all of my knowledge on how I do coverage on my gems into a gem, so I could share the work with myself, and not redo it for every repo. The result is a "
onefour line" config that, when used with github actions like this, will give you CodeClimate Coverage and Maintenance badges, as well as CodeCov badges, and which can then integrate PR comments related to coverage changes, and it can be easily instrumented to fail the build when a coverage threshold isn't met (line or branch). All instrumentation is via ENV variables. I haven't had any major adopters except for @sunny, but I think it provides a lot of value, and to your point about community re-work, it avoids me having to resolve the same CI issues in every project.It provides a
coverage
rake task, and is able to entirely configure every coverage output format (and all of them at once if you want) I am aware of, including:https://gitlab.com/kettle-rb/kettle-soup-cover (config class)
The ENV variables used for instrumentation:
I'd love to hear your thoughts, and I would LOVE if the community had a better place to amass shared understanding of "how to do code coverage in Ruby with config for both local and CI".
The text was updated successfully, but these errors were encountered: