From ed0cb91a830f317e3a8192a90294c1005f6156c2 Mon Sep 17 00:00:00 2001
From: Ryan Kinderman <ryan@kinderman.net>
Date: Mon, 26 May 2008 22:15:57 -0500
Subject: Ensure plugins' rake tasks are loaded before application's rake
 tasks. [#259 state:resolved]

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
---
 railties/lib/tasks/rails.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

(limited to 'railties/lib/tasks')

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 }
-- 
cgit v1.2.3


From eab71208db1afead6803501c8d51d77625e5ad6e Mon Sep 17 00:00:00 2001
From: Jeremy Kemper <jeremy@bitsweat.net>
Date: Fri, 13 Jun 2008 00:21:03 -0700
Subject: Performance: integration test benchmarking and profiling.  [Jeremy
 Kemper]

---
 railties/lib/tasks/testing.rake | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

(limited to 'railties/lib/tasks')

diff --git a/railties/lib/tasks/testing.rake b/railties/lib/tasks/testing.rake
index cc2376cbb3..2cadcd55fa 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) 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|
+    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"
 
-- 
cgit v1.2.3


From 09c70a0c03aa755a66dc94ebb2b98b283c7137c9 Mon Sep 17 00:00:00 2001
From: Jeremy Kemper <jeremy@bitsweat.net>
Date: Sun, 15 Jun 2008 16:21:32 -0700
Subject: Use test/performance/test_helper to do test setup then boost log
 level and turn on caching

---
 railties/lib/tasks/testing.rake | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'railties/lib/tasks')

diff --git a/railties/lib/tasks/testing.rake b/railties/lib/tasks/testing.rake
index 2cadcd55fa..c8ba6eed94 100644
--- a/railties/lib/tasks/testing.rake
+++ b/railties/lib/tasks/testing.rake
@@ -103,7 +103,7 @@ 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
@@ -111,7 +111,7 @@ namespace :test do
   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
-- 
cgit v1.2.3


From 8e74a434b8f13bd1697ad556c9fd1ef0217e594e Mon Sep 17 00:00:00 2001
From: Jeremy Kemper <jeremy@bitsweat.net>
Date: Mon, 16 Jun 2008 03:47:15 -0700
Subject: Don't dump schema for every test run, just when migrations are run

---
 railties/lib/tasks/databases.rake | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

(limited to 'railties/lib/tasks')

diff --git a/railties/lib/tasks/databases.rake b/railties/lib/tasks/databases.rake
index 8077d0a401..70de33e346 100644
--- a/railties/lib/tasks/databases.rake
+++ b/railties/lib/tasks/databases.rake
@@ -337,10 +337,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:schema:load" }[ActiveRecord::Base.schema_format]].invoke
       end
     end
   end
-- 
cgit v1.2.3


From 6ffe32160e16398d347e6bcd396ad843ba68e52a Mon Sep 17 00:00:00 2001
From: Jeremy Kemper <jeremy@bitsweat.net>
Date: Tue, 17 Jun 2008 03:52:01 -0700
Subject: Rely on quieter db:test:load task

---
 railties/lib/tasks/databases.rake | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

(limited to 'railties/lib/tasks')

diff --git a/railties/lib/tasks/databases.rake b/railties/lib/tasks/databases.rake
index 70de33e346..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
@@ -340,7 +342,7 @@ namespace :db 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:schema:load" }[ActiveRecord::Base.schema_format]].invoke
+        Rake::Task[{ :sql  => "db:test:clone_structure", :ruby => "db:test:load" }[ActiveRecord::Base.schema_format]].invoke
       end
     end
   end
-- 
cgit v1.2.3