lemurheavy / coveralls-public

The public issue tracker for coveralls.io
http://coveralls.io
124 stars 7 forks source link

undefined method `coverage` for `SimpleCov::SourceFile` #1525

Closed jestingrabbit closed 2 years ago

jestingrabbit commented 3 years ago

Set up a ruby repo as per the docs for multiformatter ie added the gem, required it in the spec helper before pulling in source files. After inserting a .new in your sample code to get things compiling, I'm persistently seeing the below. Will give a few other things a shot (ie not using multiformatter, perhaps picking some different gem versions etc) but this does seem to be an issue in your code and simplecov working together when both are on latest.


Coveralls encountered an exception:
--
  | NoMethodError
  | undefined method `coverage' for #<SimpleCov::SourceFile:0x0000561897d5c4f0>
  | Did you mean?  coverage_data
  | /buildkite/builds/ci-v3-generic-agent-3/blake-education/bx/dest/vendor/bundle/ruby/2.5.0/gems/coveralls-0.7.2/lib/coveralls/simplecov.rb:50:in `block in format'
  | /usr/lib/ruby/2.5.0/forwardable.rb:229:in `each'
  | /usr/lib/ruby/2.5.0/forwardable.rb:229:in `each'
  | /buildkite/builds/ci-v3-generic-agent-3/blake-education/bx/dest/vendor/bundle/ruby/2.5.0/gems/coveralls-0.7.2/lib/coveralls/simplecov.rb:40:in `format'
  | /buildkite/builds/ci-v3-generic-agent-3/blake-education/bx/dest/vendor/bundle/ruby/2.5.0/gems/simplecov-0.21.2/lib/simplecov/formatter/multi_formatter.rb:9:in `block in format'
  | /buildkite/builds/ci-v3-generic-agent-3/blake-education/bx/dest/vendor/bundle/ruby/2.5.0/gems/simplecov-0.21.2/lib/simplecov/formatter/multi_formatter.rb:8:in `map'
  | /buildkite/builds/ci-v3-generic-agent-3/blake-education/bx/dest/vendor/bundle/ruby/2.5.0/gems/simplecov-0.21.2/lib/simplecov/formatter/multi_formatter.rb:8:in `format'
  | /buildkite/builds/ci-v3-generic-agent-3/blake-education/bx/dest/vendor/bundle/ruby/2.5.0/gems/simplecov-0.21.2/lib/simplecov/result.rb:51:in `format!'
  | /buildkite/builds/ci-v3-generic-agent-3/blake-education/bx/dest/vendor/bundle/ruby/2.5.0/gems/simplecov-0.21.2/lib/simplecov/configuration.rb:197:in `block in at_exit'
  | /buildkite/builds/ci-v3-generic-agent-3/blake-education/bx/dest/vendor/bundle/ruby/2.5.0/gems/simplecov-0.21.2/lib/simplecov.rb:189:in `run_exit_tasks!'
  | /buildkite/builds/ci-v3-generic-agent-3/blake-education/bx/dest/vendor/bundle/ruby/2.5.0/gems/simplecov-0.21.2/lib/simplecov.rb:179:in `at_exit_behavior'
  | /buildkite/builds/ci-v3-generic-agent-3/blake-education/bx/dest/vendor/bundle/ruby/2.5.0/gems/simplecov-0.21.2/lib/simplecov/defaults.rb:30:in `block in <top (required)>'
jestingrabbit commented 3 years ago

fyi gem 'simplecov', '~> 0.17.0' fixes this... I'll have a pr up that fixes soon.

afinetooth commented 3 years ago

thanks @jestingrabbit. In case it saves you time, the coveralls-ruby-reborn project has added support for simplecov 0.17+. tagliala has been generously keeping that project up-to-date for the community where the original repo has fallen behind. The Coveralls team has been putting its recent efforts toward this universal coverage reporter project that is cross-language, cross-CI, etc.

stale[bot] commented 2 years ago

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.