Skip to content
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

Get test coverage of all code that's not version-specific up to 100% #767

Closed
myronmarston opened this issue Apr 11, 2015 · 6 comments
Closed

Comments

@myronmarston
Copy link
Member

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.
@nevinera
Copy link
Contributor

nevinera commented May 8, 2024

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 :-)

@pirj
Copy link
Member

pirj commented May 8, 2024

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%

@JonRowe
Copy link
Member

JonRowe commented May 8, 2024

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

@nevinera
Copy link
Contributor

nevinera commented May 8, 2024

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

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!)

@JonRowe
Copy link
Member

JonRowe commented May 8, 2024

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]

@nevinera
Copy link
Contributor

I think #1458 resolved this finally :-)

@pirj pirj closed this as completed Aug 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants