Skip to content

Coverage levels discrepancies between JRuby 1.7.x and JRuby 9.1.x #4819

@montycheese

Description

@montycheese

After upgrading my Rails app's JRuby version from JRuby 1.7.27 to JRuby 9.1.13 I noticed a drop in coverage levels in my code base from 100% to roughly 94%.

I'm using the SimpleCov Gem to output the rspec coverage but it uses Ruby's underlying Coverage module to get the actual coverage numbers.
(rspec 3.6 and simplecov 0.15)

Environment

JRuby 9.1.13

  • rspec 3.6 and simplecov 0.15

  • Rails

Expected Behavior

Behavior prior to upgrade
pre-upgrade

Behavior in ruby 2.4.1 using (rbenv)
post-upgrade-nonjruby

Actual Behavior

Behavior post upgrade to JRuby 9.1.13
post-upgrade

Here's a screen shot of a happy test to prove that testing does indeed work in my JRuby 9.1.13 setup (removed the instance variable)
post-upgrade-happy

As seen in the screen shots of the simple test above, coverage is incorrectly skipped in jruby9000 in certain cases (instance variable in a boolean condition in the above case)

I can post more examples if necessary for debugging.

Am I just missing some special flag when calling rspec, or is there something bigger going on here?
I've run with --dev, --debug, and -Xcli.debug=true

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions