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

JRuby includes coverage for .simplecov #478

Closed
donv opened this issue Mar 24, 2016 · 3 comments
Closed

JRuby includes coverage for .simplecov #478

donv opened this issue Mar 24, 2016 · 3 comments

Comments

@donv
Copy link
Contributor

donv commented Mar 24, 2016

Opening this for guidance and discussion. If you have a chat channel, I'd prefer that :)

I am trying to solve the last JRuby failure:

https://travis-ci.org/colszowka/simplecov/jobs/118230188#L234

JRuby includes .simplecov in the list of covered files. Is that wrong? It only happens for Scenario: Using configure block after start, and code (SimpleCov.configure) in .simplecov is run after the SimpleCov.startcall has completed.

Seems like including .simplecov in the list of covered files could be considered correct behavior.

I can try setting up the test to have different expectations for JRuby and others. What do you think?

@colszowka
Copy link
Collaborator

Hmm, that is interesting. Technically, I guess since it is a ruby source file that is being loaded, one might want to have coverage applied, but on the other hand I think we should try to keep things similar between ruby implementations, and MRI Coverage does not seem to pay attention to this file (most likely because we use load instead of require, and if I remember correctly MRI coverage only is supposed to track required files).

I would suggest to add a jruby-specific filter for either .simplecov or (probably preferrably) !EXTNAME == .rb to https://github.com/colszowka/simplecov/blob/master/lib/simplecov/defaults.rb - maybe as a separate adapter like the root_filter, which then gets a conditional load in https://github.com/colszowka/simplecov/blob/master/lib/simplecov/defaults.rb#L46

@donv
Copy link
Contributor Author

donv commented Mar 24, 2016

I checked the doc, and it explicitly states that loaded code should be covered:

http://ruby-doc.org/stdlib-2.3.0/libdoc/coverage/rdoc/Coverage.html

Submitted a PR #479 for conditional expectation for JRuby.

I am willing to go another way if you still want that.

@PragTob
Copy link
Collaborator

PragTob commented Jan 25, 2017

With #547 we probably don't need this anymore, more reasoning in #479 still lots of thanks 🎉

@PragTob PragTob closed this as completed Jan 25, 2017
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

3 participants