derailed_benchmarks 2.1.1 → 2.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.devcontainer/devcontainer.json +22 -0
- data/.github/workflows/ci.yml +95 -0
- data/.gitignore +1 -0
- data/Appraisals +26 -0
- data/CHANGELOG.md +17 -0
- data/Gemfile +1 -1
- data/README.md +20 -2
- data/bin/derailed +3 -2
- data/derailed_benchmarks.gemspec +18 -4
- data/gemfiles/rails_5_1.gemfile +1 -5
- data/gemfiles/rails_5_2.gemfile +1 -3
- data/gemfiles/rails_6_0.gemfile +3 -4
- data/gemfiles/rails_6_1.gemfile +5 -2
- data/gemfiles/rails_7_0.gemfile +13 -0
- data/gemfiles/rails_7_1.gemfile +13 -0
- data/gemfiles/rails_7_2.gemfile +13 -0
- data/gemfiles/{rails_git.gemfile → rails_head.gemfile} +4 -3
- data/lib/derailed_benchmarks/load_tasks.rb +40 -10
- data/lib/derailed_benchmarks/stats_from_dir.rb +6 -1
- data/lib/derailed_benchmarks/version.rb +1 -1
- data/lib/derailed_benchmarks.rb +1 -1
- data/test/derailed_test.rb +3 -2
- data/test/integration/tasks_test.rb +54 -12
- data/test/rails_app/app/controllers/users_controller.rb +13 -0
- data/test/rails_app/config/environments/development.rb +2 -0
- data/test/rails_app/config/environments/production.rb +2 -0
- data/test/rails_app/config/environments/test.rb +2 -0
- data/test/rails_app/config/routes.rb +1 -0
- data/test/test_helper.rb +6 -3
- metadata +119 -14
- data/.circleci/config.yml +0 -75
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2fa2f30d83c6eadc1ede327c7b69b69a85ff91e242b8cd8d71f3405c58a9f0c0
|
4
|
+
data.tar.gz: f3734272aaa4f3cc8d12f5b5bae04abd1cff4280eb855365a557e14afc9ec02e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: de086034ef9a992032e983d2e3fcb947c9c193f9bb1030650f9d3f19be010fefa9e5035dd07649c80a249375f480345821cf78a65aeac1c943425b53920bc262
|
7
|
+
data.tar.gz: d692c75c307a8aae9b7af80069bb9385ad8f75d3a937d43020cc3421f47a2ceab3ed156e214a39d9393426f3af5ce512ca1635ed55d00e7ca33db42bc12b9d4b
|
@@ -0,0 +1,22 @@
|
|
1
|
+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
2
|
+
// README at: https://github.com/devcontainers/templates/tree/main/src/ruby
|
3
|
+
{
|
4
|
+
"name": "Ruby",
|
5
|
+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
|
6
|
+
"image": "mcr.microsoft.com/devcontainers/ruby:1-3.3-bullseye"
|
7
|
+
|
8
|
+
// Features to add to the dev container. More info: https://containers.dev/features.
|
9
|
+
// "features": {},
|
10
|
+
|
11
|
+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
12
|
+
// "forwardPorts": [],
|
13
|
+
|
14
|
+
// Use 'postCreateCommand' to run commands after the container is created.
|
15
|
+
// "postCreateCommand": "ruby --version",
|
16
|
+
|
17
|
+
// Configure tool-specific properties.
|
18
|
+
// "customizations": {},
|
19
|
+
|
20
|
+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
21
|
+
// "remoteUser": "root"
|
22
|
+
}
|
@@ -0,0 +1,95 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on:
|
4
|
+
- push
|
5
|
+
- pull_request
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
test:
|
9
|
+
runs-on: ubuntu-latest
|
10
|
+
strategy:
|
11
|
+
fail-fast: false
|
12
|
+
matrix:
|
13
|
+
include:
|
14
|
+
- ruby: "2.5"
|
15
|
+
gemfile: gemfiles/rails_5_1.gemfile
|
16
|
+
- ruby: "2.5"
|
17
|
+
gemfile: gemfiles/rails_5_2.gemfile
|
18
|
+
- ruby: "2.5"
|
19
|
+
gemfile: gemfiles/rails_6_0.gemfile
|
20
|
+
- ruby: "2.5"
|
21
|
+
gemfile: gemfiles/rails_6_1.gemfile
|
22
|
+
- ruby: "2.6"
|
23
|
+
gemfile: gemfiles/rails_5_2.gemfile
|
24
|
+
- ruby: "2.6"
|
25
|
+
gemfile: gemfiles/rails_6_0.gemfile
|
26
|
+
- ruby: "2.6"
|
27
|
+
gemfile: gemfiles/rails_6_1.gemfile
|
28
|
+
- ruby: "2.7"
|
29
|
+
gemfile: gemfiles/rails_5_1.gemfile
|
30
|
+
- ruby: "2.7"
|
31
|
+
gemfile: gemfiles/rails_5_2.gemfile
|
32
|
+
- ruby: "2.7"
|
33
|
+
gemfile: gemfiles/rails_6_0.gemfile
|
34
|
+
- ruby: "2.7"
|
35
|
+
gemfile: gemfiles/rails_6_1.gemfile
|
36
|
+
- ruby: "2.7"
|
37
|
+
gemfile: gemfiles/rails_7_0.gemfile
|
38
|
+
- ruby: "2.7"
|
39
|
+
gemfile: gemfiles/rails_7_1.gemfile
|
40
|
+
- ruby: "3.0"
|
41
|
+
gemfile: gemfiles/rails_6_0.gemfile
|
42
|
+
- ruby: "3.0"
|
43
|
+
gemfile: gemfiles/rails_6_1.gemfile
|
44
|
+
- ruby: "3.0"
|
45
|
+
gemfile: gemfiles/rails_7_0.gemfile
|
46
|
+
- ruby: "3.0"
|
47
|
+
gemfile: gemfiles/rails_7_1.gemfile
|
48
|
+
- ruby: "3.1"
|
49
|
+
gemfile: gemfiles/rails_6_0.gemfile
|
50
|
+
- ruby: "3.1"
|
51
|
+
gemfile: gemfiles/rails_6_1.gemfile
|
52
|
+
- ruby: "3.1"
|
53
|
+
gemfile: gemfiles/rails_7_0.gemfile
|
54
|
+
- ruby: "3.1"
|
55
|
+
gemfile: gemfiles/rails_7_1.gemfile
|
56
|
+
- ruby: "3.1"
|
57
|
+
gemfile: gemfiles/rails_7_2.gemfile
|
58
|
+
- ruby: "3.2"
|
59
|
+
gemfile: gemfiles/rails_6_0.gemfile
|
60
|
+
- ruby: "3.2"
|
61
|
+
gemfile: gemfiles/rails_6_1.gemfile
|
62
|
+
- ruby: "3.2"
|
63
|
+
gemfile: gemfiles/rails_7_0.gemfile
|
64
|
+
- ruby: "3.2"
|
65
|
+
gemfile: gemfiles/rails_7_1.gemfile
|
66
|
+
- ruby: "3.2"
|
67
|
+
gemfile: gemfiles/rails_7_2.gemfile
|
68
|
+
- ruby: "3.3"
|
69
|
+
gemfile: gemfiles/rails_6_0.gemfile
|
70
|
+
- ruby: "3.3"
|
71
|
+
gemfile: gemfiles/rails_6_1.gemfile
|
72
|
+
- ruby: "3.3"
|
73
|
+
gemfile: gemfiles/rails_7_0.gemfile
|
74
|
+
- ruby: "3.3"
|
75
|
+
gemfile: gemfiles/rails_7_1.gemfile
|
76
|
+
- ruby: "3.3"
|
77
|
+
gemfile: gemfiles/rails_7_2.gemfile
|
78
|
+
- ruby: "head"
|
79
|
+
gemfile: gemfiles/rails_head.gemfile
|
80
|
+
env:
|
81
|
+
BUNDLE_GEMFILE: ${{ matrix.gemfile }}
|
82
|
+
steps:
|
83
|
+
- name: Checkout code
|
84
|
+
uses: actions/checkout@v4
|
85
|
+
- name: Set up Ruby
|
86
|
+
uses: ruby/setup-ruby@v1
|
87
|
+
with:
|
88
|
+
ruby-version: ${{ matrix.ruby }}
|
89
|
+
bundler-cache: true
|
90
|
+
- name: Set Git config
|
91
|
+
run: |
|
92
|
+
git config --global user.email "user@example.com"
|
93
|
+
git config --global user.name "Github Action Bot"
|
94
|
+
- name: Run test
|
95
|
+
run: bundle exec rake test
|
data/.gitignore
CHANGED
data/Appraisals
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
appraise 'rails_5_1' do
|
4
|
+
gem 'rails', '~> 5.1.0'
|
5
|
+
end
|
6
|
+
|
7
|
+
appraise 'rails_5_2' do
|
8
|
+
gem 'rails', '~> 5.2.0'
|
9
|
+
end
|
10
|
+
|
11
|
+
appraise 'rails_6_0' do
|
12
|
+
gem 'rails', '~> 6.0.0'
|
13
|
+
end
|
14
|
+
|
15
|
+
appraise 'rails_6_1' do
|
16
|
+
gem 'rails', '~> 6.1.0'
|
17
|
+
|
18
|
+
# https://stackoverflow.com/questions/70500220/rails-7-ruby-3-1-loaderror-cannot-load-such-file-net-smtp
|
19
|
+
gem 'net-smtp', require: false
|
20
|
+
gem 'net-imap', require: false
|
21
|
+
gem 'net-pop', require: false
|
22
|
+
end
|
23
|
+
|
24
|
+
appraise 'rails_7_0' do
|
25
|
+
gem 'rails', '~> 7.0'
|
26
|
+
end
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,22 @@
|
|
1
1
|
## HEAD
|
2
2
|
|
3
|
+
## 2.2.0
|
4
|
+
|
5
|
+
- Support REQUEST_METHOD, REQUEST_BODY, CONTENT_TYPE, and CONTENT_LENGTH env vars (https://github.com/zombocom/derailed_benchmarks/pull/234, https://github.com/zombocom/derailed_benchmarks/pull/122)
|
6
|
+
- Support ruby-statistics 4.x (https://github.com/zombocom/derailed_benchmarks/pull/238,
|
7
|
+
https://github.com/zombocom/derailed_benchmarks/pull/239, https://github.com/zombocom/derailed_benchmarks/pull/247)
|
8
|
+
- Repair tests, support ruby-statistics in ruby < 3.0 (https://github.com/zombocom/derailed_benchmarks/pull/241)
|
9
|
+
- Test Rails 7.1 and 7.2 (https://github.com/zombocom/derailed_benchmarks/pull/242)
|
10
|
+
- Switch from dead_end to syntax_suggest (https://github.com/zombocom/derailed_benchmarks/pull/243)
|
11
|
+
- require `ruby2_keywords` so drb doesn't break in ruby < 2.7 (https://github.com/zombocom/derailed_benchmarks/pull/244)
|
12
|
+
- support relative BUNDLE_GEMFILE in tests (https://github.com/zombocom/derailed_benchmarks/pull/245)
|
13
|
+
|
14
|
+
## 2.1.2
|
15
|
+
|
16
|
+
- Support DERAILED_SKIP_RAILS_REQUIRES (https://github.com/zombocom/derailed_benchmarks/pull/199)
|
17
|
+
- Support rails 7 for bundle exec derailed exec mem (https://github.com/zombocom/derailed_benchmarks/pull/212)
|
18
|
+
- Update the gemspec's homepage to the current repo URL (https://github.com/zombocom/derailed_benchmarks/pull/212)
|
19
|
+
|
3
20
|
## 2.1.1
|
4
21
|
|
5
22
|
- Fix Thor's deprecation warning by implementing `exit_on_failure?` (https://github.com/schneems/derailed_benchmarks/pull/195)
|
data/Gemfile
CHANGED
@@ -3,7 +3,7 @@ source 'https://rubygems.org'
|
|
3
3
|
gemspec
|
4
4
|
|
5
5
|
group :development, :test do
|
6
|
-
gem "sqlite3", :platform => [:ruby, :mswin, :mingw]
|
6
|
+
gem "sqlite3", '~> 1.4', :platform => [:ruby, :mswin, :mingw]
|
7
7
|
gem "activerecord-jdbcsqlite3-adapter", '~> 1.3.13', :platform => :jruby
|
8
8
|
gem "test-unit", "~> 3.0"
|
9
9
|
end
|
data/README.md
CHANGED
@@ -4,7 +4,7 @@ A series of things you can use to benchmark a Rails or Ruby app.
|
|
4
4
|
|
5
5
|
![](http://media.giphy.com/media/lfbxexWy71b6U/giphy.gif)
|
6
6
|
|
7
|
-
[![Build Status](https://
|
7
|
+
[![Build Status](https://github.com/zombocom/derailed_benchmarks/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/zombocom/derailed_benchmarks)
|
8
8
|
[![Help Contribute to Open Source](https://www.codetriage.com/schneems/derailed_benchmarks/badges/users.svg)](https://www.codetriage.com/schneems/derailed_benchmarks)
|
9
9
|
|
10
10
|
## Compatibility/Requirements
|
@@ -575,6 +575,22 @@ $ HTTP_AUTHORIZATION="Basic YWRtaW46c2VjcmV0\n" \
|
|
575
575
|
PATH_TO_HIT=/foo_secret bundle exec derailed exec perf:ips
|
576
576
|
```
|
577
577
|
|
578
|
+
The `Content-Type` and `Content-Length` headers are a bit different. To set those, ignore the HTTP_ prefix, use the `CONTENT_TYPE` and `CONTENT_LENGTH` variables.
|
579
|
+
|
580
|
+
### Performing non-GET requests
|
581
|
+
|
582
|
+
If the endpoint being tested is not a GET request, you can set the `REQUEST_METHOD` variable with the HTTP method you want (e.g. POST, PUT, PATCH, DELETE).
|
583
|
+
|
584
|
+
To set the request body, you can use the `REQUEST_BODY`.
|
585
|
+
|
586
|
+
```
|
587
|
+
$ REQUEST_METHOD=POST \
|
588
|
+
REQUEST_BODY="{\"user\":{\"email\":\"foo@bar.com\",\"password\":\"123456\",\"password_confirmation\":\"123456\"}}" \
|
589
|
+
CONTENT_TYPE="application/json" \
|
590
|
+
PATH_TO_HIT=/users \
|
591
|
+
bundle exec derailed exec perf:test
|
592
|
+
```
|
593
|
+
|
578
594
|
### Using a real web server with `USE_SERVER`
|
579
595
|
|
580
596
|
All tests are run without a webserver (directly using `Rack::Mock` by default), if you want to use a webserver set `USE_SERVER` to a Rack::Server compliant server, such as `webrick`.
|
@@ -595,12 +611,14 @@ Note: this plugs in the given webserver directly into rack, it doesn't use any `
|
|
595
611
|
|
596
612
|
### Excluding ActiveRecord
|
597
613
|
|
598
|
-
By default, derailed will load ActiveRecord if the gem is included as a dependency. It is included by default, if you just include the `rails` gem. If you are using a different ORM, you will either need to only include the `railties` gem, or set the `DERAILED_SKIP_ACTIVE_RECORD`
|
614
|
+
By default, derailed will load ActiveRecord if the gem is included as a dependency. It is included by default, if you just include the `rails` gem. If you are using a different ORM, you will either need to only include the `railties` gem, or set the `DERAILED_SKIP_ACTIVE_RECORD` environment variable.
|
599
615
|
|
600
616
|
```
|
601
617
|
$ DERAILED_SKIP_ACTIVE_RECORD=true
|
602
618
|
```
|
603
619
|
|
620
|
+
Alternatively, use the `DERAILED_SKIP_RAILS_REQUIRES` environment variable to have derailed not require any Rails gems. Your app will then need to require them as part of its boot sequence.
|
621
|
+
|
604
622
|
### Running in a different environment
|
605
623
|
|
606
624
|
Tests run against the production environment by default, but it's easy to
|
data/bin/derailed
CHANGED
@@ -80,9 +80,10 @@ class DerailedBenchmarkCLI < Thor
|
|
80
80
|
require 'bundler/setup'
|
81
81
|
|
82
82
|
begin
|
83
|
-
if ENV["
|
83
|
+
if ENV["DERAILED_SKIP_RAILS_REQUIRES"]
|
84
|
+
# do nothing. your app will handle requiring Rails for booting.
|
85
|
+
elsif ENV["DERAILED_SKIP_ACTIVE_RECORD"]
|
84
86
|
require "action_controller/railtie"
|
85
|
-
require "action_mailer/railtie"
|
86
87
|
require "sprockets/railtie"
|
87
88
|
require "rails/test_unit/railtie"
|
88
89
|
else
|
data/derailed_benchmarks.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |gem|
|
|
12
12
|
gem.email = ["richard.schneeman+rubygems@gmail.com"]
|
13
13
|
gem.description = %q{ Go faster, off the Rails }
|
14
14
|
gem.summary = %q{ Benchmarks designed to performance test your ENTIRE site }
|
15
|
-
gem.homepage = "https://github.com/
|
15
|
+
gem.homepage = "https://github.com/zombocom/derailed_benchmarks"
|
16
16
|
gem.license = "MIT"
|
17
17
|
|
18
18
|
gem.files = `git ls-files`.split($/)
|
@@ -29,14 +29,28 @@ Gem::Specification.new do |gem|
|
|
29
29
|
gem.add_dependency "rack", ">= 1"
|
30
30
|
gem.add_dependency "rake", "> 10", "< 14"
|
31
31
|
gem.add_dependency "thor", ">= 0.19", "< 2"
|
32
|
-
|
32
|
+
if RUBY_VERSION >= '3.0'
|
33
|
+
gem.add_dependency "ruby-statistics", ">= 4.0.1"
|
34
|
+
else
|
35
|
+
gem.add_dependency "ruby-statistics", ">= 2.1"
|
36
|
+
end
|
37
|
+
if RUBY_VERSION < "3.2"
|
38
|
+
gem.add_dependency "syntax_suggest", "~> 1.1.0"
|
39
|
+
end
|
33
40
|
gem.add_dependency "mini_histogram", ">= 0.3.0"
|
34
|
-
gem.add_dependency "dead_end", ">= 0"
|
35
41
|
gem.add_dependency "rack-test", ">= 0"
|
42
|
+
gem.add_dependency "base64", ">= 0"
|
43
|
+
gem.add_dependency "mutex_m", ">= 0"
|
44
|
+
gem.add_dependency "bigdecimal", ">= 0"
|
45
|
+
gem.add_dependency "drb", ">= 0"
|
46
|
+
gem.add_dependency "logger", ">= 0"
|
47
|
+
gem.add_dependency "ostruct", ">= 0"
|
48
|
+
gem.add_dependency "ruby2_keywords", ">= 0"
|
36
49
|
|
50
|
+
gem.add_development_dependency "appraisal"
|
37
51
|
gem.add_development_dependency "webrick", ">= 0"
|
38
52
|
gem.add_development_dependency "capybara", "~> 2"
|
39
53
|
gem.add_development_dependency "m"
|
40
|
-
gem.add_development_dependency "rails", "> 3", "
|
54
|
+
gem.add_development_dependency "rails", "> 3", "< 7.1"
|
41
55
|
gem.add_development_dependency "devise", "> 3", "< 6"
|
42
56
|
end
|
data/gemfiles/rails_5_1.gemfile
CHANGED
@@ -1,12 +1,8 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# BUNDLE_GEMFILE="gemfiles/rails_5_1.gemfile" bundle exec m test/integration/tasks_test.rb:30
|
4
|
-
#
|
5
1
|
# This file was generated by Appraisal
|
6
2
|
|
7
3
|
source "https://rubygems.org"
|
8
4
|
|
9
|
-
gem "rails", "~> 5.1.
|
5
|
+
gem "rails", "~> 5.1.0"
|
10
6
|
|
11
7
|
group :development, :test do
|
12
8
|
gem "sqlite3", platform: [:ruby, :mswin, :mingw]
|
data/gemfiles/rails_5_2.gemfile
CHANGED
@@ -1,10 +1,8 @@
|
|
1
1
|
# This file was generated by Appraisal
|
2
|
-
#
|
3
|
-
# BUNDLE_GEMFILE="gemfiles/rails_5_2.gemfile" bundle exec m test/integration/tasks_test.rb:30
|
4
2
|
|
5
3
|
source "https://rubygems.org"
|
6
4
|
|
7
|
-
gem "rails", "~> 5.2.
|
5
|
+
gem "rails", "~> 5.2.0"
|
8
6
|
|
9
7
|
group :development, :test do
|
10
8
|
gem "sqlite3", platform: [:ruby, :mswin, :mingw]
|
data/gemfiles/rails_6_0.gemfile
CHANGED
@@ -1,15 +1,14 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
1
|
# This file was generated by Appraisal
|
4
2
|
|
5
3
|
source "https://rubygems.org"
|
6
4
|
|
7
|
-
gem "rails", "6.0.0"
|
5
|
+
gem "rails", "~> 6.0.0"
|
8
6
|
|
9
7
|
group :development, :test do
|
10
|
-
gem "sqlite3", platform: [:ruby, :mswin, :mingw]
|
8
|
+
gem "sqlite3", '~> 1.4', platform: [:ruby, :mswin, :mingw]
|
11
9
|
gem "activerecord-jdbcsqlite3-adapter", "~> 1.3.13", platform: :jruby
|
12
10
|
gem "test-unit", "~> 3.0"
|
11
|
+
gem "psych", "~> 3.0"
|
13
12
|
end
|
14
13
|
|
15
14
|
gemspec path: "../"
|
data/gemfiles/rails_6_1.gemfile
CHANGED
@@ -2,10 +2,13 @@
|
|
2
2
|
|
3
3
|
source "https://rubygems.org"
|
4
4
|
|
5
|
-
gem "rails", "~> 6.1.
|
5
|
+
gem "rails", "~> 6.1.0"
|
6
|
+
gem "net-smtp", require: false
|
7
|
+
gem "net-imap", require: false
|
8
|
+
gem "net-pop", require: false
|
6
9
|
|
7
10
|
group :development, :test do
|
8
|
-
gem "sqlite3", platform: [:ruby, :mswin, :mingw]
|
11
|
+
gem "sqlite3", '~> 1.4', platform: [:ruby, :mswin, :mingw]
|
9
12
|
gem "activerecord-jdbcsqlite3-adapter", "~> 1.3.13", platform: :jruby
|
10
13
|
gem "test-unit", "~> 3.0"
|
11
14
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "rails", "~> 7.0.0"
|
6
|
+
|
7
|
+
group :development, :test do
|
8
|
+
gem "sqlite3", '~> 1.4', platform: [:ruby, :mswin, :mingw]
|
9
|
+
gem "activerecord-jdbcsqlite3-adapter", "~> 1.3.13", platform: :jruby
|
10
|
+
gem "test-unit", "~> 3.0"
|
11
|
+
end
|
12
|
+
|
13
|
+
gemspec path: "../"
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "rails", "~> 7.1.0"
|
6
|
+
|
7
|
+
group :development, :test do
|
8
|
+
gem "sqlite3", '~> 1.4', platform: [:ruby, :mswin, :mingw]
|
9
|
+
gem "activerecord-jdbcsqlite3-adapter", "~> 1.3.13", platform: :jruby
|
10
|
+
gem "test-unit", "~> 3.0"
|
11
|
+
end
|
12
|
+
|
13
|
+
gemspec path: "../"
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "rails", "~> 7.2.0"
|
6
|
+
|
7
|
+
group :development, :test do
|
8
|
+
gem "sqlite3", '~> 1.4', platform: [:ruby, :mswin, :mingw]
|
9
|
+
gem "activerecord-jdbcsqlite3-adapter", "~> 1.3.13", platform: :jruby
|
10
|
+
gem "test-unit", "~> 3.0"
|
11
|
+
end
|
12
|
+
|
13
|
+
gemspec path: "../"
|
@@ -1,17 +1,18 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
# $ BUNDLE_GEMFILE="
|
3
|
+
# $ BUNDLE_GEMFILE="gemfiles/rails_git.gemfile" bundle exec m test/integration/tasks_test.rb:50
|
4
4
|
|
5
5
|
source "https://rubygems.org"
|
6
6
|
|
7
|
-
gem "rails", github: "rails/rails",
|
7
|
+
gem "rails", github: "rails/rails", branch: "main"
|
8
8
|
|
9
|
-
gem 'devise', github: "plataformatec/devise"
|
9
|
+
gem 'devise', github: "plataformatec/devise", branch: "main"
|
10
10
|
|
11
11
|
group :development, :test do
|
12
12
|
gem "sqlite3", platform: [:ruby, :mswin, :mingw]
|
13
13
|
gem "activerecord-jdbcsqlite3-adapter", "~> 1.3.13", platform: :jruby
|
14
14
|
gem "test-unit", "~> 3.0"
|
15
|
+
gem "rackup"
|
15
16
|
end
|
16
17
|
|
17
18
|
gemspec path: "../"
|
@@ -24,6 +24,9 @@ namespace :perf do
|
|
24
24
|
|
25
25
|
DERAILED_APP = Rails.application
|
26
26
|
|
27
|
+
# Disables CSRF protection because of non-GET requests
|
28
|
+
DERAILED_APP.config.action_controller.allow_forgery_protection = false
|
29
|
+
|
27
30
|
if DERAILED_APP.respond_to?(:initialized?)
|
28
31
|
DERAILED_APP.initialize! unless DERAILED_APP.initialized?
|
29
32
|
else
|
@@ -40,9 +43,12 @@ namespace :perf do
|
|
40
43
|
ActiveRecord::Migrator.migrations_paths = DERAILED_APP.paths['db/migrate'].to_a
|
41
44
|
ActiveRecord::Migration.verbose = true
|
42
45
|
|
43
|
-
|
46
|
+
# https://github.com/plataformatec/devise/blob/master/test/orm/active_record.rb
|
47
|
+
if Rails.version >= "7.1"
|
48
|
+
ActiveRecord::MigrationContext.new(ActiveRecord::Migrator.migrations_paths).migrate
|
49
|
+
elsif Rails.version >= "6.0"
|
44
50
|
ActiveRecord::MigrationContext.new(ActiveRecord::Migrator.migrations_paths, ActiveRecord::SchemaMigration).migrate
|
45
|
-
elsif Rails.version.start_with?
|
51
|
+
elsif Rails.version.start_with?("5.2")
|
46
52
|
ActiveRecord::MigrationContext.new(ActiveRecord::Migrator.migrations_paths).migrate
|
47
53
|
else
|
48
54
|
ActiveRecord::Migrator.migrate(ActiveRecord::Migrator.migrations_paths, nil)
|
@@ -74,23 +80,44 @@ namespace :perf do
|
|
74
80
|
WARM_COUNT = (ENV['WARM_COUNT'] || 0).to_i
|
75
81
|
TEST_COUNT = (ENV['TEST_COUNT'] || ENV['CNT'] || 1_000).to_i
|
76
82
|
PATH_TO_HIT = ENV["PATH_TO_HIT"] || ENV['ENDPOINT'] || "/"
|
83
|
+
REQUEST_METHOD = ENV["REQUEST_METHOD"] || "GET"
|
84
|
+
REQUEST_BODY = ENV["REQUEST_BODY"]
|
85
|
+
puts "Method: #{REQUEST_METHOD}"
|
77
86
|
puts "Endpoint: #{ PATH_TO_HIT.inspect }"
|
78
87
|
|
88
|
+
# See https://www.rubydoc.info/github/rack/rack/file/SPEC#The_Environment
|
89
|
+
# All HTTP_ variables are accepted in the Rack environment hash, except HTTP_CONTENT_TYPE and HTTP_CONTENT_LENGTH.
|
90
|
+
# For those, the HTTP_ prefix has to be removed.
|
79
91
|
HTTP_HEADER_PREFIX = "HTTP_".freeze
|
80
|
-
|
92
|
+
HTTP_HEADER_REGEXP = /^#{HTTP_HEADER_PREFIX}.+|CONTENT_(TYPE|LENGTH)$/
|
93
|
+
RACK_ENV_HASH = ENV.select { |key| key =~ HTTP_HEADER_REGEXP }
|
81
94
|
|
82
|
-
HTTP_HEADERS =
|
95
|
+
HTTP_HEADERS = RACK_ENV_HASH.keys.inject({}) do |hash, rack_header_name|
|
83
96
|
# e.g. "HTTP_ACCEPT_CHARSET" -> "Accept-Charset"
|
84
|
-
|
85
|
-
|
97
|
+
upper_case_header_name =
|
98
|
+
if rack_header_name.start_with?(HTTP_HEADER_PREFIX)
|
99
|
+
rack_header_name[HTTP_HEADER_PREFIX.size..-1]
|
100
|
+
else
|
101
|
+
rack_header_name
|
102
|
+
end
|
103
|
+
|
104
|
+
header_name = upper_case_header_name.split("_").map(&:downcase).map(&:capitalize).join("-")
|
105
|
+
|
106
|
+
hash[header_name] = RACK_ENV_HASH[rack_header_name]
|
86
107
|
hash
|
87
108
|
end
|
88
109
|
puts "HTTP headers: #{HTTP_HEADERS}" unless HTTP_HEADERS.empty?
|
89
110
|
|
90
111
|
CURL_HTTP_HEADER_ARGS = HTTP_HEADERS.map { |http_header_name, value| "-H \"#{http_header_name}: #{value}\"" }.join(" ")
|
112
|
+
CURL_BODY_ARG = REQUEST_BODY ? "-d '#{REQUEST_BODY}'" : nil
|
113
|
+
|
114
|
+
if REQUEST_METHOD != "GET" && REQUEST_BODY
|
115
|
+
RACK_ENV_HASH["GATEWAY_INTERFACE"] = "CGI/1.1"
|
116
|
+
RACK_ENV_HASH[:input] = REQUEST_BODY.dup
|
117
|
+
puts "Body: #{REQUEST_BODY}"
|
118
|
+
end
|
91
119
|
|
92
120
|
require 'rack/test'
|
93
|
-
require 'rack/file'
|
94
121
|
|
95
122
|
DERAILED_APP = DerailedBenchmarks.add_auth(Object.class_eval { remove_const(:DERAILED_APP) })
|
96
123
|
if server = ENV["USE_SERVER"]
|
@@ -98,12 +125,15 @@ namespace :perf do
|
|
98
125
|
puts "Port: #{ @port.inspect }"
|
99
126
|
puts "Server: #{ server.inspect }"
|
100
127
|
thread = Thread.new do
|
101
|
-
|
128
|
+
# rack 3 doesn't have Rack::Server
|
129
|
+
require 'rackup' unless defined?(Rack::Server)
|
130
|
+
server_class = defined?(Rack::Server) ? Rack::Server : Rackup::Server
|
131
|
+
server_class.start(app: DERAILED_APP, :Port => @port, environment: "none", server: server)
|
102
132
|
end
|
103
133
|
sleep 1
|
104
134
|
|
105
135
|
def call_app(path = File.join("/", PATH_TO_HIT))
|
106
|
-
cmd = "curl #{CURL_HTTP_HEADER_ARGS} 'http://localhost:#{@port}#{path}'
|
136
|
+
cmd = "curl -X #{REQUEST_METHOD} #{CURL_HTTP_HEADER_ARGS} #{CURL_BODY_ARG} -s --fail 'http://localhost:#{@port}#{path}' 2>&1"
|
107
137
|
response = `#{cmd}`
|
108
138
|
unless $?.success?
|
109
139
|
STDERR.puts "Couldn't call app."
|
@@ -121,7 +151,7 @@ namespace :perf do
|
|
121
151
|
@app = Rack::MockRequest.new(DERAILED_APP)
|
122
152
|
|
123
153
|
def call_app
|
124
|
-
response = @app.
|
154
|
+
response = @app.request(REQUEST_METHOD, PATH_TO_HIT, RACK_ENV_HASH)
|
125
155
|
if response.status != 200
|
126
156
|
STDERR.puts "Couldn't call app. Bad request to #{PATH_TO_HIT}! Resulted in #{response.status} status."
|
127
157
|
STDERR.puts "\n\n***RESPONSE BODY***\n\n"
|
@@ -1,7 +1,12 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'bigdecimal'
|
4
|
-
|
4
|
+
# keep this in sync with gemspec
|
5
|
+
if RUBY_VERSION >= '3.0'
|
6
|
+
require 'ruby-statistics'
|
7
|
+
else
|
8
|
+
require 'statistics'
|
9
|
+
end
|
5
10
|
require 'stringio'
|
6
11
|
require 'mini_histogram'
|
7
12
|
require 'mini_histogram/plot'
|
data/lib/derailed_benchmarks.rb
CHANGED
data/test/derailed_test.rb
CHANGED
@@ -19,10 +19,11 @@ class DerailedBenchmarksTest < ActiveSupport::TestCase
|
|
19
19
|
expected = lines.lazy.drop_while { |line|
|
20
20
|
lineno += 1
|
21
21
|
line != "$ bundle exec derailed exec --help\n"
|
22
|
-
}.drop(1).take_while { |line| line != "```\n" }.force.join
|
22
|
+
}.drop(1).take_while { |line| line != "```\n" }.force.join.split("\n").sort
|
23
|
+
actual = `bundle exec derailed exec --help`.split("\n").sort
|
23
24
|
assert_equal(
|
24
25
|
expected,
|
25
|
-
|
26
|
+
actual,
|
26
27
|
"Please update README.md:#{lineno}"
|
27
28
|
)
|
28
29
|
end
|
@@ -14,7 +14,6 @@ class TasksTest < ActiveSupport::TestCase
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def run!(cmd)
|
17
|
-
puts "Running: #{cmd}"
|
18
17
|
out = `#{cmd}`
|
19
18
|
raise "Could not run #{cmd}, output: #{out}" unless $?.success?
|
20
19
|
out
|
@@ -25,8 +24,11 @@ class TasksTest < ActiveSupport::TestCase
|
|
25
24
|
env = options[:env] || {}
|
26
25
|
env_string = env.map {|key, value| "#{key.shellescape}=#{value.to_s.shellescape}" }.join(" ")
|
27
26
|
cmd = "env #{env_string} bundle exec rake -f perf.rake #{cmd} --trace"
|
28
|
-
|
29
|
-
|
27
|
+
result = Bundler.with_original_env do
|
28
|
+
# Ensure relative BUNDLE_GEMFILE is expanded so path is still correct after cd
|
29
|
+
ENV['BUNDLE_GEMFILE'] = File.expand_path(ENV['BUNDLE_GEMFILE']) if ENV['BUNDLE_GEMFILE']
|
30
|
+
`cd '#{rails_app_path}' && #{cmd} 2>&1`
|
31
|
+
end
|
30
32
|
if assert_success && !$?.success?
|
31
33
|
puts result
|
32
34
|
raise "Expected '#{cmd}' to return a success status.\nOutput: #{result}"
|
@@ -44,23 +46,23 @@ class TasksTest < ActiveSupport::TestCase
|
|
44
46
|
end
|
45
47
|
|
46
48
|
test 'rails perf:library from git' do
|
47
|
-
# BUNDLE_GEMFILE="
|
49
|
+
# BUNDLE_GEMFILE="gemfiles/rails_git.gemfile" bundle exec m test/integration/tasks_test.rb:<linenumber>
|
48
50
|
|
49
|
-
skip unless ENV['USING_RAILS_GIT']
|
51
|
+
skip # unless ENV['USING_RAILS_GIT']
|
50
52
|
|
51
53
|
env = { "TEST_COUNT" => 2, "DERAILED_SCRIPT_COUNT" => 2,
|
52
|
-
"SHAS_TO_TEST" => "
|
54
|
+
"SHAS_TO_TEST" => "fd9308a2925e862435859e1803e720e6eebe4bb6,aa85e897312396b5c6993d8092b9aff7faa93011"}
|
53
55
|
puts rake "perf:library", { env: env }
|
54
56
|
end
|
55
57
|
|
56
58
|
test "rails perf:library with bad script" do
|
57
|
-
# BUNDLE_GEMFILE="
|
59
|
+
# BUNDLE_GEMFILE="gemfiles/rails_git.gemfile" bundle exec m test/integration/tasks_test.rb:<linenumber>
|
58
60
|
|
59
|
-
skip unless ENV['USING_RAILS_GIT']
|
61
|
+
skip # unless ENV['USING_RAILS_GIT']
|
60
62
|
|
61
63
|
error = assert_raises {
|
62
64
|
env = { "DERAILED_SCRIPT" => "nopenopenop", "TEST_COUNT" => 2, "DERAILED_SCRIPT_COUNT" => 2,
|
63
|
-
"SHAS_TO_TEST" => "
|
65
|
+
"SHAS_TO_TEST" => "fd9308a2925e862435859e1803e720e6eebe4bb6,aa85e897312396b5c6993d8092b9aff7faa93011"}
|
64
66
|
puts rake "perf:library", { env: env }
|
65
67
|
}
|
66
68
|
|
@@ -120,16 +122,56 @@ class TasksTest < ActiveSupport::TestCase
|
|
120
122
|
env = {
|
121
123
|
"PATH_TO_HIT" => 'foo_secret',
|
122
124
|
"TEST_COUNT" => "2",
|
123
|
-
"HTTP_AUTHORIZATION" => "Basic #{Base64.
|
125
|
+
"HTTP_AUTHORIZATION" => "Basic #{Base64.strict_encode64("admin:secret")}",
|
124
126
|
"HTTP_CACHE_CONTROL" => "no-cache"
|
125
127
|
}
|
126
128
|
result = rake "perf:test", env: env
|
127
129
|
assert_match 'Endpoint: "foo_secret"', result
|
128
|
-
assert_match
|
130
|
+
assert_match (/"Authorization"=>"Basic YWRtaW46c2VjcmV0"/), result
|
131
|
+
assert_match (/"Cache-Control"=>"no-cache"/), result
|
132
|
+
|
133
|
+
env["USE_SERVER"] = "webrick"
|
134
|
+
result = rake "perf:test", env: env
|
135
|
+
assert_match (/"Authorization"=>"Basic YWRtaW46c2VjcmV0"/), result
|
136
|
+
assert_match (/"Cache-Control"=>"no-cache"/), result
|
137
|
+
end
|
138
|
+
|
139
|
+
test 'CONTENT_TYPE' do
|
140
|
+
env = {
|
141
|
+
"REQUEST_METHOD" => "POST",
|
142
|
+
"PATH_TO_HIT" => "users",
|
143
|
+
"CONTENT_TYPE" => "application/json",
|
144
|
+
"REQUEST_BODY" => '{"user":{"email":"foo@bar.com","password":"123456","password_confirmation":"123456"}}',
|
145
|
+
"TEST_COUNT" => "2"
|
146
|
+
}
|
147
|
+
|
148
|
+
result = rake "perf:test", env: env
|
149
|
+
assert_match 'Body: {"user":{"email":"foo@bar.com","password":"123456","password_confirmation":"123456"}}', result
|
150
|
+
assert_match 'HTTP headers: {"Content-Type"=>"application/json"}', result
|
151
|
+
|
152
|
+
env["USE_SERVER"] = "webrick"
|
153
|
+
result = rake "perf:test", env: env
|
154
|
+
assert_match 'Body: {"user":{"email":"foo@bar.com","password":"123456","password_confirmation":"123456"}}', result
|
155
|
+
assert_match 'HTTP headers: {"Content-Type"=>"application/json"}', result
|
156
|
+
end
|
157
|
+
|
158
|
+
test 'REQUEST_METHOD and REQUEST_BODY' do
|
159
|
+
env = {
|
160
|
+
"REQUEST_METHOD" => "POST",
|
161
|
+
"PATH_TO_HIT" => "users",
|
162
|
+
"REQUEST_BODY" => "user%5Bemail%5D=foo%40bar.com&user%5Bpassword%5D=123456&user%5Bpassword_confirmation%5D=123456",
|
163
|
+
"TEST_COUNT" => "2"
|
164
|
+
}
|
165
|
+
|
166
|
+
result = rake "perf:test", env: env
|
167
|
+
assert_match 'Endpoint: "users"', result
|
168
|
+
assert_match 'Method: POST', result
|
169
|
+
assert_match 'Body: user%5Bemail%5D=foo%40bar.com&user%5Bpassword%5D=123456&user%5Bpassword_confirmation%5D=123456', result
|
129
170
|
|
130
171
|
env["USE_SERVER"] = "webrick"
|
131
172
|
result = rake "perf:test", env: env
|
132
|
-
assert_match '
|
173
|
+
assert_match 'Method: POST', result
|
174
|
+
assert_match 'Body: user%5Bemail%5D=foo%40bar.com&user%5Bpassword%5D=123456&user%5Bpassword_confirmation%5D=123456', result
|
133
175
|
end
|
134
176
|
|
135
177
|
test 'USE_SERVER' do
|
@@ -11,6 +11,8 @@ Dummy::Application.configure do
|
|
11
11
|
# Log error messages when you accidentally call methods on nil.
|
12
12
|
config.whiny_nils = true
|
13
13
|
|
14
|
+
config.eager_load = false
|
15
|
+
|
14
16
|
# Show full error reports and disable caching
|
15
17
|
config.consider_all_requests_local = true
|
16
18
|
config.action_controller.perform_caching = false
|
@@ -11,6 +11,8 @@ Dummy::Application.configure do
|
|
11
11
|
config.consider_all_requests_local = false
|
12
12
|
config.action_controller.perform_caching = true
|
13
13
|
|
14
|
+
config.eager_load = true
|
15
|
+
|
14
16
|
# Specifies the header that your server uses for sending files
|
15
17
|
config.action_dispatch.x_sendfile_header = "X-Sendfile"
|
16
18
|
|
@@ -12,6 +12,8 @@ Dummy::Application.configure do
|
|
12
12
|
# Log error messages when you accidentally call methods on nil.
|
13
13
|
config.whiny_nils = true
|
14
14
|
|
15
|
+
config.eager_load = false
|
16
|
+
|
15
17
|
# Show full error reports and disable caching
|
16
18
|
config.consider_all_requests_local = true
|
17
19
|
config.action_controller.perform_caching = false
|
data/test/test_helper.rb
CHANGED
@@ -6,6 +6,8 @@ require 'bundler/setup'
|
|
6
6
|
# Configure Rails Envinronment
|
7
7
|
ENV["RAILS_ENV"] = "test"
|
8
8
|
|
9
|
+
require "ruby2_keywords" if RUBY_VERSION < "2.7"
|
10
|
+
|
9
11
|
require 'rails'
|
10
12
|
require 'rails/test_help'
|
11
13
|
|
@@ -15,7 +17,6 @@ require 'pathname'
|
|
15
17
|
require 'derailed_benchmarks'
|
16
18
|
|
17
19
|
require File.expand_path("../rails_app/config/environment.rb", __FILE__)
|
18
|
-
require "rails/test_help"
|
19
20
|
|
20
21
|
ActionMailer::Base.delivery_method = :test
|
21
22
|
ActionMailer::Base.perform_deliveries = true
|
@@ -32,9 +33,11 @@ require_relative "rails_app/config/environment"
|
|
32
33
|
|
33
34
|
# https://github.com/plataformatec/devise/blob/master/test/orm/active_record.rb
|
34
35
|
migrate_path = File.expand_path("../rails_app/db/migrate", __FILE__)
|
35
|
-
if Rails.version.
|
36
|
+
if Rails.version >= "7.1"
|
37
|
+
ActiveRecord::MigrationContext.new(migrate_path).migrate
|
38
|
+
elsif Rails.version >= "6.0"
|
36
39
|
ActiveRecord::MigrationContext.new(migrate_path, ActiveRecord::SchemaMigration).migrate
|
37
|
-
elsif Rails.version.start_with?
|
40
|
+
elsif Rails.version.start_with? "5.2"
|
38
41
|
ActiveRecord::MigrationContext.new(migrate_path).migrate
|
39
42
|
else
|
40
43
|
ActiveRecord::Migrator.migrate(migrate_path)
|
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: 2.
|
4
|
+
version: 2.2.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:
|
11
|
+
date: 2024-10-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: heapy
|
@@ -132,14 +132,14 @@ dependencies:
|
|
132
132
|
requirements:
|
133
133
|
- - ">="
|
134
134
|
- !ruby/object:Gem::Version
|
135
|
-
version:
|
135
|
+
version: 4.0.1
|
136
136
|
type: :runtime
|
137
137
|
prerelease: false
|
138
138
|
version_requirements: !ruby/object:Gem::Requirement
|
139
139
|
requirements:
|
140
140
|
- - ">="
|
141
141
|
- !ruby/object:Gem::Version
|
142
|
-
version:
|
142
|
+
version: 4.0.1
|
143
143
|
- !ruby/object:Gem::Dependency
|
144
144
|
name: mini_histogram
|
145
145
|
requirement: !ruby/object:Gem::Requirement
|
@@ -155,7 +155,7 @@ dependencies:
|
|
155
155
|
- !ruby/object:Gem::Version
|
156
156
|
version: 0.3.0
|
157
157
|
- !ruby/object:Gem::Dependency
|
158
|
-
name:
|
158
|
+
name: rack-test
|
159
159
|
requirement: !ruby/object:Gem::Requirement
|
160
160
|
requirements:
|
161
161
|
- - ">="
|
@@ -169,7 +169,49 @@ dependencies:
|
|
169
169
|
- !ruby/object:Gem::Version
|
170
170
|
version: '0'
|
171
171
|
- !ruby/object:Gem::Dependency
|
172
|
-
name:
|
172
|
+
name: base64
|
173
|
+
requirement: !ruby/object:Gem::Requirement
|
174
|
+
requirements:
|
175
|
+
- - ">="
|
176
|
+
- !ruby/object:Gem::Version
|
177
|
+
version: '0'
|
178
|
+
type: :runtime
|
179
|
+
prerelease: false
|
180
|
+
version_requirements: !ruby/object:Gem::Requirement
|
181
|
+
requirements:
|
182
|
+
- - ">="
|
183
|
+
- !ruby/object:Gem::Version
|
184
|
+
version: '0'
|
185
|
+
- !ruby/object:Gem::Dependency
|
186
|
+
name: mutex_m
|
187
|
+
requirement: !ruby/object:Gem::Requirement
|
188
|
+
requirements:
|
189
|
+
- - ">="
|
190
|
+
- !ruby/object:Gem::Version
|
191
|
+
version: '0'
|
192
|
+
type: :runtime
|
193
|
+
prerelease: false
|
194
|
+
version_requirements: !ruby/object:Gem::Requirement
|
195
|
+
requirements:
|
196
|
+
- - ">="
|
197
|
+
- !ruby/object:Gem::Version
|
198
|
+
version: '0'
|
199
|
+
- !ruby/object:Gem::Dependency
|
200
|
+
name: bigdecimal
|
201
|
+
requirement: !ruby/object:Gem::Requirement
|
202
|
+
requirements:
|
203
|
+
- - ">="
|
204
|
+
- !ruby/object:Gem::Version
|
205
|
+
version: '0'
|
206
|
+
type: :runtime
|
207
|
+
prerelease: false
|
208
|
+
version_requirements: !ruby/object:Gem::Requirement
|
209
|
+
requirements:
|
210
|
+
- - ">="
|
211
|
+
- !ruby/object:Gem::Version
|
212
|
+
version: '0'
|
213
|
+
- !ruby/object:Gem::Dependency
|
214
|
+
name: drb
|
173
215
|
requirement: !ruby/object:Gem::Requirement
|
174
216
|
requirements:
|
175
217
|
- - ">="
|
@@ -182,6 +224,62 @@ dependencies:
|
|
182
224
|
- - ">="
|
183
225
|
- !ruby/object:Gem::Version
|
184
226
|
version: '0'
|
227
|
+
- !ruby/object:Gem::Dependency
|
228
|
+
name: logger
|
229
|
+
requirement: !ruby/object:Gem::Requirement
|
230
|
+
requirements:
|
231
|
+
- - ">="
|
232
|
+
- !ruby/object:Gem::Version
|
233
|
+
version: '0'
|
234
|
+
type: :runtime
|
235
|
+
prerelease: false
|
236
|
+
version_requirements: !ruby/object:Gem::Requirement
|
237
|
+
requirements:
|
238
|
+
- - ">="
|
239
|
+
- !ruby/object:Gem::Version
|
240
|
+
version: '0'
|
241
|
+
- !ruby/object:Gem::Dependency
|
242
|
+
name: ostruct
|
243
|
+
requirement: !ruby/object:Gem::Requirement
|
244
|
+
requirements:
|
245
|
+
- - ">="
|
246
|
+
- !ruby/object:Gem::Version
|
247
|
+
version: '0'
|
248
|
+
type: :runtime
|
249
|
+
prerelease: false
|
250
|
+
version_requirements: !ruby/object:Gem::Requirement
|
251
|
+
requirements:
|
252
|
+
- - ">="
|
253
|
+
- !ruby/object:Gem::Version
|
254
|
+
version: '0'
|
255
|
+
- !ruby/object:Gem::Dependency
|
256
|
+
name: ruby2_keywords
|
257
|
+
requirement: !ruby/object:Gem::Requirement
|
258
|
+
requirements:
|
259
|
+
- - ">="
|
260
|
+
- !ruby/object:Gem::Version
|
261
|
+
version: '0'
|
262
|
+
type: :runtime
|
263
|
+
prerelease: false
|
264
|
+
version_requirements: !ruby/object:Gem::Requirement
|
265
|
+
requirements:
|
266
|
+
- - ">="
|
267
|
+
- !ruby/object:Gem::Version
|
268
|
+
version: '0'
|
269
|
+
- !ruby/object:Gem::Dependency
|
270
|
+
name: appraisal
|
271
|
+
requirement: !ruby/object:Gem::Requirement
|
272
|
+
requirements:
|
273
|
+
- - ">="
|
274
|
+
- !ruby/object:Gem::Version
|
275
|
+
version: '0'
|
276
|
+
type: :development
|
277
|
+
prerelease: false
|
278
|
+
version_requirements: !ruby/object:Gem::Requirement
|
279
|
+
requirements:
|
280
|
+
- - ">="
|
281
|
+
- !ruby/object:Gem::Version
|
282
|
+
version: '0'
|
185
283
|
- !ruby/object:Gem::Dependency
|
186
284
|
name: webrick
|
187
285
|
requirement: !ruby/object:Gem::Requirement
|
@@ -231,9 +329,9 @@ dependencies:
|
|
231
329
|
- - ">"
|
232
330
|
- !ruby/object:Gem::Version
|
233
331
|
version: '3'
|
234
|
-
- - "
|
332
|
+
- - "<"
|
235
333
|
- !ruby/object:Gem::Version
|
236
|
-
version: '7'
|
334
|
+
version: '7.1'
|
237
335
|
type: :development
|
238
336
|
prerelease: false
|
239
337
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -241,9 +339,9 @@ dependencies:
|
|
241
339
|
- - ">"
|
242
340
|
- !ruby/object:Gem::Version
|
243
341
|
version: '3'
|
244
|
-
- - "
|
342
|
+
- - "<"
|
245
343
|
- !ruby/object:Gem::Version
|
246
|
-
version: '7'
|
344
|
+
version: '7.1'
|
247
345
|
- !ruby/object:Gem::Dependency
|
248
346
|
name: devise
|
249
347
|
requirement: !ruby/object:Gem::Requirement
|
@@ -272,9 +370,11 @@ executables:
|
|
272
370
|
extensions: []
|
273
371
|
extra_rdoc_files: []
|
274
372
|
files:
|
275
|
-
- ".
|
373
|
+
- ".devcontainer/devcontainer.json"
|
276
374
|
- ".github/workflows/check_changelog.yml"
|
375
|
+
- ".github/workflows/ci.yml"
|
277
376
|
- ".gitignore"
|
377
|
+
- Appraisals
|
278
378
|
- CHANGELOG.md
|
279
379
|
- Gemfile
|
280
380
|
- README.md
|
@@ -286,7 +386,10 @@ files:
|
|
286
386
|
- gemfiles/rails_5_2.gemfile
|
287
387
|
- gemfiles/rails_6_0.gemfile
|
288
388
|
- gemfiles/rails_6_1.gemfile
|
289
|
-
- gemfiles/
|
389
|
+
- gemfiles/rails_7_0.gemfile
|
390
|
+
- gemfiles/rails_7_1.gemfile
|
391
|
+
- gemfiles/rails_7_2.gemfile
|
392
|
+
- gemfiles/rails_head.gemfile
|
290
393
|
- lib/derailed_benchmarks.rb
|
291
394
|
- lib/derailed_benchmarks/auth_helper.rb
|
292
395
|
- lib/derailed_benchmarks/auth_helpers/devise.rb
|
@@ -326,6 +429,7 @@ files:
|
|
326
429
|
- test/rails_app/app/controllers/application_controller.rb
|
327
430
|
- test/rails_app/app/controllers/authenticated_controller.rb
|
328
431
|
- test/rails_app/app/controllers/pages_controller.rb
|
432
|
+
- test/rails_app/app/controllers/users_controller.rb
|
329
433
|
- test/rails_app/app/helpers/application_helper.rb
|
330
434
|
- test/rails_app/app/helpers/authenticated_helper.rb
|
331
435
|
- test/rails_app/app/models/user.rb
|
@@ -368,7 +472,7 @@ files:
|
|
368
472
|
- test/rails_app/script/rails
|
369
473
|
- test/support/integration_case.rb
|
370
474
|
- test/test_helper.rb
|
371
|
-
homepage: https://github.com/
|
475
|
+
homepage: https://github.com/zombocom/derailed_benchmarks
|
372
476
|
licenses:
|
373
477
|
- MIT
|
374
478
|
metadata: {}
|
@@ -387,7 +491,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
387
491
|
- !ruby/object:Gem::Version
|
388
492
|
version: '0'
|
389
493
|
requirements: []
|
390
|
-
rubygems_version: 3.
|
494
|
+
rubygems_version: 3.5.9
|
391
495
|
signing_key:
|
392
496
|
specification_version: 4
|
393
497
|
summary: Benchmarks designed to performance test your ENTIRE site
|
@@ -417,6 +521,7 @@ test_files:
|
|
417
521
|
- test/rails_app/app/controllers/application_controller.rb
|
418
522
|
- test/rails_app/app/controllers/authenticated_controller.rb
|
419
523
|
- test/rails_app/app/controllers/pages_controller.rb
|
524
|
+
- test/rails_app/app/controllers/users_controller.rb
|
420
525
|
- test/rails_app/app/helpers/application_helper.rb
|
421
526
|
- test/rails_app/app/helpers/authenticated_helper.rb
|
422
527
|
- test/rails_app/app/models/user.rb
|
data/.circleci/config.yml
DELETED
@@ -1,75 +0,0 @@
|
|
1
|
-
version: 2.1
|
2
|
-
orbs:
|
3
|
-
ruby: circleci/ruby@1.1.2
|
4
|
-
references:
|
5
|
-
run_tests: &run_tests
|
6
|
-
run:
|
7
|
-
name: Run test suite
|
8
|
-
command: bundle exec rake test
|
9
|
-
# Needed because tests execute raw git commands
|
10
|
-
set_git_config: &set_git_config
|
11
|
-
run:
|
12
|
-
name: Set Git config
|
13
|
-
command: git config --global user.email "you@example.com"; git config --global user.name "Your Name"
|
14
|
-
restore: &restore
|
15
|
-
restore_cache:
|
16
|
-
keys:
|
17
|
-
- v1_bundler_deps-{{ .Environment.CIRCLE_JOB }}
|
18
|
-
save: &save
|
19
|
-
save_cache:
|
20
|
-
paths:
|
21
|
-
- ./vendor/bundle
|
22
|
-
key: v1_bundler_deps-{{ .Environment.CIRCLE_JOB }} # CIRCLE_JOB e.g. "ruby-2.5"
|
23
|
-
bundle: &bundle
|
24
|
-
run:
|
25
|
-
name: install dependencies
|
26
|
-
command: |
|
27
|
-
echo "export BUNDLE_JOBS=4" >> $BASH_ENV
|
28
|
-
echo "export BUNDLE_RETRY=3" >> $BASH_ENV
|
29
|
-
echo "export BUNDLE_PATH=$(pwd)/vendor/bundle" >> $BASH_ENV
|
30
|
-
echo "export BUNDLE_GEMFILE=$(pwd)/gemfiles/$GEMFILE_NAME" >> $BASH_ENV
|
31
|
-
source $BASH_ENV
|
32
|
-
|
33
|
-
bundle install
|
34
|
-
bundle update
|
35
|
-
bundle clean
|
36
|
-
mysteps: &mysteps
|
37
|
-
steps:
|
38
|
-
- checkout
|
39
|
-
- <<: *set_git_config
|
40
|
-
- <<: *restore
|
41
|
-
- <<: *bundle
|
42
|
-
- <<: *run_tests
|
43
|
-
- <<: *save
|
44
|
-
|
45
|
-
jobs:
|
46
|
-
test:
|
47
|
-
parameters:
|
48
|
-
ruby_version:
|
49
|
-
type: string
|
50
|
-
gemfile:
|
51
|
-
type: string
|
52
|
-
docker:
|
53
|
-
- image: "ruby:<< parameters.ruby_version >>"
|
54
|
-
environment:
|
55
|
-
GEMFILE_NAME: <<parameters.gemfile>>
|
56
|
-
steps:
|
57
|
-
- checkout
|
58
|
-
- <<: *set_git_config
|
59
|
-
- <<: *restore
|
60
|
-
- <<: *bundle
|
61
|
-
- <<: *run_tests
|
62
|
-
- <<: *save
|
63
|
-
|
64
|
-
workflows:
|
65
|
-
all-tests:
|
66
|
-
jobs:
|
67
|
-
- test:
|
68
|
-
matrix:
|
69
|
-
parameters:
|
70
|
-
ruby_version: ["2.5.8", "2.7.2", "3.0.0"]
|
71
|
-
gemfile: ["rails_5_2.gemfile", "rails_6_1.gemfile", "rails_git.gemfile"]
|
72
|
-
exclude:
|
73
|
-
- ruby_version: "3.0.0"
|
74
|
-
gemfile: rails_5_2.gemfile
|
75
|
-
name: test-ruby-<<matrix.ruby_version>>-<<matrix.gemfile>>
|