Rubymine Test Runner Tab not reporting test status
3 人关注
Hello,
Using RubyMine to run a test suite, and althogh the test will run, the test runner will not show any progress, and the left-hand pane will not show any test nodes and what their status is. It just reports that "Test framework quit unexpectally". Attached is a screen shot.
Also, below is the full output, in case that helps as well. I am also using Rails 4 on JRuby 1.7.9 in 2.0 mode.
Thanks,
-Robert
/Users/robert/Source/jruby-1.7.9/bin/jruby --2.0 -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/robert/Development/ruby/beast/bin/rake test
Testing started at 10:10 PM ...
Run options: --seed 17010
# Running tests:
....
Finished tests in 0.058000s, 68.9655 tests/s, 68.9655 assertions/s.
4 tests, 4 assertions, 0 failures, 0 errors, 0 skips
Process finished with exit code 0
Attachment(s):
Screen Shot 2013-12-18 at 10.10.26 PM.png
请先登录再写评论。
Hi,
most likely you are using minitest and thus you need to use minitest-reporters to get test statuses in RubyMine (see http://www.jetbrains.com/ruby/webhelp/minitest.html for more details)
Hope this helps, Oleg.
Hi Oleg,
Yep, that fixed my problem, Thanks!
-Robert
I'm having the same problem, and I found that page, but I still can't get it to work.
In my gemfile, I added:
group(:test) do
gem 'minitest'
gem 'minitest-reporters', '>= 0.5.0'
end
This gives me gem versions (from my gemfile.lock):
minitest (4.7.5)
minitest-reporters (0.14.23)
My version of activesupport (4.0.0) doesn't seem to support minitest versions above 5, so that 4.7.5 seems to be the latest I can use.
If I add the suggested code:
def setup
MiniTest::Reporters.use!
super
end
to my ActiveSupport::TestCase definition in test_helpers.rb, then trying to run the tests in Rubymine throws without running any tests:
/Library/Ruby/Gems/2.0.0/gems/minitest-reporters-0.14.23/lib/minitest/reporters/rubymine_reporter.rb:95:in `before_test': undefined method `create_test_started' for nil:NilClass (NoMethodError)
on this line:
log(@message_factory.create_test_started(test, minitest_test_location(fqn)))
I'm going to guess that the problem is that the method before_suites, which includes the line:
set_message_factory(Rake::TeamCity::MessageFactory)
doesn't appear to be getting called, but I haven't been able to figure out why yet.
If I add a slightly modified version of the suggested older version code:
def setup
MiniTest::Unit.runner = MiniTest::ReporterRunner.new
if ENV["RM_INFO"] || ENV["TEAMCITY_VERSION"]
MiniTest::Unit.runner.reporters << MiniTest::Reporters::RubyMineReporter.new
else
MiniTest::Unit.runner.reporters << MiniTest::Reporters::ProgressReporter.new
end
super
end
Then the tests at least run, but I still get 'Test framework quit unexpectedly'
Hi,
you need to initialize minitest-reporters before minitest starts tests' execution thus setup is too late to do this.
Hope this helps, Oleg.
Ah, I got it now. Correct test_helper.rb is:
ENV["RAILS_ENV"] ||= "test"
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
require 'minitest/reporters'
class ActiveSupport::TestCase
ActiveRecord::Migration.check_pending!
fixtures :all
MiniTest::Reporters.use!
end