derailed_benchmarks 1.5.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 596677a7dc15b62f384bbf140c0bbe05eb9c890b73ea66e76c34c115ba0c38c1
4
- data.tar.gz: 194a74aac18253ad77bb4fcbb464a70478d8127ea894df86e3b8071d6390e264
3
+ metadata.gz: 534c94c162b5f9959a2013292d3f58fdf3bad5f17276a6db240a75596f1b041e
4
+ data.tar.gz: e7db4cf3bb3ea0f965dd25af1dcfe1a85dbfb80d6c3508e295ac68432b4e9868
5
5
  SHA512:
6
- metadata.gz: 00bc97b216b94edf416d320749b789793f2c6dd2e35b7b56ddd45daaaaec88c61d972cc2b8f52005f9c6cb81f564797377dcd519639b41af366eafe8f88451be
7
- data.tar.gz: b0bd2f96ca277f47f1696d7339d10bc9e0c580607def3e5bb5bd3550302749bc53a4575f353bb34c7d104e1c7be4e712af44221b7094a04b636f093b1dd0035a
6
+ metadata.gz: 4f39f3b7df3d063c703df439aba0dd0be34650bbbf490d9af11c28dac0a9449eb347bfd9201124bedfea3b53b6f731280fafa5a9f6e40e7c311d1584b5061e13
7
+ data.tar.gz: 151966ff16e1e07bf217ce88e3c4868089eb2ef6428ddd6e93d8d3761d97902a4c4ee8cca32389e80e5dcaf658f21c121e9a9bffcd2a52d80985e1560021767d
@@ -1,5 +1,10 @@
1
1
  ## master (unreleased)
2
2
 
