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

Problems running scov for a Rails Engine Source #359

Closed
krobi64 opened this issue Jan 14, 2015 · 3 comments
Closed

Problems running scov for a Rails Engine Source #359

krobi64 opened this issue Jan 14, 2015 · 3 comments

Comments

@krobi64
Copy link

krobi64 commented Jan 14, 2015

I have an engine repo much like mentioned in #221, and like that issue, I am not getting any coverage from my specs:

permission_c0_coverage_information_-simplecov-_rcov_style

I attempted to use the solution suggested in the https://gist.github.com/bsodmike/5866873:

# my_engine/spec/spec_helper.rb:

SimpleCov.start 'rails' do
    adapters.delete(:root_filter)
    filters.clear # This will remove the :root_filter that comes via simplecov's defaults
    add_filter do |src|
      !(src.filename =~ /^#{SimpleCov.root}/) unless src.filename =~ /my_engine/
    end
end

However, instead of catching the code in both lib and the app directories of the engine, it instead only captures a few spec files:

permission_c0_coverage_information_-simplecov-_rcov_style

Engines are tested in context of a spec/dummy app.

require File.expand_path('../dummy/config/environment.rb',  __FILE__)
@bf4
Copy link
Collaborator

bf4 commented Jan 20, 2015

Sanity check, did you actually use /my_engine/? Also, normally you would test coverage of spec files. That might be useful in seeing if you have unexecuted tests, but that's about it.

For sanity check, please also try what I suggested in #345 (comment)

After your SimpleCov.start try adding

SimpleCov.at_exit do
  puts Coverage.result.keys
end

Which will output every single file the Ruby stlib Coverage module recorded as being loaded. Hopefully that will help you pinpoint your problem.

@bf4
Copy link
Collaborator

bf4 commented Jan 20, 2015

Also, forgot to ask,

  1. Please share the info from https://github.com/colszowka/simplecov/blob/master/CONTRIBUTING.md
  2. Did you look at Create a STANDARD_RESPONSES file for common issues #340 ?

@bf4
Copy link
Collaborator

bf4 commented Jan 28, 2015

Closing due to lack of response. Feel free to reopen and add more info.

@bf4 bf4 closed this as completed Jan 28, 2015
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