6

I am trying to run a rake test and I am unable to do it. I keep getting this error: ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations" rake aborted! LoadError: cannot load such file -- rails/performance_test_help

I would greatly appreciate any insight.

WNW
  • 95
  • 1
  • 9

2 Answers2

17

rails/performance_test_help is an old test helper that was used up to Rails 3.2 for performance testing. It was supposed to be required by performance test cases.

The file was remove in Rails 4 since the performance testing feature was extracted from Rails core and moved to the rails-perftest gem.

If you are using Rails 4, make sure the gem is listed in your Gemfile, and it's correctly installed. If you don't use the feature, simply drop the performance test cases.

To lookup the offending file, simply search your project codebase for any require 'rails/performance_test_help' statement, and either fix the issue or remove the offending file if you don't need the performance test case.

Simone Carletti
  • 173,507
  • 49
  • 363
  • 364
  • That helps explain the issue, but I am still having trouble implementing the solution. I installed the rails-perftest gem, but that did not solve the problem. – WNW Feb 14 '15 at 18:56
  • You are correct in the assumption that I don't really know what they are; I am not an expert, nor a novice, I am pretty new to Rails, so I apologize for my lack of knowledge. I would love to wipe out the performance test out if I knew exactly where to look for them. – WNW Feb 14 '15 at 19:09
  • Follow my instructions, search your codebase for that string, and delete the test case file. Also read the articles I linked to have an idea how a performance test case looks like. I can't tell you exactly what to delete, because the files can have any name. – Simone Carletti Feb 14 '15 at 19:29
  • I figured it out. I was not deleting the entire file, just the line of code in the file. When I removed the file itself everything worked. Thanks for you help, sorry for trouble. – WNW Feb 14 '15 at 19:49
  • If you remove that line, an attempt to run the file will likely cause a crash. If you don't use the file, delete it entirely. – Simone Carletti Feb 14 '15 at 19:50
  • When I search for performance_test_help in the code, i get no results... Still getting the error. – Rick Runowski Oct 07 '16 at 18:23
1

run rake db:migrate RAILS_ENV=test before running rake test. Hope this solves your problem.

sansarp
  • 1,446
  • 11
  • 18