Skip to content

JRuby support #86

@raydog153

Description

@raydog153

Jruby 1.6.4 has now added support for the ruby coverage library as seen in this closed issue ( https://jira.codehaus.org/browse/JRUBY-5935 ). When I tried simplecov when running my rspecs, at the end of the run when it is calculating the coverage, I got the following error:

SystemStackError: stack level too deep
eval at org/jruby/RubyKernel.java:1093
result at /home/ray/Perforce/ray_ray-desktop/ThirdParty/jruby/jruby-1.6.4/lib/ruby/1.9/erb.rb:753
formatted_file_list at /home/ray/Perforce/ray_ray-desktop/ThirdParty/jruby/jruby-1.6.4/lib/ruby/gems/1.8/gems/simplecov-html-0.5.3/lib/simplecov-html.rb:53
result at (erb):30
eval at org/jruby/RubyKernel.java:1093
result at /home/ray/Perforce/ray_ray-desktop/ThirdParty/jruby/jruby-1.6.4/lib/ruby/1.9/erb.rb:753
format at /home/ray/Perforce/ray_ray-desktop/ThirdParty/jruby/jruby-1.6.4/lib/ruby/gems/1.8/gems/simplecov-html-0.5.3/lib/simplecov-html.rb:19
open at org/jruby/RubyIO.java:1111
format at /home/ray/Perforce/ray_ray-desktop/ThirdParty/jruby/jruby-1.6.4/lib/ruby/gems/1.8/gems/simplecov-html-0.5.3/lib/simplecov-html.rb:18
format! at /home/ray/Perforce/ray_ray-desktop/ThirdParty/jruby/jruby-1.6.4/lib/ruby/gems/1.8/gems/simplecov-0.5.3/lib/simplecov/result.rb:90
at_exit at /home/ray/Perforce/ray_ray-desktop/ThirdParty/jruby/jruby-1.6.4/lib/ruby/gems/1.8/gems/simplecov-0.5.3/lib/simplecov/configuration.rb:133
call at org/jruby/RubyProc.java:262
(root) at /home/ray/Perforce/ray_ray-desktop/ThirdParty/jruby/jruby-1.6.4/lib/ruby/gems/1.8/gems/simplecov-0.5.3/lib/simplecov/defaults.rb:42

I was able to solve this issue by removing the jruby_float_fix.rb file. After this I am able to run rspec with simplecov and get a coverage report generated. Only problem now is that the coverage report is reporting 100% coverage for everything, and I know that is not true, esp when I run only one of my spec files. I'll gladly work with you to get this working as this is high priority for us, and I cannot find any other coverage tool out there that works for jruby and 1.9. Also one more issues is that for any view that is rendered, I get this error, but only when I start simplecov:

 Failure/Error: Unable to find matching line from backtrace
 ActionView::Template::Error:
   -1
 # org.jruby.ext.coverage.CoverageData$1.eventHandler(CoverageData.java:55)
 # org.jruby.runtime.EventHook.event(EventHook.java:30)
 # org.jruby.Ruby.callEventHooks(Ruby.java:2647)
 # org.jruby.evaluator.ASTInterpreter.callTraceFunction(ASTInterpreter.java:214)
 # org.jruby.ast.NewlineNode.interpret(NewlineNode.java:100)
 # org.jruby.ast.RootNode.interpret(RootNode.java:129)
 # org.jruby.evaluator.ASTInterpreter.INTERPRET_EVAL(ASTInterpreter.java:96)
 # org.jruby.evaluator.ASTInterpreter.evalSimple(ASTInterpreter.java:198)
 # org.jruby.RubyBasicObject.evalUnder(RubyBasicObject.java:1934)
 # org.jruby.RubyBasicObject.specificEval(RubyBasicObject.java:1913)
 # org.jruby.RubyModule.module_eval(RubyModule.java:2233)
 # org.jruby.RubyModule$i$module_eval_DBG.call(RubyModule$i$module_eval_DBG.gen:65535)
 # org.jruby.internal.runtime.methods.JavaMethod$JavaMethodZeroOrOneOrTwoOrThreeOrNBlock.call(JavaMethod.java:300)

.......

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions