ci-reporter / ci_reporter

CI::Reporter is an add-on to popular test frameworks that allows you to generate XML reports
MIT License
343 stars 110 forks source link

undefined method `exception' for java.lang.reflect.UndeclaredThrowableException on JRuby with MiniTest #74

Closed hakanai closed 10 years ago

hakanai commented 12 years ago

A failing test under JRuby with MiniTest currently causes ci_reporter itself to bomb out rather than reporting the exception which occurred in the test:

 [java] Caused by: org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `exception' for java.lang.reflect.UndeclaredThrowableException:Java::JavaLangReflect::UndeclaredThrowableException
 [java]     at RUBY.name(jar:file:ruby-testing-gems.jar!/gems/ci_reporter-1.7.0/lib/ci/reporter/minitest.rb:52)
 [java]     at RUBY.to_xml(jar:file:ruby-testing-gems.jar!/gems/ci_reporter-1.7.0/lib/ci/reporter/test_suite.rb:146)
 [java]     at org.jruby.RubyArray.each(org/jruby/RubyArray.java:1612)
 [java]     at RUBY.to_xml(jar:file:ruby-testing-gems.jar!/gems/ci_reporter-1.7.0/lib/ci/reporter/test_suite.rb:140)
 [java]     at org.jruby.RubyProc.call(org/jruby/RubyProc.java:259)
 [java]     at RUBY._nested_structures(jar:file:ruby-testing-gems.jar!/gems/builder-3.0.0/lib/builder/xmlbase.rb:155)
 [java]     at RUBY.method_missing(jar:file:ruby-testing-gems.jar!/gems/builder-3.0.0/lib/builder/xmlbase.rb:63)
 [java]     at RUBY.to_xml(jar:file:ruby-testing-gems.jar!/gems/ci_reporter-1.7.0/lib/ci/reporter/test_suite.rb:136)
 [java]     at RUBY.to_xml(jar:file:ruby-testing-gems.jar!/gems/ci_reporter-1.7.0/lib/ci/reporter/test_suite.rb:86)
 [java]     at org.jruby.RubyArray.each(org/jruby/RubyArray.java:1612)
 [java]     at RUBY.to_xml(jar:file:ruby-testing-gems.jar!/gems/ci_reporter-1.7.0/lib/ci/reporter/test_suite.rb:85)
 [java]     at org.jruby.RubyProc.call(org/jruby/RubyProc.java:259)
 [java]     at RUBY._nested_structures(jar:file:ruby-testing-gems.jar!/gems/builder-3.0.0/lib/builder/xmlbase.rb:155)
 [java]     at RUBY.method_missing(jar:file:ruby-testing-gems.jar!/gems/builder-3.0.0/lib/builder/xmlbase.rb:63)
 [java]     at RUBY.to_xml(jar:file:ruby-testing-gems.jar!/gems/ci_reporter-1.7.0/lib/ci/reporter/test_suite.rb:84)
 [java]     at RUBY.write_report(jar:file:ruby-testing-gems.jar!/gems/ci_reporter-1.7.0/lib/ci/reporter/report_manager.rb:18)
 [java]     at org.jruby.RubyIO.open(org/jruby/RubyIO.java:1180)
 [java]     at RUBY.write_report(jar:file:ruby-testing-gems.jar!/gems/ci_reporter-1.7.0/lib/ci/reporter/report_manager.rb:17)
 [java]     at RUBY.finish_suite(jar:file:ruby-testing-gems.jar!/gems/ci_reporter-1.7.0/lib/ci/reporter/minitest.rb:195)
 [java]     at RUBY._run_suite(jar:file:ruby-testing-gems.jar!/gems/ci_reporter-1.7.0/lib/ci/reporter/minitest.rb:96)
 [java]     at RUBY._run_suites(jar:file:ruby-testing-gems.jar!/gems/ci_reporter-1.7.0/lib/ci/reporter/minitest.rb:83)
 [java]     at org.jruby.RubyArray.map(org/jruby/RubyArray.java:2355)
 [java]     at RUBY._run_suites(jar:file:ruby-testing-gems.jar!/gems/ci_reporter-1.7.0/lib/ci/reporter/minitest.rb:83)
 [java]     at RUBY._run_anything(jar:file:ruby-testing-gems.jar!/gems/ci_reporter-1.7.0/lib/ci/reporter/minitest.rb:75)
 [java]     at RUBY.run_tests(jar:file:/ruby-complete.jar!/META-INF/jruby.home/lib/ruby/1.9/minitest/unit.rb:909)
 [java]     at org.jruby.RubyBasicObject.__send__(org/jruby/RubyBasicObject.java:1667)
 [java]     at org.jruby.RubyKernel.send(org/jruby/RubyKernel.java:2060)
 [java]     at RUBY._run(jar:file:/ruby-complete.jar!/META-INF/jruby.home/lib/ruby/1.9/minitest/unit.rb:896)

Seems like it's expecting a Failure but actually getting the exception object itself, but then attempting to call exception on it to get the exception.

This is on version 1.7.0 but nothing in the change history since then sounds like it is MiniTest-related.

hakanai commented 12 years ago

Still happens on ci_reporter-1.7.2, minitest-4.0.0, builder-3.1.3. Going to try updating JRuby itself next to see if that gets me anywhere.

troygnichols commented 11 years ago

Hi. I have this problem too. Anyone discover a workaround?

shepmaster commented 10 years ago

We are in the process of cleaning out old issues. Specifically, the next version of CI::Reporter is only going to support Test::Unit bundled with the latest version of Ruby 1.9.3, 2.0, and 2.1. If this issue still applies to these versions, please let us know, otherwise we're going to close this issue to focus on current problems. Thanks for your report!

hakanai commented 10 years ago

We switched to rspec, so it's unlikely I will have time or motivation to verify this. Perhaps @troygnichols can provide an update.

shepmaster commented 10 years ago

Closing due to inactivity.