rails-perftest 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: da19c0ca237ad8cb825991af265c338b2ed7e818
4
- data.tar.gz: bf9bc9fef0d44b135e5a9d90684f2b1065898b8f
3
+ metadata.gz: c08c629a72988e3937014d0605fa9fbe269245f0
4
+ data.tar.gz: 9de321dca3ea0b0e2faeabd8c75b570215f87b77
5
5
  SHA512:
6
- metadata.gz: 18b018be3b94c3df0bb9487682033f5d1897d76e1e9495708e4c05c75ec5a27a516b1f980bc83c0658713b84966e9c9b3c471922a9df9f688fc329c9c5a2865f
7
- data.tar.gz: 732c232645fb1d453fe929979eeff23099c1e85e4f5e8d7456b89e26bb063cba62cedbcb2d9b81f8da034fbcac76361c3ccb859a0bfd762ee71baa28f3c8616f
6
+ metadata.gz: 6455e133273a288dc1ed778971453437081cecf9e034c0c25cc4bff625dc758faa2f9803f9bdf8205dd4f6ddfbdb3383d0955b430a765a2669424f5d3df3f5ce
7
+ data.tar.gz: 1450f39dfb84d085f0821b19ecb6258a1e2ca6d45a3b134d825914fdd9a5cafbf9111c4969d8b0640491ac1e5abcd3f354c03bbae3d1cd905ed5c8a1aa88d2fd
@@ -0,0 +1,11 @@
1
+ language: ruby
2
+ before_install:
3
+ - gem install bundler
4
+ rvm:
5
+ - 1.9.3
6
+ - 2.0.0
7
+ - 2.1.1
8
+ gemfile:
9
+ - gemfiles/Gemfile-rails-4.0
10
+ - gemfiles/Gemfile-rails-4.1
11
+ - Gemfile
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rails', github: 'rails/rails', branch: '4-0-stable'
4
+
5
+ gemspec path: '..'
@@ -0,0 +1,5 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'rails', github: 'rails/rails', branch: '4-1-stable'
4
+
5
+ gemspec path: '..'
@@ -6,5 +6,11 @@ module ActionDispatch
6
6
  # output format are written to your tmp/performance directory.
7
7
  class PerformanceTest < ActionDispatch::IntegrationTest
8
8
  include ActiveSupport::Testing::Performance
9
+
10
+ if Gem.loaded_specs["minitest"].version < Gem::Version.create('5.0.0')
11
+ include Minitest4AndLower
12
+ else
13
+ include Minitest5AndGreater
14
+ end
9
15
  end
10
16
  end
@@ -35,9 +35,35 @@ module ActiveSupport
35
35
  "#{self.class.name}##{method_name}"
36
36
  end
37
37
 
38
- def run(runner)
39
- @runner = runner
38
+ module Minitest4AndLower
39
+ def run(runner)
40
+ @runner = runner
41
+ _performance_run
42
+ return
43
+ end
44
+
45
+ def performance_failure(e)
46
+ @runner.puke(self.class, method_name, e)
47
+ end
48
+ end
49
+
50
+ module Minitest5AndGreater
51
+ def run
52
+ _performance_run
53
+ self
54
+ end
40
55
 
56
+ def performance_failure(e)
57
+ case e
58
+ when Minitest::Assertion
59
+ self.failures << e
60
+ else
61
+ self.failures << Minitest::UnexpectedError.new(e)
62
+ end
63
+ end
64
+ end
65
+
66
+ def _performance_run
41
67
  run_warmup
42
68
  if full_profile_options && metrics = full_profile_options[:metrics]
43
69
  metrics.each do |metric_name|
@@ -46,8 +72,6 @@ module ActiveSupport
46
72
  end
47
73
  end
48
74
  end
49
-
50
- return
51
75
  end
52
76
 
53
77
  def run_test(metric, mode)
@@ -57,13 +81,13 @@ module ActiveSupport
57
81
  setup
58
82
  metric.send(mode) { __send__ method_name }
59
83
  rescue Exception => e
60
- result = @runner.puke(self.class, method_name, e)
84
+ result = performance_failure(e)
61
85
  ensure
62
86
  begin
63
87
  teardown
64
88
  run_callbacks :teardown
65
89
  rescue Exception => e
66
- result = @runner.puke(self.class, method_name, e)
90
+ result = performance_failure(e)
67
91
  end
68
92
  end
69
93
  result
@@ -1,5 +1,5 @@
1
1
  module Rails
2
2
  module Perftest
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
  end
@@ -7,8 +7,9 @@ Gem::Specification.new do |gem|
7
7
  gem.description = %q{Rails performance tests (removed from core in Rails 4.0)}
8
8
  gem.summary = %q{ActionDispatch::PerformanceTest, ActiveSupport::Testing::Performance extracted from Rails.}
9
9
  gem.homepage = "https://github.com/rails/rails-perftest"
10
+ gem.license = "MIT"
10
11
 
