-
Notifications
You must be signed in to change notification settings - Fork 181
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
test: Fix simplecov configuration #1366
base: main
Are you sure you want to change the base?
Conversation
48b7ef8
to
5532ddb
Compare
Thank you for catching this @zvkemp. I think one challenge we face here is that we are not sure what to do about our code coverage since we have not defined or enforced a policy around this. Several of the builds are now failing with your fix in place. Its unclear to me what we should do next. @open-telemetry/ruby-contrib-approvers Should we lower the threshold for test coverage as part of this PR? At some point our expectations about code coverage were set to 85%. What is our policy for instrumentations that do not meet this requirement? |
Thanks for opening this PR, @zvkemp!
A few options come to mind: lower the percentage so that every suite passes, selectively lower coverage (if possible), or exclude certain instrumentation libraries from SimpleCov until they can meet the standard. Seeing the percentages for the failing suites, I'm don't think lowering the percentage overall is the best bet. I think we'd have to lower things to 50% to get everything to pass, which doesn't seem particularly helpful. Here's the percentages from the last run: Are we able to lower the coverage in specific instrumentation directories? If so, I propose we lower coverage selectively and open issues to address the coverage problems per instrumentation directory and remove the coverage workaround there. I'm not sure if that's possible. I wonder if an environment variable or an additional Otherwise, we could comment out the |
This sounds fine, though I think I would opt to lower the requirement for these libraries instead. Unfortunately I'm currently looking into why |
At least for graphql, it's a matter of the first appraisal having low coverage, so it fails when SimpleCov exits (the merged coverage metric for graphql would have passed). Seems like we should disable the minimum_coverage lint in SimpleCov itself, or use the subprocess mode to handle the merging. Doesn't look like Appraisal has initialization hooks however, so I'm not sure how plausible that is. I can disable the minimum for now. |
The fix turns out to be fairly minimal — instead of declaring |
@@ -46,6 +46,7 @@ jobs: | |||
ruby: "3.1" | |||
yard: true | |||
rubocop: true | |||
coverage: true |
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.
Tests for the gems in contrib that aren't specifically instrumentation (propagators, resources, etc.) are run in the .github/workflows/ci-contrib.yml
. Could you add coverage: true
to that workflow as well?
Most of the gemspecs here include simplecov, but the majority did not invoke it. Of the ones that did invoke it, none of them did so at the correct place, so the only coverage tracked was generally for the test helper itself. This commit adds a project-wide simplecov configuration file, requires simplecov in the correct place, and ensures results from different appraisals are merged (rather than clobbered).