public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Performance: integration test benchmarking and profiling.  [Jeremy Kemper]
jeremy (author)
Fri Jun 13 00:21:03 -0700 2008
commit  eab71208db1afead6803501c8d51d77625e5ad6e
tree    194e4911a90e5edf7af4c3c2990d6c0ad3645791
parent  ba0f38f89e8473490270957849d7d5b06f6ee65b
...
1
2
3
 
4
5
6
 
 
 
7
8
9
...
580
581
582
583
 
584
585
586
...
 
 
 
1
2
3
4
5
6
7
8
9
10
...
581
582
583
 
584
585
586
587
0
@@ -1,9 +1,10 @@
0
-require 'stringio'
0
-require 'uri'
0
-
0
+require 'active_support/test_case'
0
 require 'action_controller/dispatcher'
0
 require 'action_controller/test_process'
0
 
0
+require 'stringio'
0
+require 'uri'
0
+
0
 module ActionController
0
   module Integration #:nodoc:
0
     # An integration Session instance represents a set of requests and responses
0
@@ -580,7 +581,7 @@ EOF
0
   #         end
0
   #       end
0
   #   end
0
-  class IntegrationTest < Test::Unit::TestCase
0
+  class IntegrationTest < ActiveSupport::TestCase
0
     include Integration::Runner
0
 
0
     # Work around a bug in test/unit caused by the default test being named
...
51
52
53
 
54
55
56
...
155
156
157
 
158
159
160
...
51
52
53
54
55
56
57
...
156
157
158
159
160
161
162
0
@@ -51,6 +51,7 @@ class AppGenerator < Rails::Generator::Base
0
       m.template "helpers/application.rb",        "app/controllers/application.rb", :assigns => { :app_name => @app_name, :app_secret => md5.hexdigest }
0
       m.template "helpers/application_helper.rb", "app/helpers/application_helper.rb"
0
       m.template "helpers/test_helper.rb",        "test/test_helper.rb"
0
+      m.template "helpers/performance_test.rb",   "test/performance/browsing_test.rb"
0
 
0
       # database.yml and routes.rb
0
       m.template "configs/databases/#{options[:db]}.yml", "config/database.yml", :assigns => {
0
@@ -155,6 +156,7 @@ class AppGenerator < Rails::Generator::Base
0
     test/fixtures
0
     test/functional
0
     test/integration
0
+    test/performance
0
     test/unit
0
     vendor
0
     vendor/plugins
...
103
104
105
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
106
107
108
...
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
0
@@ -103,6 +103,21 @@ namespace :test do
0
   end
0
   Rake::Task['test:integration'].comment = "Run the integration tests in test/integration"
0
 
0
+  Rake::TestTask.new(:benchmark) do |t|
0
+    t.libs << 'test'
0
+    t.pattern = 'test/performance/**/*_test.rb'
0
+    t.verbose = true
0
+    t.options = '-- --benchmark'
0
+  end
0
+  Rake::Task['test:benchmark'].comment = 'Benchmark the performance tests'
0
+
0
+  Rake::TestTask.new(:profile) do |t|
0
+    t.libs << 'test'
0
+    t.pattern = 'test/performance/**/*_test.rb'
0
+    t.verbose = true
0
+  end
0
+  Rake::Task['test:profile'].comment = 'Profile the performance tests'
0
+
0
   Rake::TestTask.new(:plugins => :environment) do |t|
0
     t.libs << "test"
0
 

Comments