11
- gem.files = [".gitignore","Gemfile","LICENSE","README.md","Rakefile","bin/perftest","lib/generators/rails/app/templates/test/performance/browsing_test.rb","lib/generators/rails/performance_test/USAGE","lib/generators/rails/performance_test/performance_test_generator.rb","lib/generators/rails/performance_test/templates/performance_test.rb","lib/rails-perftest.rb","lib/rails/performance_test_help.rb","lib/rails/perftest/action_controller.rb","lib/rails/perftest/action_controller/performance_test.rb","lib/rails/perftest/action_dispatch.rb","lib/rails/perftest/action_dispatch/performance_test.rb","lib/rails/perftest/active_support/testing/performance.rb","lib/rails/perftest/active_support/testing/performance/jruby.rb","lib/rails/perftest/active_support/testing/performance/rubinius.rb","lib/rails/perftest/active_support/testing/performance/ruby.rb","lib/rails/perftest/commands.rb","lib/rails/perftest/commands/benchmarker.rb","lib/rails/perftest/commands/profiler.rb","lib/rails/perftest/railtie.rb","lib/rails/perftest/railties/testing.tasks","lib/rails/perftest/version.rb","rails-perftest.gemspec","rails-perftest.gemspec.erb","test/generators/generators_test_helper.rb","test/generators/performance_test_generator_test.rb","test/helper.rb","test/performance_test.rb"]
12
+ gem.files = [".gitignore",".travis.yml","Gemfile","LICENSE","README.md","Rakefile","bin/perftest","gemfiles/Gemfile-rails-4.0","gemfiles/Gemfile-rails-4.1","lib/generators/rails/app/templates/test/performance/browsing_test.rb","lib/generators/rails/performance_test/USAGE","lib/generators/rails/performance_test/performance_test_generator.rb","lib/generators/rails/performance_test/templates/performance_test.rb","lib/rails-perftest.rb","lib/rails/performance_test_help.rb","lib/rails/perftest/action_controller.rb","lib/rails/perftest/action_controller/performance_test.rb","lib/rails/perftest/action_dispatch.rb","lib/rails/perftest/action_dispatch/performance_test.rb","lib/rails/perftest/active_support/testing/performance.rb","lib/rails/perftest/active_support/testing/performance/jruby.rb","lib/rails/perftest/active_support/testing/performance/rubinius.rb","lib/rails/perftest/active_support/testing/performance/ruby.rb","lib/rails/perftest/commands.rb","lib/rails/perftest/commands/benchmarker.rb","lib/rails/perftest/commands/profiler.rb","lib/rails/perftest/railtie.rb","lib/rails/perftest/railties/testing.tasks","lib/rails/perftest/version.rb","rails-perftest.gemspec","rails-perftest.gemspec.erb","test/generators/generators_test_helper.rb","test/generators/performance_test_generator_test.rb","test/helper.rb","test/performance_test.rb"]
12
13
  gem.executables = ["perftest"]
13
14
  gem.test_files = ["test/generators/generators_test_helper.rb","test/generators/performance_test_generator_test.rb","test/helper.rb","test/performance_test.rb"]
14
15
  gem.name = "rails-perftest"
@@ -7,6 +7,7 @@ Gem::Specification.new do |gem|
7
7
  gem.description = %q{Rails performance tests (removed from core in Rails 4.0)}
8
8
  gem.summary = %q{ActionDispatch::PerformanceTest, ActiveSupport::Testing::Performance extracted from Rails.}
9
9
  gem.homepage = "https://github.com/rails/rails-perftest"
10
+ gem.license = "MIT"
10
11
 
11
12
  gem.files = [<%= files.map(&:inspect).join ',' %>]
12
13
  gem.executables = [<%= executables.map(&:inspect).join ',' %>]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails-perftest
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yves Senn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-25 00:00:00.000000000 Z
11
+ date: 2014-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-prof
@@ -131,11 +131,14 @@ extensions: []
131
131
  extra_rdoc_files: []
132
132
  files:
133
133
  - .gitignore
134
+ - .travis.yml
134
135
  - Gemfile
135
136
  - LICENSE
136
137
  - README.md
137
138
  - Rakefile
138
139
  - bin/perftest
140
+ - gemfiles/Gemfile-rails-4.0
141
+ - gemfiles/Gemfile-rails-4.1
139
142
  - lib/generators/rails/app/templates/test/performance/browsing_test.rb
140
143
  - lib/generators/rails/performance_test/USAGE
141
144
  - lib/generators/rails/performance_test/performance_test_generator.rb
@@ -163,7 +166,8 @@ files:
163
166
  - test/helper.rb
164
167
  - test/performance_test.rb
165
168
  homepage: https://github.com/rails/rails-perftest
166
- licenses: []
169
+ licenses:
170
+ - MIT
167
171
  metadata: {}
168
172
  post_install_message:
169
173
  rdoc_options: []
@@ -181,7 +185,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
181
185
  version: '0'
182
186
  requirements: []
183
187
  rubyforge_project:
184
- rubygems_version: 2.0.3
188
+ rubygems_version: 2.1.11
185
189
  signing_key:
186
190
  specification_version: 4
187
191
  summary: ActionDispatch::PerformanceTest, ActiveSupport::Testing::Performance extracted