3
+ ## 1.6.0
4
+
5
+ - Added the `perf:app` command to compare commits within the same application. (https://github.com/schneems/derailed_benchmarks/pull/157)
6
+ - Allow Rails < 7 and 1.0 <= Thor < 2 (https://github.com/schneems/derailed_benchmarks/pull/168)
7
+
3
8
  ## 1.5.0
4
9
 
5
10
  - Test `perf:library` results against 99% confidence interval in addition to 95% (https://github.com/schneems/derailed_benchmarks/pull/165)
data/README.md CHANGED
@@ -415,13 +415,23 @@ or point it at your local copy:
415
415
  gem 'rails', path: "<path/to/your/local/copy/rails>"
416
416
  ```
417
417
 
418
- To run your test:
418
+ To run your tests within the context of your current app/repo:
419
+
420
+ ```
421
+ $ bundle exec derailed exec perf:app
422
+ ```
423
+
424
+ This will automatically test the two latest commits of your library/current directory.
425
+
426
+ If you'd like to test the Rails library instead, make sure that `ENV[DERAILED_PATH_TO_LIBRARY]` is unset.
419
427
 
420
428
  ```
421
429
  $ bundle exec derailed exec perf:library
422
430
  ```
423
431
 
424
- This will automatically test the two latest commits of Rails (or the library you've specified). If you would like to compare against different SHAs you can manually specify them:
432
+ This will automatically test the two latest commits of Rails.
433
+
434
+ If you would also like to compare against different SHAs you can manually specify them:
425
435
 
426
436
  ```
427
437
  $ SHAS_TO_TEST="7b4d80cb373e,13d6aa3a7b70" bundle exec derailed exec perf:library
@@ -28,12 +28,12 @@ Gem::Specification.new do |gem|
28
28
  gem.add_dependency "benchmark-ips", "~> 2"
29
29
  gem.add_dependency "rack", ">= 1"
30
30
  gem.add_dependency "rake", "> 10", "< 14"
31
- gem.add_dependency "thor", "~> 0.19"
31
+ gem.add_dependency "thor", ">= 0.19", "< 2"
32
32
  gem.add_dependency "ruby-statistics", ">= 2.1"
33
33
 
34
34
  gem.add_development_dependency "capybara", "~> 2"
35
35
  gem.add_development_dependency "m"
36
- gem.add_development_dependency "rails", "> 3", "<= 6"
36
+ gem.add_development_dependency "rails", "> 3", "<= 7"
37
37
  gem.add_development_dependency "devise", "> 3", "< 6"
38
38
  gem.add_development_dependency "appraisal", "2.2.0"
39
39
  end
@@ -1,6 +1,12 @@
1
1
  require_relative 'load_tasks'
2
2
 
3
3
  namespace :perf do
4
+ desc "runs the performance test against two most recent commits of the current app"
5
+ task :app do
6
+ ENV["DERAILED_PATH_TO_LIBRARY"] = '.'
7
+ Rake::Task["perf:library"].invoke
8
+ end
9
+
4
10
  desc "runs the same test against two different branches for statistical comparison"
5
11
  task :library do
6
12
  begin
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DerailedBenchmarks
4
- VERSION = "1.5.0"
4
+ VERSION = "1.6.0"
5
5
  end
@@ -13,6 +13,13 @@ class TasksTest < ActiveSupport::TestCase
13
13
  FileUtils.remove_entry_secure(rails_app_path('tmp'))
14
14
  end
15
15
 
16
+ def run!(cmd)
17
+ puts "Running: #{cmd}"
18
+ out = `#{cmd}`
19
+ raise "Could not run #{cmd}, output: #{out}" unless $?.success?
20
+ out
21
+ end
22
+
16
23
  def rake(cmd, options = {})
17
24
  assert_success = options.key?(:assert_success) ? options[:assert_success] : true
18
25
  env = options[:env] || {}
@@ -55,6 +62,13 @@ class TasksTest < ActiveSupport::TestCase
55
62
  rake "perf:test"
56
63
  end
57
64
 
65
+ test 'app' do
66
+ skip unless ENV['USING_RAILS_GIT']
67
+ run!("cd #{rails_app_path} && git init . && git add . && git commit -m first && git commit --allow-empty -m second")
68
+ env = { "TEST_COUNT" => 10, "DERAILED_SCRIPT_COUNT" => 2 }
69
+ puts rake "perf:app", { env: env }
70
+ end
71
+
58
72
  test 'TEST_COUNT' do
59
73
  result = rake "perf:test", env: { "TEST_COUNT" => 1 }
60
74
  assert_match "1 derailed requests", result
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: derailed_benchmarks
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Schneeman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-31 00:00:00.000000000 Z
11
+ date: 2020-01-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: heapy
@@ -104,16 +104,22 @@ dependencies:
104
104
  name: thor
105
105
  requirement: !ruby/object:Gem::Requirement
106
106
  requirements:
107
- - - "~>"
107
+ - - ">="
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0.19'
110
+ - - "<"
111
+ - !ruby/object:Gem::Version
112
+ version: '2'
110
113
  type: :runtime
111
114
  prerelease: false
112
115
  version_requirements: !ruby/object:Gem::Requirement
113
116
  requirements:
114
- - - "~>"
117
+ - - ">="
115
118
  - !ruby/object:Gem::Version
116
119
  version: '0.19'
120
+ - - "<"
121
+ - !ruby/object:Gem::Version
122
+ version: '2'
117
123
  - !ruby/object:Gem::Dependency
118
124
  name: ruby-statistics
119
125
  requirement: !ruby/object:Gem::Requirement
@@ -165,7 +171,7 @@ dependencies:
165
171
  version: '3'
166
172
  - - "<="
167
173
  - !ruby/object:Gem::Version
168
- version: '6'
174
+ version: '7'
169
175
  type: :development
170
176
  prerelease: false
171
177
  version_requirements: !ruby/object:Gem::Requirement
@@ -175,7 +181,7 @@ dependencies:
175
181
  version: '3'
176
182
  - - "<="
177
183
  - !ruby/object:Gem::Version
178
- version: '6'
184
+ version: '7'
179
185
  - !ruby/object:Gem::Dependency
180
186
  name: devise
181
187
  requirement: !ruby/object:Gem::Requirement