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 `coverage' for #<SimpleCov::SourceFile> #161

Closed
janosrusiczki opened this issue Apr 16, 2020 · 2 comments
Closed

undefined method `coverage' for #<SimpleCov::SourceFile> #161

janosrusiczki opened this issue Apr 16, 2020 · 2 comments

Comments

@janosrusiczki
Copy link

I'm logging this bug as well as a solution for anyone who encounters this.

I ran a bundle update and I've been getting the following error when my CI system tried to send the coverage results to Coveralls:

Coveralls encountered an exception:

NoMethodError
undefined method `coverage' for #<SimpleCov::SourceFile:0x000000000cb4b610>
Did you mean?  coverage_data

/home/travis/build/haiafara/haiafara-ro/vendor/bundle/ruby/2.6.0/gems/coveralls-0.7.1/lib/coveralls/simplecov.rb:50:in `block in format'
/home/travis/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/forwardable.rb:230:in `each'
/home/travis/.rvm/rubies/ruby-2.6.5/lib/ruby/2.6.0/forwardable.rb:230:in `each'
/home/travis/build/haiafara/haiafara-ro/vendor/bundle/ruby/2.6.0/gems/coveralls-0.7.1/lib/coveralls/simplecov.rb:40:in `format'
/home/travis/build/haiafara/haiafara-ro/vendor/bundle/ruby/2.6.0/gems/simplecov-0.18.5/lib/simplecov/result.rb:49:in `format!'
/home/travis/build/haiafara/haiafara-ro/vendor/bundle/ruby/2.6.0/gems/simplecov-0.18.5/lib/simplecov/configuration.rb:196:in `block in at_exit'
/home/travis/build/haiafara/haiafara-ro/vendor/bundle/ruby/2.6.0/gems/simplecov-0.18.5/lib/simplecov.rb:214:in `run_exit_tasks!'
/home/travis/build/haiafara/haiafara-ro/vendor/bundle/ruby/2.6.0/gems/simplecov-0.18.5/lib/simplecov.rb:202:in `at_exit_behavior'
/home/travis/build/haiafara/haiafara-ro/vendor/bundle/ruby/2.6.0/gems/simplecov-0.18.5/lib/simplecov/defaults.rb:27:in `block in <top (required)>'

This is because it seems simplecov 0.18 dropped the coverage property from their SourceFile object.

@janosrusiczki
Copy link
Author

The solution was to switch to tagliala/coveralls-ruby-reborn which is a well maintained gem, as opposed to this.

For those curious the fix was here: tagliala@46b2949#diff-07e218a680913917fbacbf63ea2056e2R47

Thanks for this issue's thread: #130

simukappu added a commit to simukappu/activity_notification that referenced this issue Aug 10, 2020
simukappu added a commit to simukappu/activity_notification that referenced this issue Aug 10, 2020
simukappu added a commit to simukappu/activity_notification that referenced this issue Aug 12, 2020
yujinakayama added a commit to rubocop/guard-rubocop that referenced this issue Oct 27, 2020
simukappu added a commit to simukappu/activity_notification that referenced this issue Nov 25, 2020
Maroo-b added a commit to Maroo-b/faraday that referenced this issue Mar 27, 2021
This is a fix for lostisland#1254
As mentioned in coveralls-ruby issue: lemurheavy/coveralls-ruby#161, using coveralls-ruby-rebon should fix the problem.
Maroo-b added a commit to Maroo-b/faraday that referenced this issue Mar 28, 2021
This is a fix for lostisland#1254
As mentioned in coveralls-ruby issue: lemurheavy/coveralls-ruby#161, using coveralls-ruby-rebon should fix the problem.
bess added a commit to pulibrary/orangetheses that referenced this issue Oct 25, 2021
We are running into this bug: lemurheavy/coveralls-ruby#161

The error message is `undefined method coverage for SimpleCov::SourceFile`
According to the referenced bug report, this switch should fix the
problem.
bess added a commit to pulibrary/orangetheses that referenced this issue Oct 25, 2021
We are running into this bug: lemurheavy/coveralls-ruby#161

The error message is `undefined method coverage for SimpleCov::SourceFile`
According to the referenced bug report, this switch should fix the
problem.
@stale
Copy link

stale bot commented Nov 25, 2021

This issue has been automatically marked for closure because it has not had recent activity. It will be closed if no further activity occurs. If your issue is still active please add a comment and we’ll review as soon as we can. Thank you for your contributions.

N0xFF added a commit to N0xFF/coveralls-demo-ruby that referenced this issue Dec 2, 2021
@stale stale bot closed this as completed Dec 2, 2021
jrochkind added a commit to samvera/browse-everything that referenced this issue Jun 14, 2022
coveralls has started sometimes giving us this problem: lemurheavy/coveralls-ruby#161

coveralls and simplecov both seem to have fallen out of favor in samvera community. @no_reply says:

> hyrax dropped coveralls some years back now.
we didn't feel like it was providing any useful information (coverage reports were erratic, rarely actionable, and even more rarely acted upon)

> simplecov is just a dev tool. it's still wired into the hyrax test suite, but I think it's also rarely used.
jrochkind added a commit to samvera/browse-everything that referenced this issue Jun 14, 2022
coveralls has started sometimes giving us this problem: lemurheavy/coveralls-ruby#161

coveralls and simplecov both seem to have fallen out of favor in samvera community. @no_reply says:

> hyrax dropped coveralls some years back now.
we didn't feel like it was providing any useful information (coverage reports were erratic, rarely actionable, and even more rarely acted upon)

> simplecov is just a dev tool. it's still wired into the hyrax test suite, but I think it's also rarely used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant