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

LoadError: no such file to load -- ci/reporter/r_spec3/formatter, trying to use from bundler #164

Open hakanai opened 7 years ago

hakanai commented 7 years ago

For our Gemfile:

source 'https://rubygems.org'
gem 'rspec'
gem 'ci_reporter_rspec'

I get an error from RSpec:

     [java] LoadError: no such file to load -- ci/reporter/r_spec3/formatter
     [java]   org/jruby/RubyKernel.java:961:in `require'
     [java]   /Project/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.4.3/lib/rspec/core/formatters.rb:222:in `custom_formatter'
     [java]   /Project/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.4.3/lib/rspec/core/formatters.rb:172:in `find_formatter'
     [java]   /Project/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.4.3/lib/rspec/core/formatters.rb:141:in `add'
     [java]   /Project/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.4.3/lib/rspec/core/configuration.rb:767:in `add_formatter'
     [java]   /Project/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.4.3/lib/rspec/core/configuration_options.rb:114:in `block in load_formatters_into'
     [java]   org/jruby/RubyArray.java:1734:in `each'
     [java]   /Project/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.4.3/lib/rspec/core/configuration_options.rb:114:in `load_formatters_into'
     [java]   /Project/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.4.3/lib/rspec/core/configuration_options.rb:23:in `configure'
     [java]   /Project/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.4.3/lib/rspec/core/runner.rb:105:in `setup'
     [java]   /Project/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.4.3/lib/rspec/core/runner.rb:92:in `run'
     [java]   /Project/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.4.3/lib/rspec/core/runner.rb:78:in `run'
     [java]   /Project/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.4.3/lib/rspec/core/runner.rb:45:in `invoke'
     [java]   /Project/vendor/bundle/jruby/2.3.0/gems/rspec-core-3.4.3/exe/rspec:4:in `<main>'

It seems like RSpec has seen the "RSpec3" module name, and assumed that this would be in an "r_spec3" folder, but it is actually in "rspec3".

I tried to work around this by explicitly doing this:

gem 'ci_reporter_rspec', require: [ 'ci/reporter/rspec', 'ci/reporter/rspec3/formatter' ]

But this doesn't seem to change things.

Full command-line, in case it matters...

/path/to/jruby-9.1.9.0-complete.jar -S bundle exec rspec \
    --backtrace \
    --format documentation \
    --format CI::Reporter::RSpec3::Formatter \
    --format documentation --out "${reportdir}/specs.txt" \
    --format html --out "${reportdir}/specs.html" \
    "${arguments}"

The odd thing is, previously we were loading gems from a jar file, and that was working. Now I'm trying to move towards using bundler directly (less hacks), but it seems like it's failing to find things which it was previously finding.

BrazhnykYuriy commented 5 years ago

This is pretty old, but if someone get here, just require before use:

--require ci/reporter/rspec3/formatter
--format CI::Reporter::RSpec3::Formatter
pboling commented 1 year ago

This can probably be closed @nicksieger