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

Regular test output swallowed #22

Closed
alexkwolfe opened this issue Nov 20, 2013 · 4 comments
Closed

Regular test output swallowed #22

alexkwolfe opened this issue Nov 20, 2013 · 4 comments

Comments

@alexkwolfe
Copy link

It appears as though regular test output is swallowed when using the reporter in a standard Rails app.

Please see the following sample app for a simple demonstration: https://github.com/alexkwolfe/codeclimate-issue

@brynary
Copy link
Member

brynary commented Nov 20, 2013

Thanks for the reproduction case! I believe I've found the issue. This code:

if ENV['CODECLIMATE_REPO_TOKEN']
  require 'codeclimate-test-reporter'
  CodeClimate::TestReporter.start
end

Needs to go at the very top of test_helper.rb. I'm not sure why the output issue is occurring with it's current placement, but that would explain why we haven't seen this before. The CC gem is quite simple so I imagine it's something in the SimpleCov gem under the hood.

Let us know if you have any issues with that.

Best,
-Bryan

@brynary brynary closed this as completed Nov 20, 2013
@benjaminoakes
Copy link

We noticed today that our Travis CI build for acceptance tests was failing, but it was incorrectly reporting success (exit code 0). This happened when using the CodeCimate gem and running rspec with a --tag option.

Strange, but we've disabled the coverage reporting until we figure out why that is.


Details

With CodeClimate disabled and failing specs:

$ bundle exec rspec ./spec/features/eula_spec.rb --tag '@type:feature'; echo $?
[...]
1

With CodeClimate enabled and failing specs:

$ bundle exec rspec ./spec/features/eula_spec.rb --tag '@type:feature'; echo $?
[...]
0

The beginning of our spec_helper.rb is:

begin
  require "codeclimate-test-reporter"
  CodeClimate::TestReporter.start
rescue LoadError
end

Disabling means that we commented out that block of code.

Version from our Gemfile.lock:

codeclimate-test-reporter (0.3.0)

And for completeness: we're using Ruby 2.1.0

@jasonroelofs
Copy link

@benjaminoakes This is a bug with SimpleCov and tracked here: simplecov-ruby/simplecov#269

You'll want to force SimpleCov 0.7.1 in your Gemfile for the time being.

@benjaminoakes
Copy link

@jasonroelofs Thanks for looking into it. We will try the change you suggest. I'd recommend making the change in ruby-test-reporter itself and releasing a new gem, since many users probably don't realize this is happening.

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

4 participants