我正在加速spork 2.3.7應用程序中的「rspecing」。當我在項目的根目錄運行叉勺,我得到:如何知道Spork是否正在運行
(...stuff...)
No server is running
Running specs locally:
Spork is ready and listening on 8989!
然後,如果我運行規範,消息
No server is running
Running specs locally
,如果我跑他們沒有叉勺不會出現出現,不過規格初始速度與沒有Spork一樣慢。在Spork的終端中也不會出現更多輸出。
我的問題是,spork實際運行?如果是這樣,規格是否在那裏運行?最後,如果兩者的答案都是真的,我該如何加速測試?
以下是涉及到的配置文件:
規格/ spec.opts
--colour
--format progress
--loadby mtime
--reverse
--drb
規格/ spec.helper
require 'rubygems'
require 'bundler/setup'
require 'spork'
Spork.prefork do
ENV["RAILS_ENV"] ||= 'test'
require File.expand_path(File.join(File.dirname(__FILE__),'..','config','environment'))
require 'spec/autorun'
require 'spec/rails'
Dir[File.expand_path(File.join(File.dirname(__FILE__),'support','**','*.rb'))].each {|f| require f}
Spec::Runner.configure do |config|
end
end
Spork.each_run do
end
而且,有一個完整的問題,這裏有用'時間'測量的時間:
With Spork:
real 0m39.524s
user 0m5.012s
sys 0m0.912s
沒有叉勺:
real 0m39.576s
user 0m18.537s
sys 0m2.400s
當運行運動--diagnose我得到
- Spork Diagnosis -
-- Summary --
config/boot.rb
config/initializers/inflections.rb
config/initializers/mime_types.rb
config/initializers/new_rails_defaults.rb
config/initializers/site_keys.rb
config/preinitializer.rb
spec/spec_helper.rb
然後,對於
--- config/initializers/inflections.rb ---
--- config/initializers/mime_types.rb ---
--- config/initializers/new_rails_defaults.rb ---
--- config/initializers/site_keys.rb ---
下面的堆棧跟蹤
/var/lib/gems/1.8/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:147:in `load'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:622:in `load_application_initializers'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:621:in `each'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:621:in `load_application_initializers'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:176:in `process'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:113:in `send'
/var/lib/gems/1.8/gems/rails-2.3.8/lib/initializer.rb:113:in `run_without_spork'
/var/lib/gems/1.8/gems/spork-0.8.4/lib/spork/app_framework/rails.rb:18:in `run'
config/environment.rb:15
spec/spec_helper.rb:14:in `require'
spec/spec_helper.rb:14
/var/lib/gems/1.8/gems/spork-0.8.4/bin/../lib/spork.rb:23:in `prefork'
規格/ spec_helper.rb:6
就像童謠說:「...和spork逃跑了foon。」 ' non-sequitur>' – ewall 2010-10-08 19:42:53
'ps -ex | grep spork' – 2011-06-22 18:05:09