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

LoadError for spec/runner/formatter/teamcity_formatter #4

Open
darkn3rd opened this issue Jul 28, 2017 · 4 comments
Open

LoadError for spec/runner/formatter/teamcity_formatter #4

darkn3rd opened this issue Jul 28, 2017 · 4 comments

Comments

@darkn3rd
Copy link

darkn3rd commented Jul 28, 2017

SUMMARY

I cannot get this to work, not sure what to do. It looks like there needs to be spec/runner/formatter/teamcity_formatter, but don't know if I need to do anything.

ACTUAL RESULTS

bundler: failed to load command: rspec (/usr/local/bundle/bin/rspec) [0m
LoadError: cannot load such file -- spec/runner/formatter/teamcity_formatter
  /usr/local/bundle/gems/rspec-core-3.5.4/lib/rspec/core/formatters.rb:222:in `require'
  /usr/local/bundle/gems/rspec-core-3.5.4/lib/rspec/core/formatters.rb:222:in `rescue in custom_formatter'
  /usr/local/bundle/gems/rspec-core-3.5.4/lib/rspec/core/formatters.rb:219:in `custom_formatter'
  /usr/local/bundle/gems/rspec-core-3.5.4/lib/rspec/core/formatters.rb:172:in `find_formatter'
  /usr/local/bundle/gems/rspec-core-3.5.4/lib/rspec/core/formatters.rb:141:in `add'
  /usr/local/bundle/gems/rspec-core-3.5.4/lib/rspec/core/configuration.rb:828:in `add_formatter'
  /usr/local/bundle/gems/rspec-core-3.5.4/lib/rspec/core/configuration_options.rb:117:in `block in load_formatters_into'
  /usr/local/bundle/gems/rspec-core-3.5.4/lib/rspec/core/configuration_options.rb:117:in `each'
  /usr/local/bundle/gems/rspec-core-3.5.4/lib/rspec/core/configuration_options.rb:117:in `load_formatters_into'
  /usr/local/bundle/gems/rspec-core-3.5.4/lib/rspec/core/configuration_options.rb:23:in `configure'
  /usr/local/bundle/gems/rspec-core-3.5.4/lib/rspec/core/runner.rb:99:in `setup'
  /usr/local/bundle/gems/rspec-core-3.5.4/lib/rspec/core/runner.rb:86:in `run'
  /usr/local/bundle/gems/rspec-core-3.5.4/lib/rspec/core/runner.rb:71:in `run'
  /usr/local/bundle/gems/rspec-core-3.5.4/lib/rspec/core/runner.rb:45:in `invoke'
  /usr/local/bundle/gems/rspec-core-3.5.4/exe/rspec:4:in `<top (required)>'
  /usr/local/bundle/bin/rspec:17:in `load'
  /usr/local/bundle/bin/rspec:17:in `<top (required)>'

STEPS

I added this to my configuration:

require 'rspec/teamcity'

RSpec.configure do |config|
  config.add_formatter Spec::Runner::Formatter::TeamcityFormatter
  config.before do |example|
    # disable all the observers
    ... snip ...
  end
end

And ran it by doing this:

  bundle exec rspec \
    ${OPTIONS} \
    --format Spec::Runner::Formatter::TeamcityFormatter \
    spec/${CURRENT_TEST}
@mike-zorn
Copy link
Owner

@darkn3rd did you add it to your Gemfile?

@darkn3rd
Copy link
Author

Hello. I did add it. I have gotten these to work, but this requirements to have --require is quite painful. Our test group may have sub-directories with the tests.

So I pass in a command like:

bundle exec rspec --no-color --format progress --require /gobalto/spec/integration --format Spec::Runner::Formatter::TeamcityFormatter spec/integration

Which will fail, as there are no immediate tests in there, only in the sub-directories. When I run it regularly without --require and the TeamCity formatter, use html, it works find, finds everything by the last parameter passed of spec/integration

@mike-zorn
Copy link
Owner

Oh. I see. I'm sorry to say I haven't worked on this in long enough that I don't actually know how to work around that. If you are able to patch this, that's a very welcome pull request 😸

@darkn3rd
Copy link
Author

It seems the utility of this is limited, as you have to explicitly list the individual files. The reason why I am interested in this reporter is because TeamCity Rails Runner doesn't seem to work through Docker. Thus I use this reporter in the container, and get nice UI output in TeamCity.

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

2 participants