Integrating codeclimate with travis-ci, travis keeps failing to load codeclimate-test-reporter

937 views Asked by At

Here's the public repo in question: https://travis-ci.org/agerwick/raw-sinatra-boilerplate

I integrated codeclimate's test reporter gem as advised here: http://docs.travis-ci.com/user/code-climate/

The error I keep getting is: /home/travis/.rvm/rubies/ruby-2.0.0-p594/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in 'require': cannot load such file -- codeclimate-test-reporter (LoadError)

As you can see from the log below, the codeclimate-test-reporter gem is being installed by Travis CI. I tried running the tests from my local computer with the CODECLIMATE_REPO_TOKEN environment variable set, and here it worked perfectly, updating the code climate test coverage status. Hence, the issue is only on travis.

Any advice on what to try next in order to get Travis CI to require codeclimate-test-reporter properly?

For historical purposes, here's the log from Travis CI:

Using worker: worker-linux-9-1.bb.travis-ci.org:travis-linux-16
system_info
Build system information
Build language: ruby
git.checkout
0.06s$ git clone --depth=50 --branch=master git://github.com/agerwick/raw-sinatra-boilerplate.git agerwick/raw-sinatra-boilerplate
Cloning into 'agerwick/raw-sinatra-boilerplate'...
remote: Counting objects: 223, done.
remote: Compressing objects: 100% (51/51), done.
remote: Total 223 (delta 27), reused 0 (delta 0)
Receiving objects: 100% (223/223), 45.36 KiB | 0 bytes/s, done.
Resolving deltas: 100% (89/89), done.
Checking connectivity... done.
$ cd agerwick/raw-sinatra-boilerplate
$ git checkout -qf d659d86167d5c60f52e4013190ee5fd45dbb4b00
rvm
0.47s$ rvm use 2.0.0 --install --binary --fuzzy
Using /home/travis/.rvm/gems/ruby-2.0.0-p594
$ export BUNDLE_GEMFILE=$PWD/Gemfile
$ ruby --version
ruby 2.0.0p594 (2014-10-27 revision 48167) [x86_64-linux]
$ rvm --version
rvm 1.26.0 (master) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/]
$ bundle --version
Bundler version 1.7.4
$ gem --version
2.4.2
before_install.1
0.01s$ export DISPLAY=:99.0
before_install.2
0.01s$ sh -e /etc/init.d/xvfb start
Starting virtual X frame buffer: Xvfb.
install.bundler
143.23s$ bundle install --jobs=3 --retry=3 --deployment
Fetching gem metadata from https://rubygems.org/.........
Fetching git://github.com/agerwick/rack-minitest.git
Installing mini_portile 0.6.1
Installing mime-types 2.4.3
Installing rack 1.5.2
Installing minitest 5.4.3
Installing docile 1.1.5
Installing json 1.8.1
Installing multi_json 1.10.1
Installing tilt 1.4.1
Using bundler 1.7.4
Installing simplecov-html 0.8.0
Installing rack-test 0.6.2
Installing rack-protection 1.5.3
Installing shotgun 0.9
Installing travis-lint 2.0.0
Installing haml 4.0.5
Installing simplecov 0.9.1
Using rack-minitest 0.0.9 from git://github.com/agerwick/rack-minitest.git (at master)
Installing sinatra 1.4.5
Installing codeclimate-test-reporter 0.4.1
Installing nokogiri 1.6.4.1
Installing xpath 2.0.0
Installing capybara 2.4.4
Installing capybara_minitest_spec 1.0.5
Installing capybara-webkit 1.3.1
Your bundle is complete!
It was installed into ./vendor/bundle
Post-install message from haml:
HEADS UP! Haml 4.0 has many improvements, but also has changes that may break
your application:Installing docile 1.1.5
Installing json 1.8.1
Installing multi_json 1.10.1
Installing tilt 1.4.1
Using bundler 1.7.4
Installing simplecov-html 0.8.0
Installing rack-test 0.6.2
Installing rack-protection 1.5.3
Installing shotgun 0.9
Installing travis-lint 2.0.0
Installing haml 4.0.5
Installing simplecov 0.9.1
Using rack-minitest 0.0.9 from git://github.com/agerwick/rack-minitest.git (at master)
Installing sinatra 1.4.5
Installing codeclimate-test-reporter 0.4.1
Installing nokogiri 1.6.4.1
Installing xpath 2.0.0
Installing capybara 2.4.4
Installing capybara_minitest_spec 1.0.5
Installing capybara-webkit 1.3.1
Your bundle is complete!
It was installed into ./vendor/bundle
Post-install message from haml:
HEADS UP! Haml 4.0 has many improvements, but also has changes that may break
your application:

* Support for Ruby 1.8.6 dropped
* Support for Rails 2 dropped
* Sass filter now always outputs <style> tags
* Data attributes are now hyphenated, not underscored
* html2haml utility moved to the html2haml gem
* Textile and Maruku filters moved to the haml-contrib gem
For more info see:
http://rubydoc.info/github/haml/haml/file/CHANGELOG.md
0.30s$ rake all
/home/travis/.rvm/rubies/ruby-2.0.0-p594/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- codeclimate-test-reporter (LoadError)
  from /home/travis/.rvm/rubies/ruby-2.0.0-p594/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
  from /home/travis/build/agerwick/raw-sinatra-boilerplate/test/spec_helper.rb:5:in `<top (required)>'
  from /home/travis/build/agerwick/raw-sinatra-boilerplate/test/business_logic_test_helper.rb:2:in `require_relative'
  from /home/travis/build/agerwick/raw-sinatra-boilerplate/test/business_logic_test_helper.rb:2:in `<top (required)>'
  from /home/travis/build/agerwick/raw-sinatra-boilerplate/test/business_logic/test_lib_core.rb:1:in `require_relative'
  from /home/travis/build/agerwick/raw-sinatra-boilerplate/test/business_logic/test_lib_core.rb:1:in `<top (required)>'
  from /home/travis/.rvm/rubies/ruby-2.0.0-p594/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
  from /home/travis/.rvm/rubies/ruby-2.0.0-p594/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
  from /home/travis/.rvm/gems/ruby-2.0.0-p594/gems/rake-10.2.2/lib/rake/rake_test_loader.rb:15:in `block in <main>'
  from /home/travis/.rvm/gems/ruby-2.0.0-p594/gems/rake-10.2.2/lib/rake/rake_test_loader.rb:4:in `select'
  from /home/travis/.rvm/gems/ruby-2.0.0-p594/gems/rake-10.2.2/lib/rake/rake_test_loader.rb:4:in `<main>'
rake aborted!
Command failed with status (1): [ruby -I"lib" -I"/home/travis/.rvm/gems/ruby-2.0.0-p594/gems/rake-10.2.2/lib" "/home/travis/.rvm/gems/ruby-2.0.0-p594/gems/rake-10.2.2/lib/rake/rake_test_loader.rb" "test/business_logic/test_lib_core.rb" "test/database_calls/test_availability.rb" "test/acceptance/test_hello.rb" "test/acceptance/test_welcome.rb" "test/requests/test_index.rb" ]
/home/travis/.rvm/gems/ruby-2.0.0-p594/bin/ruby_executable_hooks:15:in `eval'
/home/travis/.rvm/gems/ruby-2.0.0-p594/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => all
(See full trace by running task with --trace)
The command "rake all" exited with 1.
Done. Your build exited with 1.
1

There are 1 answers

1
Piotr Sarnacki On BEST ANSWER

It looks like codeclimate-test-reporter gem can't be loaded at runtime, which seems like a bundler issue.

You should try changing rake all to bundle exec rake all