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

Issue with ci_reporter and Rails 4 #106

Closed elixer34 closed 10 years ago

elixer34 commented 11 years ago

I've created a new Rails 4 app and would like to use ci_reporter for testing. However, after running 'bin/rake ci:setup:minitest test', my tests pass but the report files are not being generated. When I roll my app back to Rails 3.2.12 it seems to work fine. Is there a known issue with Rails 4?

simonharrer commented 11 years ago

I do have the same issue. Have not found a solution yet.

pbendersky commented 11 years ago

I'm using minitest-reporters as a workaround.

Just include it on your Gemfile and add the following to your test_helper.rb:

require 'minitest/reporters'
MiniTest::Reporters.use! [MiniTest::Reporters::DefaultReporter.new,
                          MiniTest::Reporters::JUnitReporter.new]
simonharrer commented 11 years ago

Perfect. This works flawlessly with my rails4 app! Thanks.

TomNaessens commented 10 years ago

Same issue here (Rails 4.0.3)

ericfrancis commented 10 years ago

Same issue. Thank you for the fix @pbendersky.

agoodno commented 10 years ago

I'm seeing the same issue with Test::Unit. Does anyone know of a fix yet for that? I'm willing to dig deeper if someone could get me started on where to look. I'm getting no output and no error so I'm not sure where to start.

retoo commented 10 years ago

Got it working with:

RAILS_ENV=test ruby -rci/reporter/rake/minitest_loader -S rake test

which is more or less: require "ci/reporter/rake/minitest_loader"

agoodno commented 10 years ago

Thanks for the tip retoo. I initially put require "ci/reporter/rake/minitest_loader" in test_helper.rb which caused it to run locally too and I didn't mind that until I noticed it swallowing up my debug output statements (puts etc). Now, I'm using your command to have only jenkins run the ci_reporter xmls.

shepmaster commented 10 years ago

We are in the process of cleaning out old issues. Specifically, the next version of CI::Reporter is only going to support Minitest 5.0.0 and above. If this issue still applies to this version, please let us know, otherwise we're going to close this issue to focus on current problems. Thanks for your report!

shepmaster commented 10 years ago

Closing due to inactivity.

bluehallu commented 10 years ago

Guys, got it working with current version by hooking to the test rake task instead of minitest like:

task :test => 'ci:setup:minitest'