Skip to content

Conversation

@jonseaberg
Copy link

rake test failed with the following error:

W, [2017-03-19T08:04:17.060025 #39975]  WARN -- :       This usage of the Code Climate Test Reporter is now deprecated. Since version
      1.0, we now require you to run `SimpleCov` in your test/spec helper, and then
      run the provided `codeclimate-test-reporter` binary separately to report your
      results to Code Climate.

      More information here: https://github.com/codeclimate/ruby-test-reporter/blob/master/README.md
  • Followed instructions for setting up codeclimate for v1.
  • Also addressed deprecation warnings Use assert_nil if expecting nil from ...

`rake test` failed with the following error:
```
W, [2017-03-19T08:04:17.060025 #39975]  WARN -- :       This usage of the Code Climate Test Reporter is now deprecated. Since version
      1.0, we now require you to run `SimpleCov` in your test/spec helper, and then
      run the provided `codeclimate-test-reporter` binary separately to report your
      results to Code Climate.

      More information here: https://github.com/codeclimate/ruby-test-reporter/blob/master/README.md
```

- Followed instructions for setting up codeclimate for v1.
- Also addressed deprecation warnings `Use assert_nil if expecting nil from ...`
 Try removing before install step that is failing.
@jonseaberg
Copy link
Author

@mpapis Sorry to bother you with this, but I am having some trouble getting the tests to run locally and in CI. I will tell my story below.

First I cloned the repo, bundle installed, and ran rake. The test run failed with the following message:

W, [2017-03-19T08:04:17.060025 #39975]  WARN -- :       This usage of the Code Climate Test Reporter is now deprecated. Since version
      1.0, we now require you to run `SimpleCov` in your test/spec helper, and then
      run the provided `codeclimate-test-reporter` binary separately to report your
      results to Code Climate.

      More information here: https://github.com/codeclimate/ruby-test-reporter/blob/master/README.md

First I tried pinning the version of codeclimate-test-reporter to be < 1.0 where the breaking change was. That removed the error and I was able to run the tests. I was not sure if this was the right path so I removed the version from the Gemfile and followed the upgrade instructions on code climate. The tests ran after this so I pushed up what I had.

My question here is how do you want to handle the version of codeclimate-test-reporter. Should I

  • move it out of the Gemfile and into the gem spec as dev dependency with a version
  • leave it in the Gemfile without a version and add a Gemfile.lock so the version is pinned until explicitly updated
  • leave it in the Gemfile and pin it to a version there
  • some other option I have not listed

The first build on travis (https://travis-ci.org/oauth-xx/oauth-ruby/jobs/212709467) failed all ruby versions with:

Error running 'env GEM_HOME=/home/travis/.rvm/gems/ruby-2.3.0@global GEM_PATH= /home/travis/.rvm/rubies/ruby-2.3.0/bin/ruby -d /home/travis/.rvm/src/rubygems-dd3e10136ae73051a7888955414eea246e85d00b/setup.rb --no-ri --no-rdoc',
showing last 15 lines of /home/travis/.rvm/log/1489938160_ruby-2.3.0/rubygems.install.log
[2017-03-19 15:42:42] /home/travis/.rvm/rubies/ruby-2.3.0/bin/ruby
current path: /home/travis/.rvm/src/rubygems-dd3e10136ae73051a7888955414eea246e85d00b
GEM_HOME=/home/travis/.rvm/gems/ruby-2.3.0
PATH=/home/travis/.rvm/gems/ruby-2.3.0/bin:/home/travis/.rvm/gems/ruby-2.3.0@global/bin:/home/travis/.rvm/rubies/ruby-2.3.0/bin:/home/travis/.rvm/bin:/home/travis/bin:/home/travis/.local/bin:/home/travis/.gimme/versions/go1.4.2.linux.amd64/bin:/usr/local/phantomjs/bin:/home/travis/.nvm/v0.10.36/bin:./node_modules/.bin:/usr/local/maven-3.2.5/bin:/usr/local/clang-3.4/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/jvm/java-8-oracle/bin:/usr/lib/jvm/java-8-oracle/db/bin:/usr/lib/jvm/java-8-oracle/jre/bin
GEM_PATH=/home/travis/.rvm/gems/ruby-2.3.0:/home/travis/.rvm/gems/ruby-2.3.0@global
command(8): env GEM_HOME=/home/travis/.rvm/gems/ruby-2.3.0@global GEM_PATH= /home/travis/.rvm/rubies/ruby-2.3.0/bin/ruby -d /home/travis/.rvm/src/rubygems-dd3e10136ae73051a7888955414eea246e85d00b/setup.rb --no-ri --no-rdoc
Exception `LoadError' at /home/travis/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems.rb:1241 - cannot load such file -- rubygems/defaults/operating_system
Exception `LoadError' at /home/travis/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems.rb:1250 - cannot load such file -- rubygems/defaults/ruby
Exception `LoadError' at /home/travis/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55 - cannot load such file -- did_you_mean
ERROR:  While executing gem ... (Errno::ENOENT)
    No such file or directory @ dir_chdir - bundler/lib
The command "rvm rubygems master --force" failed and exited with 1 during .

I did some googling but not much turned up for the error message so I tried removing the step that was causing the error before_install: rvm rubygems master --force. The next build only ruby 2.2 passed I assume because that is the preloaded ruby or something. So I looked at the defaults for travis and since we have a gemfile thought we could remove the install step and also saw the default rake task will run the tests and travis runs rake by default so I removed the custom steps to see what would happen. All builds except the ruby 2.0 passed. Checking that build (https://travis-ci.org/oauth-xx/oauth-ruby/builds/212731232) it looks like some version of nokogiri is getting included that is not compatible with ruby 2.0. Figuring it was not an option to stop supporting ruby 2.0 just so we can run tests I rolled back the build changes I made. Then I went with the first option of pinning codeclimate-test-reporter to a version before 1.0 since that was the setup of the last successful build. The build failed again with the error above. I am wondering how you would like to address this.

  • pin nokogiri to a version that supports ruby 2.0
  • stop supporting ruby 2.0
  • some other option I have not listed

Sorry for the long story. I just wanted to get all the info up here. I am happy to go any route that works for you.

@ch1ago
Copy link
Member

ch1ago commented Mar 20, 2017

Hey @jcamenisch, nice catch.

Sorry I haven't showed up earlier. I've been busy.

Does #140 fix all you wanted? 😄

@jonseaberg
Copy link
Author

@thejamespinto Fantastic! Thanks! Going to close this one.

@jonseaberg jonseaberg closed this Mar 20, 2017
@jonseaberg jonseaberg deleted the code-climate-upgrade-to-v1 branch March 20, 2017 20:20
@ch1ago
Copy link
Member

ch1ago commented Mar 21, 2017

Glad I could help : )

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

Successfully merging this pull request may close these issues.

2 participants