jejacks0n / teaspoon

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

Teaspoon fails to run on unicorn server #375

Closed sstgithub closed 9 years ago

sstgithub commented 9 years ago

System info: Teaspoon-qunit v1.18 Unicorn v4.8 Ruby 2.2.0 Rails 4.1.0

Teaspoon runs fine from the command line using the default Webrick server but when I change the server to Unicorn, either in the teaspoon-env.rb file to config.server = :unicorn or by using the cli command teaspoon --server unicorn, I get the following error:

Starting the Teaspoon server... /Users/sid/specx/vendor/ruby/2.2.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:inrequire': cannot load such file -- rack/handler/unicorn (LoadError) from /Users/sid/specx/vendor/ruby/2.2.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in block in require' from /Users/sid/specx/vendor/ruby/2.2.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:232:inload_dependency' from /Users/sid/specx/vendor/ruby/2.2.0/gems/activesupport-4.1.0/lib/active_support/dependencies.rb:247:in require' from /Users/sid/specx/vendor/ruby/2.2.0/gems/rack-1.5.3/lib/rack/handler.rb:76:intry_require' from /Users/sid/specx/vendor/ruby/2.2.0/gems/rack-1.5.3/lib/rack/handler.rb:16:in get' from /Users/sid/specx/vendor/ruby/2.2.0/gems/rack-1.5.3/lib/rack/server.rb:268:inserver' from /Users/sid/specx/vendor/ruby/2.2.0/gems/rack-1.5.3/lib/rack/server.rb:264:in start' from /Users/sid/specx/vendor/ruby/2.2.0/gems/teaspoon-1.0.2/lib/teaspoon/server.rb:19:inblock in start'`

(Note that I can use Teaspoon in the browser with Unicorn, this just happens when I try to run Teaspoon with Unicorn from the CLI)

jejacks0n commented 9 years ago

Hmm.. so, there is the ability to run teaspoon against an already running server -- it's not the solution potentially, but gets you a working version in the interim... start the server on whatever port you want, and you can then specify the already running server port in the CLI arguments. You may also want to look at configuring/setting your server (aka server type -- thin, mongrel, etc.) via the CLI or configuration:

https://github.com/modeset/teaspoon/wiki/Teaspoon-Configuration#console-runner-specific

I'd guess you must've set it to unicorn in your configuration? I'm unsure what you're getting by doing that, and so letting it run with something like thin (or even Rack::Server) would probably fix your problem. Any reason you need it to run with unicorn, or is it just improperly configured?

jejacks0n commented 9 years ago

oh, didn't read the issue fully. heh, sorry about that. Yeah, rack doesn't know about unicorn, cause that's not how unicorn and rack interact because of the nature of unicorn. I'd say don't set your configuration to something that doesn't work. ;-P