benchmark_driver 0.10.2 → 0.10.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/exe/benchmark-driver +6 -3
- data/lib/benchmark_driver/runner/command_stdout.rb +4 -3
- data/lib/benchmark_driver/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a01e7df6105386d49b39a54c519f88b35026ed82d58ff9b116a4fdc5efb321e5
|
4
|
+
data.tar.gz: 34dd0f4a146931a01cf0a3f16506a3d077a62a8ae7000f600a6db8a0af507c74
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01c6b2070e29d77c444d5556aef4412938421fad38e0f54eacd5ad5ec7719bf7d89c697caafc306141694a500f639e1848d279fd585caad1ed5b06e8e0ffa695
|
7
|
+
data.tar.gz: 44e9353d54b7f14532dfd992bb1cf33bf33d8452eb69f90b73e0aaf6d5526402b5369eb2793aa523bf6b23137985052f5a3754ab16d28e31e457ac8c955a8e3b
|
data/CHANGELOG.md
CHANGED
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
|
-
|
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 |
|
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:
|
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 =
|
95
|
-
unless
|
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
|