diff options
author | Yves Senn <yves.senn@gmail.com> | 2013-06-27 12:55:36 -0700 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2013-06-27 12:55:36 -0700 |
commit | 0a55bd7c6bdc4c3022cec858e341f7561ec8554b (patch) | |
tree | 90dc22392fdcd324a9d50961577573abdb5bd53b /railties | |
parent | 63d4894a58825e9d1fb520ec6ac663e4d8529596 (diff) | |
parent | b47f8d035ec6a38a69eb5b3bdb1e27bb40e574c7 (diff) | |
download | rails-0a55bd7c6bdc4c3022cec858e341f7561ec8554b.tar.gz rails-0a55bd7c6bdc4c3022cec858e341f7561ec8554b.tar.bz2 rails-0a55bd7c6bdc4c3022cec858e341f7561ec8554b.zip |
Merge pull request #9173 from senny/backport_perftest_fix
Backport rails/rails-perftest#2 to fix rake test:benchmark
Diffstat (limited to 'railties')
-rw-r--r-- | railties/CHANGELOG.md | 11 | ||||
-rw-r--r-- | railties/lib/rails/commands/benchmarker.rb | 4 | ||||
-rw-r--r-- | railties/lib/rails/commands/profiler.rb | 1 | ||||
-rw-r--r-- | railties/lib/rails/test_unit/testing.rake | 7 |
4 files changed, 19 insertions, 4 deletions
diff --git a/railties/CHANGELOG.md b/railties/CHANGELOG.md index 4bb2ec4618..43aed3f0e7 100644 --- a/railties/CHANGELOG.md +++ b/railties/CHANGELOG.md @@ -1,5 +1,11 @@ ## unreleased ## +* Fix bugs that crashed `rake test:benchmark`, `rails profiler` and + `rails benchmarker`. + Fixes #4938. + + *Yves Senn* + * Add support for runner hook. Backport #7695. @@ -21,6 +27,11 @@ * No changes. +* Fix launching performance tests through rake `test:benchmark`. + Fixes #4938. + Backport rails/rails-perftest#2. + + *Dmitry Vorotilin + Yves Senn* ## Rails 3.2.11 (Jan 8, 2013) ## diff --git a/railties/lib/rails/commands/benchmarker.rb b/railties/lib/rails/commands/benchmarker.rb index b745b45e17..a2d92f8956 100644 --- a/railties/lib/rails/commands/benchmarker.rb +++ b/railties/lib/rails/commands/benchmarker.rb @@ -2,9 +2,8 @@ require 'optparse' require 'rails/test_help' require 'rails/performance_test_help' -ARGV.push('--benchmark') # HAX +ENV["BENCHMARK_TESTS"] = '1' require 'active_support/testing/performance' -ARGV.pop def options options = {} @@ -31,4 +30,5 @@ class BenchmarkerTest < ActionDispatch::PerformanceTest #:nodoc: end RUBY end + ARGV.clear end diff --git a/railties/lib/rails/commands/profiler.rb b/railties/lib/rails/commands/profiler.rb index 3f6966b4f0..9b3b4f41f6 100644 --- a/railties/lib/rails/commands/profiler.rb +++ b/railties/lib/rails/commands/profiler.rb @@ -29,4 +29,5 @@ class ProfilerTest < ActionDispatch::PerformanceTest #:nodoc: end RUBY end + ARGV.clear end diff --git a/railties/lib/rails/test_unit/testing.rake b/railties/lib/rails/test_unit/testing.rake index 290005993a..8d624c6999 100644 --- a/railties/lib/rails/test_unit/testing.rake +++ b/railties/lib/rails/test_unit/testing.rake @@ -123,10 +123,13 @@ namespace :test do t.pattern = 'test/integration/**/*_test.rb' end - Rails::SubTestTask.new(:benchmark => 'test:prepare') do |t| + task 'test:benchmark_mode' do + ENV["BENCHMARK_TESTS"] = '1' + end + + Rails::SubTestTask.new(:benchmark => ['test:prepare', 'test:benchmark_mode']) do |t| t.libs << 'test' t.pattern = 'test/performance/**/*_test.rb' - t.options = '-- --benchmark' end Rails::SubTestTask.new(:profile => 'test:prepare') do |t| |