3
votes

I am trying to use RubyMine to run the tests in an existing project. Unfortunately, whenever I attempt to do so I receive the message that No tests were found and the bottom of test console output I see the message:

Errors running test:units and test:functionals!
Empty test suite.

Process finished with exit code 1

I have tried running the tests with and without the command
-e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) but haven't tweaked the default test configuration beyond that. Below is the current configuration as a reference:

RubyMine Run/Debug Configuration

Full dump of test console from within RubyMine:

C:\Ruby187\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) C:\Ruby187\bin/rake test
Testing started at 1:41 PM ...
(in C:/CodeMetrics/2nd/cmusv)
C:/Ruby187/bin/ruby.exe -I"lib;test" "C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/unit/course_number_test.rb" "test/unit/course_test.rb" "test/unit/curriculum_comment_test.rb" "test/unit/curriculum_comment_type_test.rb" "test/unit/effort_log_line_item_test.rb" "test/unit/effort_log_mailer_test.rb" "test/unit/effort_log_template_test.rb" "test/unit/effort_log_test.rb" "test/unit/google_apps_test.rb" "test/unit/page_test.rb" "test/unit/paper_test.rb" "test/unit/person_test.rb" "test/unit/project_test.rb" "test/unit/project_type_test.rb" "test/unit/rss_feed_test.rb" "test/unit/scotty_dog_saying_test.rb" "test/unit/task_type_test.rb" "test/unit/team_test.rb" "test/unit/time_machine_test.rb" "test/unit/user_test.rb" 
C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rails-2.3.4/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010.  Use #requirement
C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:440:in `load_missing_constant': uninitialized constant Test::Unit::UI::SILENT (NameError)
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:80:in `rake_original_const_missing'
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2503:in `const_missing'
    from C:/Ruby187/lib/ruby/gems/1.8/gems/test-unit-1.2.3/lib/test/unit/autorunner.rb:47
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require'
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require'
    from C:\Program Files (x86)\JetBrains\RubyMine 97.39/rb/testing\patch\testunit/test/unit/autorunner.rb:24
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require'
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require'
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/test-unit-2.1.1/lib/test/unit.rb:2
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require'
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require'
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/integrations/test_unit.rb:1
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require'
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require'
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda.rb:8
    from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:64:in `require'
    from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:64:in `require'
    from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:62:in `each'
    from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:62:in `require'
    from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:51:in `each'
    from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:51:in `require'
    from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler.rb:112:in `require'
    from C:/CodeMetrics/2nd/cmusv/config/boot.rb:43:in `load_gems'
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rails-2.3.4/lib/initializer.rb:164:in `process'
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in `send'
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in `run'
    from C:/CodeMetrics/2nd/cmusv/config/environment.rb:17
    from ./test/test_helper.rb:2:in `require'
    from ./test/test_helper.rb:2
    from ./test/unit/course_number_test.rb:1:in `require'
    from ./test/unit/course_number_test.rb:1
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `load'
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `each'
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5
C:/Ruby187/bin/ruby.exe -I"lib;test" "C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb" "test/functional/courses_controller_test.rb" "test/functional/course_numbers_controller_test.rb" "test/functional/curriculum_comments_controller_test.rb" "test/functional/curriculum_comment_types_controller_test.rb" "test/functional/effort_logs_controller_test.rb" "test/functional/effort_log_line_items_controller_test.rb" "test/functional/effort_reports_controller_test.rb" "test/functional/mailing_lists_controller_test.rb" "test/functional/pages_controller_test.rb" "test/functional/papers_controller_test.rb" "test/functional/people_controller_test.rb" "test/functional/projects_controller_test.rb" "test/functional/project_types_controller_test.rb" "test/functional/rss_feeds_controller_test.rb" "test/functional/scotty_dog_sayings_controller_test.rb" "test/functional/sessions_controller_test.rb" "test/functional/system_controller_test.rb" "test/functional/task_types_controller_test.rb" "test/functional/teams_controller_test.rb" "test/functional/users_controller_test.rb" "test/functional/welcome_controller_test.rb" 
C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rails-2.3.4/lib/rails/gem_dependency.rb:119:Warning: Gem::Dependency#version_requirements is deprecated and will be removed on or after August 2010.  Use #requirement
C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:440:in `load_missing_constant': uninitialized constant Test::Unit::UI::SILENT (NameError)
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:80:in `rake_original_const_missing'
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2503:in `const_missing'
    from C:/Ruby187/lib/ruby/gems/1.8/gems/test-unit-1.2.3/lib/test/unit/autorunner.rb:47
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require'
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require'
    from C:\Program Files (x86)\JetBrains\RubyMine 97.39/rb/testing\patch\testunit/test/unit/autorunner.rb:24
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require'
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require'
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/test-unit-2.1.1/lib/test/unit.rb:2
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require'
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require'
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda/integrations/test_unit.rb:1
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require'
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:158:in `require'
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/shoulda-2.11.3/lib/shoulda.rb:8
    from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:64:in `require'
    from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:64:in `require'
    from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:62:in `each'
    from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:62:in `require'
    from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:51:in `each'
    from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:51:in `require'
    from C:/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler.rb:112:in `require'
    from C:/CodeMetrics/2nd/cmusv/config/boot.rb:43:in `load_gems'
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rails-2.3.4/lib/initializer.rb:164:in `process'
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in `send'
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in `run'
    from C:/CodeMetrics/2nd/cmusv/config/environment.rb:17
    from ./test/test_helper.rb:2:in `require'
    from ./test/test_helper.rb:2
    from ./test/functional/courses_controller_test.rb:1:in `require'
    from ./test/functional/courses_controller_test.rb:1
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `load'
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `each'
    from C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5
C:/Ruby187/bin/ruby.exe -I"lib;test" "C:/CodeMetrics/2nd/cmusv/autotest-growl/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb"  
Errors running test:units and test:functionals!
Empty test suite.

Process finished with exit code 1

What's the difference between running from the command line and from within RubyMine?

2

2 Answers

1
votes

It looks like this may have something to do with the environment rubymine sets up (C:/CodeMetrics/2nd/cmusv/) and the latest test-unit gem's incompatibility with Rails 2.x. If you didn't specify a version of the gem to install, that's likely the culprit (See discussion here).

Try reverting the test-unit gem back to 1.2.3 in your project's configuration.

0
votes

What worked for me was REMOVING the Environment variable "RAILS_ENV=test". After that everything was great!

RubyMine v-3.2.4 & v-4.0Beta RM-112.49

Ruby 1.9.3 and Ruby 1.9.2