rspec-expectations
rspec-expectations copied to clipboard
Get test coverage of all code that's not version-specific up to 100%
We did this previously in rspec-core in rspec/rspec-core#1905. All code that is not currently covered should be looked at, and it should be determined which of these categories it's in:
- Dead code that can be deleted.
- Code that's only for older versions of Ruby (or JRuby or whatever). Tag it with
# :nocov:so it's not included the coverage percent calculation. - Code that can and should be covered by a new test.
I know this is ancient, but it's actually pretty close already - after tagging the version-specific code with :nocov:, there are only a total of 18 lines uncovered; I'll tackle the tests for those lines tomorrow.
Do we want to enforce 100% coverage in some way after it's achieved, perhaps with a (non-required) github status, or just by cranking the minimum coverage up to 100%? (Since that config probably wouldn't pass in some of the CI environments, we could specify 100% just in a particular ruby). Or would we rather just check in every few months and catch it back up? Given how close it already was, clearly the practices are not leaving much of a gap anyway :-)
only a total of 18 lines uncovered; I'll tackle the tests for those lines
Nice!
non-required) github status, or just by cranking the minimum coverage up to 100%
That would be perfect. If we’d make it a separate GH check, we would have to run it on a specific Ruby version. We can pick the version that gets us closest to 100%
I'd favour adding a check to our matrix running on the latest Ruby only, please note until I finish the monorepo work we need to apply such changes in rspec-dev and it will mean checking some flag to set which repos support 100% coverage enforcement
I'd favour adding a check to our matrix running on the latest Ruby only, please note until I finish the monorepo work we need to apply such changes in
rspec-devand it will mean checking some flag to set which repos support 100% coverage enforcement
Meaning 3.3 for now, and not ruby-head?
Ah, if you're working on mono-repo-izing, I'll just do the actual coverage bit in this PR; we can talk enforcement in another ticket. Might be simplest to just defer that part until after you're done. (Guess I should take a look at the coverage of the other gem repos next!)
Meaning 3.3 for now, and not ruby-head?
Yes, for us ruby-head is for "pre warning" of upcoming issues rather than enforcing any rules [and is generally allowed to fail]
I think #1458 resolved this finally :-)