jejacks0n / teaspoon

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

Teaspoon fails intermittently on CircleCI #303

Closed sashafklein closed 9 years ago

sashafklein commented 9 years ago

Teaspoon is failing on CircleCI intermittently, more often than not. I added the following to my circle.yml file, per the documentation:

test:
  post:
    - bundle exec teaspoon

When it fails, I get the following stack trace:

bundle exec teaspoon
Starting the Teaspoon server...
Teaspoon running default suite at http://127.0.0.1:52670/teaspoon/default
Error: ActionController::RoutingError: No route matches [GET] "/teaspoon/default"
/home/ubuntu/planit/vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
/home/ubuntu/planit/vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
/home/ubuntu/planit/vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/rack/logger.rb:38:in `call_app'
/home/ubuntu/planit/vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/rack/logger.rb:20:in `block in call'
/home/ubuntu/planit/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/tagged_logging.rb:68:in `block in tagged'
/home/ubuntu/planit/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/tagged_logging.rb:26:in `tagged'
/home/ubuntu/planit/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/tagged_logging.rb:68:in `tagged'
/home/ubuntu/planit/vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/rack/logger.rb:20:in `call'
/home/ubuntu/planit/vendor/bundle/ruby/2.2.0/gems/request_store-1.1.0/lib/request_store/middleware.rb:8:in `call'
/home/ubuntu/planit/vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/request_id.rb:21:in `call'
/home/ubuntu/planit/vendor/bundle/ruby/2.2.0/gems/rack-1.6.0/lib/rack/methodoverride.rb:22:in `call'
/home/ubuntu/planit/vendor/bundle/ruby/2.2.0/gems/rack-1.6.0/lib/rack/runtime.rb:18:in `call'
/home/ubuntu/planit/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
/home/ubuntu/planit/vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/static.rb:113:in `call'
/home/ubuntu/planit/vendor/bundle/ruby/2.2.0/gems/rack-1.6.0/lib/rack/sendfile.rb:113:in `call'
/home/ubuntu/planit/vendor/bundle/ruby/2.2.0/gems/airbrake-4.1.0/lib/airbrake/user_informer.rb:16:in `_call'
/home/ubuntu/planit/vendor/bundle/ruby/2.2.0/gems/airbrake-4.1.0/lib/airbrake/user_informer.rb:12:in `call'
/home/ubuntu/planit/vendor/bundle/ruby/2.2.0/gems/rack-timeout-0.2.0/lib/rack/timeout.rb:108:in `call'
/home/ubuntu/planit/vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/engine.rb:518:in `call'
/home/ubuntu/planit/vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/application.rb:164:in `call'
/home/ubuntu/planit/vendor/bundle/ruby/2.2.0/gems/rack-1.6.0/lib/rack/handler/webrick.rb:89:in `service'
/home/ubuntu/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service'
/home/ubuntu/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run'
/home/ubuntu/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread'
  # http://127.0.0.1:52670/teaspoon/default?reporter=Console:1

Failed to load: http://127.0.0.1:52670/teaspoon/default?reporter=Console bundle exec teaspoon returned exit code 1

I'm running Rails 4.2, with a very-close-to-vanilla setup of Teaspoon:

teaspoon_env.rb

# Set RAILS_ROOT and load the environment if it's not already loaded.
unless defined?(Rails)
  ENV["RAILS_ROOT"] = File.expand_path("../../", __FILE__)
  require File.expand_path("../../config/environment", __FILE__)
end

Teaspoon.configure do |config|

  config.suite do |suite|

    suite.use_framework :jasmine, "1.3.1"

  end

  config.coverage do |coverage|

  end

end

Not sure if it's related to this issue. Seems not.

coderjonny commented 9 years ago

I had to manually mount teaspoon route in routes.rb for a custom "/jasmine" route: but not sure if that's necessary for rails 4. I'm still on rails 3. And not sure if that's necessary for the default. You can give it a try though.

if Rails.env.test? || Rails.env.development?
  mount Teaspoon::Engine => "/jasmine"
end

teaspoon_env.rb:

Teaspoon.configure do |config|

  # Determines where the Teaspoon routes will be mounted. Changing this to "/jasmine" would allow you to browse to
  # `http://localhost:3000/jasmine` to run your tests.
  config.mount_at = "/jasmine"