rrrspec-client 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rrrspec/client/cli.rb +3 -2
- data/lib/rrrspec/client/slave_runner.rb +4 -0
- data/lib/rrrspec/client/support.rb +28 -6
- data/lib/rrrspec/client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42574e076b04542d0eecc44df4febbd998269773
|
4
|
+
data.tar.gz: f9a29a0cb9f874a766368a881aafb83286f61ffb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 95afaea9791ba051201805f13bd390138183f12990c1b1214b251533edba3067bd33848c3f1adb36d4ee784e6598db6ca2a8a32dcb9927749a7936083606be20
|
7
|
+
data.tar.gz: 64937c8e6eea66d34f45df44f550c0f65e298a403e69d86d0600b86be1b1662af7ca2709309d10aa0aa0c9672ff69cbba4fd252e974ef196025f06d70a78d6cc
|
data/lib/rrrspec/client/cli.rb
CHANGED
@@ -114,12 +114,13 @@ module RRRSpec
|
|
114
114
|
|
115
115
|
option :'failure-exit-code', type: :numeric, default: 1
|
116
116
|
option :verbose, type: :boolean, default: false
|
117
|
+
option :'show-errors', type: :boolean, default: false
|
117
118
|
desc 'show', 'show the result of the taskset'
|
118
119
|
def show(taskset_id)
|
119
120
|
setup(Configuration.new)
|
120
121
|
taskset = Taskset.new(taskset_id)
|
121
122
|
exit 1 unless taskset.exist?
|
122
|
-
Support.show_result(taskset, options[:verbose])
|
123
|
+
Support.show_result(taskset, options[:verbose], options[:'show-errors'])
|
123
124
|
|
124
125
|
if taskset.status != 'succeeded'
|
125
126
|
exit options[:'failure-exit-code']
|
@@ -128,7 +129,7 @@ module RRRSpec
|
|
128
129
|
|
129
130
|
desc 'slave', 'run RRRSpec as a slave'
|
130
131
|
def slave(working_dir=nil, taskset_key=nil)
|
131
|
-
$0 =
|
132
|
+
$0 = "rrrspec slave[#{ENV['SLAVE_NUMBER']}]"
|
132
133
|
working_dir ||= ENV['RRRSPEC_WORKING_DIR']
|
133
134
|
taskset_key ||= ENV['RRRSPEC_TASKSET_KEY']
|
134
135
|
exit 1 unless taskset_key && working_dir
|
@@ -58,6 +58,7 @@ module RRRSpec
|
|
58
58
|
trial = Trial.create(task, @slave)
|
59
59
|
|
60
60
|
@rspec_runner.reset
|
61
|
+
$0 = "rrrspec slave[#{ENV['SLAVE_NUMBER']}]: setting up #{task.spec_file}"
|
61
62
|
status, outbuf, errbuf = @rspec_runner.setup(File.join(@working_path, task.spec_file))
|
62
63
|
unless status
|
63
64
|
trial.finish('error', outbuf, errbuf, nil, nil, nil)
|
@@ -69,6 +70,7 @@ module RRRSpec
|
|
69
70
|
|
70
71
|
formatter = RedisReportingFormatter
|
71
72
|
trial.start
|
73
|
+
$0 = "rrrspec slave[#{ENV['SLAVE_NUMBER']}]: running #{task.spec_file}"
|
72
74
|
status, outbuf, errbuf = ExtremeTimeout::timeout(
|
73
75
|
hard_timeout_sec, TIMEOUT_EXITCODE
|
74
76
|
) do
|
@@ -85,6 +87,8 @@ module RRRSpec
|
|
85
87
|
|
86
88
|
ArbiterQueue.trial(trial)
|
87
89
|
end
|
90
|
+
ensure
|
91
|
+
$0 = "rrrspec slave[#{ENV['SLAVE_NUMBER']}]"
|
88
92
|
end
|
89
93
|
|
90
94
|
class RedisReportingFormatter
|
@@ -40,7 +40,29 @@ module RRRSpec
|
|
40
40
|
return taskset
|
41
41
|
end
|
42
42
|
|
43
|
-
def show_result(taskset, verbose=false)
|
43
|
+
def show_result(taskset, verbose=false, show_errors=false)
|
44
|
+
if show_errors
|
45
|
+
puts "Failed Tasks:\n\n"
|
46
|
+
taskset.tasks.each do |task|
|
47
|
+
if task.status == "failed"
|
48
|
+
trial = task.trials.detect { |t| t.status == "failed" }
|
49
|
+
stdout = trial.stdout
|
50
|
+
puts "Task: #{task.spec_file}\n\n"
|
51
|
+
unless stdout.blank?
|
52
|
+
puts "\tSTDOUT:"
|
53
|
+
stdout.each_line { |line| puts "\t#{line}" }
|
54
|
+
end
|
55
|
+
stderr = trial.stderr
|
56
|
+
unless stderr.blank?
|
57
|
+
puts "STDERR:"
|
58
|
+
stderr.each_line { |line| puts "\t#{line}" }
|
59
|
+
end
|
60
|
+
puts "\n"
|
61
|
+
end
|
62
|
+
end
|
63
|
+
puts
|
64
|
+
end
|
65
|
+
|
44
66
|
puts "Status: #{taskset.status}"
|
45
67
|
puts "Created: #{taskset.created_at}"
|
46
68
|
puts "Finished: #{taskset.finished_at}"
|
@@ -52,7 +74,7 @@ module RRRSpec
|
|
52
74
|
puts
|
53
75
|
|
54
76
|
puts "Log:"
|
55
|
-
taskset.log.
|
77
|
+
taskset.log.each_line { |line| puts "\t#{line}" }
|
56
78
|
puts
|
57
79
|
|
58
80
|
puts "Workers:"
|
@@ -63,7 +85,7 @@ module RRRSpec
|
|
63
85
|
puts "\tSetup Finished: #{worker_log.setup_finished_at}"
|
64
86
|
puts "\tFinished: #{worker_log.finished_at}"
|
65
87
|
puts "\tLog:"
|
66
|
-
worker_log.log.
|
88
|
+
worker_log.log.each_line { |line| puts "\t\t#{line}" }
|
67
89
|
end
|
68
90
|
puts
|
69
91
|
|
@@ -76,7 +98,7 @@ module RRRSpec
|
|
76
98
|
puts "\t\t#{trial.key}"
|
77
99
|
end
|
78
100
|
puts "\tLog:"
|
79
|
-
slave.log.
|
101
|
+
slave.log.each_line { |line| puts "\t\t#{line}" }
|
80
102
|
end
|
81
103
|
puts
|
82
104
|
|
@@ -98,12 +120,12 @@ module RRRSpec
|
|
98
120
|
stdout = trial.stdout
|
99
121
|
if stdout
|
100
122
|
puts "\t\tSTDOUT:"
|
101
|
-
stdout.
|
123
|
+
stdout.each_line { |line| puts "\t\t\t#{line}" }
|
102
124
|
end
|
103
125
|
stderr = trial.stderr
|
104
126
|
if stderr
|
105
127
|
puts "\t\tSTDERR:"
|
106
|
-
stderr.
|
128
|
+
stderr.each_line { |line| puts "\t\t\t#{line}" }
|
107
129
|
end
|
108
130
|
end
|
109
131
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rrrspec-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masaya Suzuki
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|