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

Bug Error thrown: `+': no implicit conversion of Integer into String #28

Open
mollerhoj opened this issue Aug 12, 2021 · 6 comments
Open

Comments

@mollerhoj
Copy link

No description provided.

@mollerhoj
Copy link
Author

Coverage report generated for RSpec to /Users/mollerhoj/work/dd/deepdivr/coverage. 897 / 14462 LOC (6.2%) covered.
Traceback (most recent call last):
	11: from /Users/mollerhoj/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/single_cov-1.6.0/lib/single_cov.rb:265:in `block in override_at_exit'
	10: from /Users/mollerhoj/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/single_cov-1.6.0/lib/single_cov.rb:103:in `block in setup'
	9: from /Users/mollerhoj/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/single_cov-1.6.0/lib/single_cov.rb:33:in `all_covered?'
	8: from /Users/mollerhoj/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/single_cov-1.6.0/lib/single_cov.rb:33:in `flat_map'
	7: from /Users/mollerhoj/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/single_cov-1.6.0/lib/single_cov.rb:33:in `each'
	6: from /Users/mollerhoj/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/single_cov-1.6.0/lib/single_cov.rb:36:in `block in all_covered?'
	5: from /Users/mollerhoj/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/single_cov-1.6.0/lib/single_cov.rb:125:in `uncovered'
	4: from /Users/mollerhoj/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/single_cov-1.6.0/lib/single_cov.rb:156:in `uncovered_branches'
	3: from /Users/mollerhoj/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/single_cov-1.6.0/lib/single_cov.rb:156:in `map'
	2: from /Users/mollerhoj/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/single_cov-1.6.0/lib/single_cov.rb:156:in `each'
	1: from /Users/mollerhoj/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/single_cov-1.6.0/lib/single_cov.rb:156:in `block in uncovered_branches'
/Users/mollerhoj/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/single_cov-1.6.0/lib/single_cov.rb:156:in `+': no implicit conversion of Integer into String (TypeError)

The sum contains a hash: {"else"=>0, "then"=>0} which can't be parsed by
found = sum.map { |k, _| [k[0], k[1] + 1, k[2], k[3] + 1] }

I don't understand the code, but seems like there's a bug in the parsing.

@mollerhoj mollerhoj changed the title Error thrown: Bug Error thrown: `+': no implicit conversion of Integer into String Aug 12, 2021
@grosser
Copy link
Owner

grosser commented Aug 12, 2021

add a p coverage after line 146 to see what is coming in
it's supposed to be a branch coverage output, but it seems to be something else

@grosser
Copy link
Owner

grosser commented Aug 12, 2021

... also from the 897 / 14462 LOC (6.2%) covered. it seems that you have some other coverage tool running, turn that off to confirm that these 2 fighting is causing the issue, then lmk what this other tool is

@mollerhoj
Copy link
Author

The other tool is SimpleCov

@mollerhoj
Copy link
Author

mollerhoj commented Aug 13, 2021

Disabling SimpleCov fixed the issue.

The input to the function was:
{"[:unless, 0, 41, 4, 41, 41]"=>{"[:else, 1, 41, 4, 41, 41]"=>0, "[:then, 2, 41, 4, 41, 26]"=>0}}
after disabling, it is now:
{[:unless, 0, 41, 4, 41, 41]=>{[:else,1, 41, 4, 41, 41]=>0, [:then, 2, 41, 4, 41, 26]=>0}}
Perhaps unpacking the strings would make it possible to run both tools?

@grosser
Copy link
Owner

grosser commented Aug 13, 2021

things being in strings is the bug afaik so we need to find out where they are coming from
what's your SimpleCov version ? ... tried bumping it ? ... tried 0.19.1 which is in the Gemfile.lock here ?

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

2 participants