benchmark_driver 0.10.2 → 0.10.3

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: 10ccc5d34405f81e882bed9f77adfc6e787dbaeb7d2a5ceed043724b826faeb1
4
- data.tar.gz: 8a953719f6ff01c591153bde8aae1f59194c4447357d240596713a95f35c2fee
3
+ metadata.gz: a01e7df6105386d49b39a54c519f88b35026ed82d58ff9b116a4fdc5efb321e5
4
+ data.tar.gz: 34dd0f4a146931a01cf0a3f16506a3d077a62a8ae7000f600a6db8a0af507c74
5
5
  SHA512:
6
- metadata.gz: 42f10df5f1c2e7f4088e8cc9e8558342ecd401e2535e97f29c7a27b7c167db59607ced9adaa6984d287f18536ab2ba90ffd7ef2507a71946155ac21479369774
7
- data.tar.gz: c3f168d36de1803de0241cc38da15071d88e6aed39c07b458adffa47a79b401c584e87d147e69df6fa23b2ddf1f36268b484553f94e3672292839b94186e75bb
6
+ metadata.gz: 01c6b2070e29d77c444d5556aef4412938421fad38e0f54eacd5ad5ec7719bf7d89c697caafc306141694a500f639e1848d279fd585caad1ed5b06e8e0ffa695
7
+ data.tar.gz: 44e9353d54b7f14532dfd992bb1cf33bf33d8452eb69f90b73e0aaf6d5526402b5369eb2793aa523bf6b23137985052f5a3754ab16d28e31e457ac8c955a8e3b
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ # v0.10.3
2
+
3
+ - Allow specifying name in `--rbenv`
4
+ - Don't print stderr in "command\_stdout" runner
5
+
1
6
  # v0.10.2
2
7
 
3
8
  - Optionalize `working_directory` of "command\_stdout" runner
data/exe/benchmark-driver CHANGED
@@ -23,17 +23,20 @@ config = BenchmarkDriver::Config.new.tap do |c|
23
23
  abort '--executable must take argument but not given' if e.nil?
24
24
  e.split(';').each do |name_path|
25
25
  name, path = name_path.split('::', 2)
26
- command = (path || name).split(',') # if `::` is not given, regard whole string as path
26
+ path ||= name # if `::` is not given, regard whole string as path
27
+ command = path.split(',')
27
28
  command[0] = File.expand_path(command[0])
28
29
  executables << BenchmarkDriver::Config::Executable.new(name: name, command: command)
29
30
  end
30
31
  end
31
32
  o.on('--rbenv [VERSIONS]', 'Ruby executables in rbenv (x.x.x,arg1,...;y.y.y,arg2,...;...)') do |r|
32
33
  abort '--rbenv must take argument but not given' if r.nil?
33
- r.split(';').each do |spec|
34
+ r.split(';').each do |full_spec|
35
+ name, spec = full_spec.split('::', 2)
36
+ spec ||= name # if `::` is not given, regard whole string as spec
34
37
  version, *args = spec.split(',')
35
38
  executables << BenchmarkDriver::Config::Executable.new(
36
- name: spec,
39
+ name: name,
37
40
  command: [BenchmarkDriver::Rbenv.ruby_path(version), *args],
38
41
  )
39
42
  end
@@ -2,6 +2,7 @@ require 'benchmark_driver/struct'
2
2
  require 'benchmark_driver/metrics'
3
3
  require 'tempfile'
4
4
  require 'shellwords'
5
+ require 'open3'
5
6
 
6
7
  # Run only once, for testing
7
8
  class BenchmarkDriver::Runner::CommandStdout
@@ -91,9 +92,9 @@ class BenchmarkDriver::Runner::CommandStdout
91
92
  end
92
93
 
93
94
  def execute(*args)
94
- stdout = IO.popen(args, &:read)
95
- unless $?.success?
96
- raise "Failed to execute: #{args.shelljoin} (status: #{$?.exitstatus})"
95
+ stdout, stderr, status = Open3.capture3(*args)
96
+ unless status.success?
97
+ raise "Failed to execute: #{args.shelljoin} (status: #{$?.exitstatus}):\n[stdout]:\n#{stdout}\n[stderr]:\n#{stderr}"
97
98
  end
98
99
  stdout
99
100
  end
@@ -1,3 +1,3 @@
1
1
  module BenchmarkDriver
2
- VERSION = '0.10.2'
2
+ VERSION = '0.10.3'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: benchmark_driver
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.2
4
+ version: 0.10.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takashi Kokubun