Skip to content

Commit

Permalink
Use test/performance/test_helper to do test setup then boost log leve…
Browse files Browse the repository at this point in the history
…l and turn on caching
  • Loading branch information
jeremy committed Jun 15, 2008
1 parent 59b2dab commit 09c70a0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
5 changes: 1 addition & 4 deletions railties/helpers/performance_test.rb
@@ -1,7 +1,4 @@
ENV['RAILS_ENV'] ||= 'test'
require "#{File.dirname(__FILE__)}/../../config/environment"
require 'test/unit'
require 'action_controller/performance_test'
require 'performance/test_helper'

# Profiling results for each test method are written to tmp/performance.
class BrowsingTest < ActionController::PerformanceTest
Expand Down
6 changes: 6 additions & 0 deletions railties/helpers/performance_test_helper.rb
@@ -0,0 +1,6 @@
require 'test_helper'
require 'action_controller/performance_test'

ActionController::Base.perform_caching = true
ActiveSupport::Dependencies.mechanism = :require
Rails.logger.level = ActiveSupport::BufferedLogger::INFO
Expand Up @@ -51,6 +51,7 @@ def manifest
m.template "helpers/application.rb", "app/controllers/application.rb", :assigns => { :app_name => @app_name, :app_secret => md5.hexdigest }
m.template "helpers/application_helper.rb", "app/helpers/application_helper.rb"
m.template "helpers/test_helper.rb", "test/test_helper.rb"
m.template "helpers/performance_test_helper.rb", "test/performance/test_helper.rb"
m.template "helpers/performance_test.rb", "test/performance/browsing_test.rb"

# database.yml and routes.rb
Expand Down
4 changes: 2 additions & 2 deletions railties/lib/tasks/testing.rake
Expand Up @@ -103,15 +103,15 @@ namespace :test do
end
Rake::Task['test:integration'].comment = "Run the integration tests in test/integration"

Rake::TestTask.new(:benchmark) do |t|
Rake::TestTask.new(:benchmark => 'db:test:prepare') do |t|
t.libs << 'test'
t.pattern = 'test/performance/**/*_test.rb'
t.verbose = true
t.options = '-- --benchmark'
end
Rake::Task['test:benchmark'].comment = 'Benchmark the performance tests'

Rake::TestTask.new(:profile) do |t|
Rake::TestTask.new(:profile => 'db:test:prepare') do |t|
t.libs << 'test'
t.pattern = 'test/performance/**/*_test.rb'
t.verbose = true
Expand Down

0 comments on commit 09c70a0

Please sign in to comment.