diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2008-06-25 12:12:30 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-06-25 12:12:30 +0100 |
commit | 01571c0fd73a31f78411d6cad6484ddd82ec4778 (patch) | |
tree | d0565f7ad3fd5a65aafbf191170094b90d7ef543 /railties/lib/tasks | |
parent | b5e9badea281ce0c371ff1c00461febe66f4e2b2 (diff) | |
parent | 670e22e3724791f51d639f409930fba5af920081 (diff) | |
download | rails-01571c0fd73a31f78411d6cad6484ddd82ec4778.tar.gz rails-01571c0fd73a31f78411d6cad6484ddd82ec4778.tar.bz2 rails-01571c0fd73a31f78411d6cad6484ddd82ec4778.zip |
Merge commit 'mainstream/master'
Conflicts:
actionpack/lib/action_view/helpers/javascript_helper.rb
activesupport/lib/active_support/dependencies.rb
activesupport/lib/active_support/inflector.rb
activesupport/lib/active_support/values/time_zone.rb
Diffstat (limited to 'railties/lib/tasks')
-rw-r--r-- | railties/lib/tasks/databases.rake | 12 | ||||
-rw-r--r-- | railties/lib/tasks/rails.rb | 2 | ||||
-rw-r--r-- | railties/lib/tasks/testing.rake | 15 |
3 files changed, 23 insertions, 6 deletions
diff --git a/railties/lib/tasks/databases.rake b/railties/lib/tasks/databases.rake index 8077d0a401..75fba8b45a 100644 --- a/railties/lib/tasks/databases.rake +++ b/railties/lib/tasks/databases.rake @@ -264,13 +264,15 @@ namespace :db do end namespace :test do - desc "Recreate the test database from the current environment's database schema" - task :clone => %w(db:schema:dump db:test:purge) do + desc "Recreate the test database from the current schema.rb" + task :load => 'db:test:purge' do ActiveRecord::Base.establish_connection(ActiveRecord::Base.configurations['test']) ActiveRecord::Schema.verbose = false Rake::Task["db:schema:load"].invoke end + desc "Recreate the test database from the current environment's database schema" + task :clone => %w(db:schema:dump db:test:load) desc "Recreate the test databases from the development structure" task :clone_structure => [ "db:structure:dump", "db:test:purge" ] do @@ -337,10 +339,10 @@ namespace :db do end end - desc 'Prepare the test database and load the schema' - task :prepare => %w(environment db:abort_if_pending_migrations) do + desc 'Check for pending migrations and load the test schema' + task :prepare => 'db:abort_if_pending_migrations' do if defined?(ActiveRecord) && !ActiveRecord::Base.configurations.blank? - Rake::Task[{ :sql => "db:test:clone_structure", :ruby => "db:test:clone" }[ActiveRecord::Base.schema_format]].invoke + Rake::Task[{ :sql => "db:test:clone_structure", :ruby => "db:test:load" }[ActiveRecord::Base.schema_format]].invoke end end end diff --git a/railties/lib/tasks/rails.rb b/railties/lib/tasks/rails.rb index bfcf5bc493..8c2b7f9bde 100644 --- a/railties/lib/tasks/rails.rb +++ b/railties/lib/tasks/rails.rb @@ -4,5 +4,5 @@ $VERBOSE = nil Dir["#{File.dirname(__FILE__)}/*.rake"].each { |ext| load ext } # Load any custom rakefile extensions -Dir["#{RAILS_ROOT}/lib/tasks/**/*.rake"].sort.each { |ext| load ext } Dir["#{RAILS_ROOT}/vendor/plugins/*/**/tasks/**/*.rake"].sort.each { |ext| load ext } +Dir["#{RAILS_ROOT}/lib/tasks/**/*.rake"].sort.each { |ext| load ext } diff --git a/railties/lib/tasks/testing.rake b/railties/lib/tasks/testing.rake index cc2376cbb3..c8ba6eed94 100644 --- a/railties/lib/tasks/testing.rake +++ b/railties/lib/tasks/testing.rake @@ -103,6 +103,21 @@ namespace :test do end Rake::Task['test:integration'].comment = "Run the integration tests in test/integration" + 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 => 'db:test:prepare') do |t| + t.libs << 'test' + t.pattern = 'test/performance/**/*_test.rb' + t.verbose = true + end + Rake::Task['test:profile'].comment = 'Profile the performance tests' + Rake::TestTask.new(:plugins => :environment) do |t| t.libs << "test" |