[英]rails performance test is failing
Simple performance test, I have installed ruby-prof and no other gems are missing, 简单的性能测试,我已经安装了ruby-prof,没有其他宝石丢失,
rake test:profile returns the following error. rake test:profile返回以下错误。
the test is simply. 测试很简单。
require 'test_helper'
require 'performance_test_help'
# Profiling results for each test method are written to tmp/performance.
class BrowsingTest < ActionController::PerformanceTest
def test_homepage
get '/'
end
def test_post_show_page
get '/posts/first-post'
end
end
line 18 in environment.rb is simple.. 环境.rb中的第18行很简单..
config.logger = CustomLogger.new(config.log_path,
config.log_level)
here is the custom logger http://pastie.org/1224832 Why is it coughing here? 这是自定义记录器http://pastie.org/1224832为什么在这里咳嗽?
This is REE 1.8.7 on rails 2.3.5 这是轨道2.3.5上的REE 1.8.7
** Invoke test:profile (first_time)
** Invoke db:test:prepare (first_time)
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:abort_if_pending_migrations
** Execute db:test:prepare
** Invoke db:test:load (first_time)
** Invoke db:test:purge (first_time)
** Invoke environment
** Execute db:test:purge
** Execute db:test:load
** Invoke db:schema:load (first_time)
** Invoke environment
** Execute db:schema:load
** Execute test:profile
/usr/local/bin/ruby -I"lib:test" "/usr/local/lib/ruby/gems/1.8/gems/
rake-0.8.7/lib/rake/rake_test_loader.rb" "test/performance/
browsing_test.rb"
/usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/
active_support/dependencies.rb:105:in `const_missing': uninitialized
constant ActiveSupport::BufferedLogger::FileUtils (NameError)
from /usr/local/lib/ruby/gems/1.8/gems/activesupport-2.3.5/lib/
active_support/buffered_logger.rb:51:in `initialize'
from /home/username/Apps/app_name/config/environment.rb:18:in `new'
from /home/username/Apps/app_name/config/environment.rb:18
from /usr/local/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:
111:in `run'
from /home/username/Apps/app_name/config/environment.rb:10
from ./test/test_helper.rb:2:in `require'
from ./test/test_helper.rb:2
from ./test/performance/browsing_test.rb:1:in `require'
from ./test/performance/browsing_test.rb:1
from /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/
rake_test_loader.rb:5:in `load'
from /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/
rake_test_loader.rb:5
from /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/
rake_test_loader.rb:5:in `each'
from /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.7/lib/rake/
rake_test_loader.rb:5
rake aborted!
Command failed with status (1): [/usr/local/bin/ruby -I"lib:test" "/
usr/loc...]
Nevermind, turns out I had to run the profile test with an enviornment variable like.. 没关系,事实证明,我必须使用环境变量(如..)运行配置文件测试。
rake test:profile RAILS_ENV=development 抽水测试:profile RAILS_ENV =开发
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.