benchmark_driver 0.15.18 → 0.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/test.yml +36 -0
- data/CHANGELOG.md +6 -0
- data/README.md +1 -1
- data/benchmark_driver.gemspec +1 -1
- data/exe/benchmark-driver +19 -11
- data/lib/benchmark_driver/config.rb +1 -1
- data/lib/benchmark_driver/version.rb +1 -1
- metadata +5 -5
- data/.travis.yml +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c01422dfa4032a839397f7151e374767d0596292930e83a132ce934c7734e0b4
|
4
|
+
data.tar.gz: ef5ddc5dec5813f662e46f6bccc12910ad74279b12e76c4680240973d04b392f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6fc200972891784176499cc685a10c6e823982d004fc1c068cb0beccdaa7eabade24da867f3b72f92c8d2db3af9b33bee1a122262d13a962ee19a2b36d2df20
|
7
|
+
data.tar.gz: d779167efb7516daba05bdb79b0a332ac6896c7717c70d550a788a7855b50e919d60f7c1ba2ebddfcb857d80bd83e5d716ef6a0807ed373b2065264ef9996f67
|
@@ -0,0 +1,36 @@
|
|
1
|
+
name: test
|
2
|
+
on:
|
3
|
+
push:
|
4
|
+
branches:
|
5
|
+
- master
|
6
|
+
pull_request:
|
7
|
+
types:
|
8
|
+
- opened
|
9
|
+
- synchronize
|
10
|
+
- reopened
|
11
|
+
schedule:
|
12
|
+
- cron: "00 15 * * *"
|
13
|
+
jobs:
|
14
|
+
test:
|
15
|
+
runs-on: ubuntu-latest
|
16
|
+
strategy:
|
17
|
+
matrix:
|
18
|
+
ruby:
|
19
|
+
- '2.5'
|
20
|
+
- '2.6'
|
21
|
+
- '2.7'
|
22
|
+
- '3.0'
|
23
|
+
- '3.1'
|
24
|
+
fail-fast: false
|
25
|
+
steps:
|
26
|
+
- uses: actions/checkout@v2
|
27
|
+
- name: Set up Ruby
|
28
|
+
uses: ruby/setup-ruby@v1
|
29
|
+
with:
|
30
|
+
ruby-version: ${{ matrix.ruby }}
|
31
|
+
bundler-cache: true
|
32
|
+
- name: Install benchmark targets
|
33
|
+
run: |
|
34
|
+
gem install haml -v 4.0.7
|
35
|
+
gem install haml -v 5.0.4
|
36
|
+
- run: VERBOSE=1 bundle exec rake
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
data/benchmark_driver.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.bindir = 'exe'
|
20
20
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
21
|
spec.require_paths = ['lib']
|
22
|
-
spec.required_ruby_version = '>= 2.
|
22
|
+
spec.required_ruby_version = '>= 2.5.0'
|
23
23
|
|
24
24
|
spec.add_development_dependency 'bundler'
|
25
25
|
spec.add_development_dependency 'rake'
|
data/exe/benchmark-driver
CHANGED
@@ -87,11 +87,11 @@ config = BenchmarkDriver::Config.new.tap do |c|
|
|
87
87
|
end
|
88
88
|
end
|
89
89
|
begin
|
90
|
-
c.
|
90
|
+
c.args = parser.parse!(ARGV)
|
91
91
|
rescue OptionParser::InvalidArgument => e
|
92
92
|
abort e.message
|
93
93
|
end
|
94
|
-
if c.
|
94
|
+
if c.args.empty?
|
95
95
|
abort "No YAML file is specified!\n\n#{parser.help}"
|
96
96
|
end
|
97
97
|
|
@@ -112,24 +112,32 @@ config = BenchmarkDriver::Config.new.tap do |c|
|
|
112
112
|
end
|
113
113
|
|
114
114
|
# Parse benchmark job definitions
|
115
|
-
jobs = config.
|
115
|
+
jobs = config.args.flat_map do |arg|
|
116
116
|
job = { 'type' => config.runner_type }
|
117
117
|
|
118
|
-
#
|
119
|
-
|
120
|
-
|
121
|
-
|
118
|
+
# Three types of input:
|
119
|
+
# * YAML file (*.yml, *.yaml): a regular benchmark with various params
|
120
|
+
# * Ruby file (*.rb): a single-execution benchmark
|
121
|
+
# * Ruby inline (any other argument): a multi-execution benchmark
|
122
|
+
if arg.end_with?('.yml') || arg.end_with?('.yaml')
|
123
|
+
yaml = File.read(arg)
|
124
|
+
job.merge!(YAML.respond_to?(:unsafe_load) ? YAML.unsafe_load(yaml) : YAML.load(yaml))
|
125
|
+
elsif arg.end_with?('.rb')
|
126
|
+
name = File.basename(arg).sub(/\.rb\z/, '')
|
127
|
+
script = File.read(arg)
|
122
128
|
prelude = script.slice!(/\A(^#[^\n]+\n)+/m) || '' # preserve magic comment
|
123
129
|
job.merge!('prelude' => prelude, 'benchmark' => { name => script }, 'loop_count' => 1)
|
124
|
-
else
|
125
|
-
job.merge!(
|
130
|
+
else # Ruby inline
|
131
|
+
job.merge!('benchmark' => { arg => arg })
|
132
|
+
working_directory = Dir.pwd
|
126
133
|
end
|
134
|
+
working_directory ||= File.expand_path(File.dirname(arg))
|
127
135
|
|
128
136
|
begin
|
129
137
|
# `working_directory` is YAML-specific special parameter, mainly for "command_stdout"
|
130
|
-
BenchmarkDriver::JobParser.parse(job, working_directory:
|
138
|
+
BenchmarkDriver::JobParser.parse(job, working_directory: working_directory)
|
131
139
|
rescue ArgumentError
|
132
|
-
$stderr.puts "benchmark-driver: Failed to parse #{
|
140
|
+
$stderr.puts "benchmark-driver: Failed to parse #{arg.dump}."
|
133
141
|
$stderr.puts ' YAML format may be wrong. See error below:'
|
134
142
|
$stderr.puts
|
135
143
|
raise
|
@@ -8,7 +8,7 @@ module BenchmarkDriver
|
|
8
8
|
:runner_type, # @param [String]
|
9
9
|
:output_type, # @param [String]
|
10
10
|
:output_opts, # @param [Hash{ Symbol => Object }]
|
11
|
-
:
|
11
|
+
:args, # @param [Array<String>]
|
12
12
|
:executables, # @param [Array<BenchmarkDriver::Config::Executable>]
|
13
13
|
:filters, # @param [Array<Regexp>]
|
14
14
|
:repeat_count, # @param [Integer]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: benchmark_driver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.16.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takashi Kokubun
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-11-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -74,9 +74,9 @@ executables:
|
|
74
74
|
extensions: []
|
75
75
|
extra_rdoc_files: []
|
76
76
|
files:
|
77
|
+
- ".github/workflows/test.yml"
|
77
78
|
- ".gitignore"
|
78
79
|
- ".rspec"
|
79
|
-
- ".travis.yml"
|
80
80
|
- CHANGELOG.md
|
81
81
|
- Gemfile
|
82
82
|
- LICENSE.txt
|
@@ -139,14 +139,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
139
139
|
requirements:
|
140
140
|
- - ">="
|
141
141
|
- !ruby/object:Gem::Version
|
142
|
-
version: 2.
|
142
|
+
version: 2.5.0
|
143
143
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
144
144
|
requirements:
|
145
145
|
- - ">="
|
146
146
|
- !ruby/object:Gem::Version
|
147
147
|
version: '0'
|
148
148
|
requirements: []
|
149
|
-
rubygems_version: 3.
|
149
|
+
rubygems_version: 3.3.7
|
150
150
|
signing_key:
|
151
151
|
specification_version: 4
|
152
152
|
summary: Fully-featured accurate benchmark driver for Ruby
|
data/.travis.yml
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
rvm:
|
3
|
-
- 2.3.8
|
4
|
-
- 2.4.9
|
5
|
-
- 2.5.7
|
6
|
-
- 2.6.5
|
7
|
-
- 2.7.0
|
8
|
-
- ruby-head
|
9
|
-
matrix:
|
10
|
-
allow_failures:
|
11
|
-
- rvm: ruby-head
|
12
|
-
cache: bundler
|
13
|
-
branches:
|
14
|
-
only:
|
15
|
-
- master
|
16
|
-
before_install:
|
17
|
-
- gem install bundler -v 1.15.4
|
18
|
-
- gem install haml -v 4.0.7
|
19
|
-
- gem install haml -v 5.0.4
|
20
|
-
script:
|
21
|
-
- VERBOSE=1 bundle exec rake
|