jejacks0n / teaspoon

Teaspoon: Javascript test runner for Rails. Use Selenium, BrowserStack, or PhantomJS.
1.43k stars 243 forks source link

eager_load=true / cache_classes=true issues #226

Closed bradrobertson closed 10 years ago

bradrobertson commented 10 years ago

We're playing with teaspoon in both our main line dev branch (Rails 3) and an experimental rails 4 branch.

In Rails 3 if we have config.cache_classes=true we get the exception below. On Rails 4 we can have config.cache_classes=true but if we set config.eager_load=true in the test env, we also get the exception below.

If we change this to not cache the classes in Rails3 (or eager load on rails 4), then it works fine. Any idea?

± br+er |feature/rails3-teaspoon ✗| → RAILS_ENV=test bundle exec teaspoon
Starting the Teaspoon server...
Teaspoon running default suite at http://127.0.0.1:58340/teaspoon/default
Error: ActionController::RoutingError: No route matches [GET] "/teaspoon/default"
/Users/dev/.rvm/gems/ruby-2.0.0-p353@influitive/gems/actionpack-3.2.17/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
/Users/dev/.rvm/gems/ruby-2.0.0-p353@influitive/gems/rollbar-0.12.17/lib/rollbar/middleware/rails/show_exceptions.rb:19:in `call_with_rollbar'
/Users/dev/.rvm/gems/ruby-2.0.0-p353@influitive/gems/actionpack-3.2.17/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
/Users/dev/.rvm/gems/ruby-2.0.0-p353@influitive/gems/railties-3.2.17/lib/rails/rack/logger.rb:32:in `call_app'
/Users/dev/.rvm/gems/ruby-2.0.0-p353@influitive/gems/railties-3.2.17/lib/rails/rack/logger.rb:16:in `block in call'
/Users/dev/.rvm/gems/ruby-2.0.0-p353@influitive/gems/activesupport-3.2.17/lib/active_support/tagged_logging.rb:22:in `tagged'
/Users/dev/.rvm/gems/ruby-2.0.0-p353@influitive/gems/railties-3.2.17/lib/rails/rack/logger.rb:16:in `call'
/Users/dev/.rvm/gems/ruby-2.0.0-p353@influitive/gems/actionpack-3.2.17/lib/action_dispatch/middleware/request_id.rb:22:in `call'
/Users/dev/.rvm/gems/ruby-2.0.0-p353@influitive/gems/rack-1.4.5/lib/rack/methodoverride.rb:21:in `call'
/Users/dev/.rvm/gems/ruby-2.0.0-p353@influitive/gems/rack-1.4.5/lib/rack/runtime.rb:17:in `call'
/Users/dev/.rvm/gems/ruby-2.0.0-p353@influitive/gems/activesupport-3.2.17/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
/Users/dev/.rvm/gems/ruby-2.0.0-p353@influitive/gems/rack-1.4.5/lib/rack/lock.rb:15:in `call'
/Users/dev/.rvm/gems/ruby-2.0.0-p353@influitive/gems/actionpack-3.2.17/lib/action_dispatch/middleware/static.rb:63:in `call'
/Users/dev/.rvm/gems/ruby-2.0.0-p353@influitive/gems/rack-timeout-0.0.4/lib/rack/timeout.rb:16:in `block in call'
/Users/dev/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/timeout.rb:66:in `timeout'
/Users/dev/.rvm/gems/ruby-2.0.0-p353@influitive/gems/rack-timeout-0.0.4/lib/rack/timeout.rb:16:in `call'
/Users/dev/.rvm/gems/ruby-2.0.0-p353@influitive/gems/railties-3.2.17/lib/rails/engine.rb:484:in `call'
/Users/dev/.rvm/gems/ruby-2.0.0-p353@influitive/gems/railties-3.2.17/lib/rails/application.rb:231:in `call'
/Users/dev/.rvm/gems/ruby-2.0.0-p353@influitive/gems/rack-1.4.5/lib/rack/handler/webrick.rb:59:in `service'
/Users/dev/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
/Users/dev/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
/Users/dev/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
  # http://127.0.0.1:58340/teaspoon/default?reporter=Console:1

Failed to load: http://127.0.0.1:58340/teaspoon/default?reporter=Console
JohnRiv commented 10 years ago

Why are you setting eager_load=true in test? My understanding was the recommendation is to have that set to false in test

bradrobertson commented 10 years ago

ya i didn't really understand eager_load to begin with. we've fixed it to set it to false and it works