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

Undefined method floor while checking min_coverage with Simplecov 0.21.0 #965

Closed
iMacTia opened this issue Jan 4, 2021 · 3 comments · Fixed by #966
Closed

Undefined method floor while checking min_coverage with Simplecov 0.21.0 #965

iMacTia opened this issue Jan 4, 2021 · 3 comments · Fixed by #966
Labels

Comments

@iMacTia
Copy link

iMacTia commented Jan 4, 2021

Hello, my automatic builds have started failing tonight, potentially after the release of Simplecov 0.21.0 due to a NoMethodError raised. Looking at the stack trace, it seems related to the minimum_coverage check, but not sure if it's a more extended issue.

Here is how we setup Simplecov (very top of spec_helper):

require 'simplecov'
SimpleCov.start do
  add_filter '/spec/'
  minimum_coverage 75
  minimum_coverage_by_file 75
end

Additional info

/opt/hostedtoolcache/Ruby/2.7.2/x64/lib/ruby/gems/2.7.0/gems/simplecov-0.21.0/lib/simplecov.rb:297:in `round_coverage': undefined method `floor' for #<SimpleCov::CoverageStatistics:0x0000562a4d76d3b0> (NoMethodError)
417
	from /opt/hostedtoolcache/Ruby/2.7.2/x64/lib/ruby/gems/2.7.0/gems/simplecov-0.21.0/lib/simplecov/exit_codes/minimum_coverage_by_file_check.rb:47:in `block (2 levels) in compute_minimum_coverage_data'
418
	from /opt/hostedtoolcache/Ruby/2.7.2/x64/lib/ruby/gems/2.7.0/gems/simplecov-0.21.0/lib/simplecov/exit_codes/minimum_coverage_by_file_check.rb:43:in `map'
419
	from /opt/hostedtoolcache/Ruby/2.7.2/x64/lib/ruby/gems/2.7.0/gems/simplecov-0.21.0/lib/simplecov/exit_codes/minimum_coverage_by_file_check.rb:43:in `block in compute_minimum_coverage_data'
420
	from /opt/hostedtoolcache/Ruby/2.7.2/x64/lib/ruby/gems/2.7.0/gems/simplecov-0.21.0/lib/simplecov/exit_codes/minimum_coverage_by_file_check.rb:42:in `each'
421
	from /opt/hostedtoolcache/Ruby/2.7.2/x64/lib/ruby/gems/2.7.0/gems/simplecov-0.21.0/lib/simplecov/exit_codes/minimum_coverage_by_file_check.rb:42:in `flat_map'
422
	from /opt/hostedtoolcache/Ruby/2.7.2/x64/lib/ruby/gems/2.7.0/gems/simplecov-0.21.0/lib/simplecov/exit_codes/minimum_coverage_by_file_check.rb:42:in `compute_minimum_coverage_data'
423
	from /opt/hostedtoolcache/Ruby/2.7.2/x64/lib/ruby/gems/2.7.0/gems/simplecov-0.21.0/lib/simplecov/exit_codes/minimum_coverage_by_file_check.rb:36:in `minimum_violations'
424
	from /opt/hostedtoolcache/Ruby/2.7.2/x64/lib/ruby/gems/2.7.0/gems/simplecov-0.21.0/lib/simplecov/exit_codes/minimum_coverage_by_file_check.rb:12:in `failing?'
425
	from /opt/hostedtoolcache/Ruby/2.7.2/x64/lib/ruby/gems/2.7.0/gems/simplecov-0.21.0/lib/simplecov/exit_codes/exit_code_handling.rb:11:in `each'
426
	from /opt/hostedtoolcache/Ruby/2.7.2/x64/lib/ruby/gems/2.7.0/gems/simplecov-0.21.0/lib/simplecov/exit_codes/exit_code_handling.rb:11:in `find'
427
	from /opt/hostedtoolcache/Ruby/2.7.2/x64/lib/ruby/gems/2.7.0/gems/simplecov-0.21.0/lib/simplecov/exit_codes/exit_code_handling.rb:11:in `call'
428
	from /opt/hostedtoolcache/Ruby/2.7.2/x64/lib/ruby/gems/2.7.0/gems/simplecov-0.21.0/lib/simplecov.rb:262:in `result_exit_status'
429
	from /opt/hostedtoolcache/Ruby/2.7.2/x64/lib/ruby/gems/2.7.0/gems/simplecov-0.21.0/lib/simplecov.rb:249:in `process_result'
430
	from /opt/hostedtoolcache/Ruby/2.7.2/x64/lib/ruby/gems/2.7.0/gems/simplecov-0.21.0/lib/simplecov.rb:234:in `process_results_and_report_error'
431
	from /opt/hostedtoolcache/Ruby/2.7.2/x64/lib/ruby/gems/2.7.0/gems/simplecov-0.21.0/lib/simplecov.rb:192:in `run_exit_tasks!'
432
	from /opt/hostedtoolcache/Ruby/2.7.2/x64/lib/ruby/gems/2.7.0/gems/simplecov-0.21.0/lib/simplecov.rb:179:in `at_exit_behavior'
433
	from /opt/hostedtoolcache/Ruby/2.7.2/x64/lib/ruby/gems/2.7.0/gems/simplecov-0.21.0/lib/simplecov/defaults.rb:30:in `block in <top (required)>'
@PragTob PragTob added the Bug label Jan 4, 2021
@PragTob
Copy link
Collaborator

PragTob commented Jan 4, 2021

Hello!

Thanks for the bug report! Also, can I have just one release without the need for a bug fix release 😢

Turns out we have complete full testing with cucumber scenarios for minimum_coverage but not minimum_coverage_by_file which allowed this to slip through :|

My apologies, getting into fixing mode.

PragTob added a commit that referenced this issue Jan 4, 2021
minimum_coverage_by_file was a gaping hole in the test suite,
which is now partially remedied through rather thorough cucumber
scenarios and 2 small unit tests that should be expanded on in
the future.

On the negative side: This will inconvenince some people. On the
positive side stuffed another hole in the test suite towards a
better future :D Also it was reported very soon thanks to @iMacTia

Fixes #965
PragTob added a commit that referenced this issue Jan 4, 2021
minimum_coverage_by_file was a gaping hole in the test suite,
which is now partially remedied through rather thorough cucumber
scenarios and 2 small unit tests that should be expanded on in
the future.

On the negative side: This will inconvenince some people. On the
positive side stuffed another hole in the test suite towards a
better future :D Also it was reported very soon thanks to @iMacTia

Fixes #965
PragTob added a commit that referenced this issue Jan 4, 2021
minimum_coverage_by_file was a gaping hole in the test suite,
which is now partially remedied through rather thorough cucumber
scenarios and 2 small unit tests that should be expanded on in
the future.

On the negative side: This will inconvenince some people. On the
positive side stuffed another hole in the test suite towards a
better future :D Also it was reported very soon thanks to @iMacTia

Fixes #965
@PragTob
Copy link
Collaborator

PragTob commented Jan 4, 2021

Released as 0.21.1

@iMacTia
Copy link
Author

iMacTia commented Jan 4, 2021

Thanks a lot for the super-quick fix @PragTob! It has already fixed the tests 🎉!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants