-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
bring test coverage to 100% #1258
Comments
Coverage reports are broken right now until simplecov-ruby/simplecov#718 is fixed. |
Ah, I have a temporary fix on Should I make a separate PR with this fix? |
You can already set |
+1 for this idea, but we must make sure that they are meaningful tests and not something to reach 100% coverage and be done with it |
Oh, nice. I'll remove that commit then. |
I like the idea of this blogpost.
TL;DR: a project should have a test coverage of 100%. Not all lines should be tested, but lines we don't want to write a test for should be explicitly marked as such. We can ignore lines like this:
I went trough our coverage report and we are currently just below 80%. There are some lines that we really want to cover (
institutions_controller.rb
is currently completely uncovered) but some are simply impossible to cover (lib/SAML/my_resource_validator.rb
for example).I suggest someone goes trough this report (found in
coverage/index.htm
after runningrails test
) and for each block of uncovered code:# :nocov: <Reason why this block is skipped>
Finally, by using
SimpleCov.minimum_coverage 100
we can enforce that this being done for each line of extra code that is added to our project.@bmesuere, @charvp what are your opinions? I think this would be an ideal issue for a job student.
The text was updated successfully, but these errors were encountered: