gorgon 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +2 -2
- data/lib/gorgon/originator_logger.rb +2 -2
- data/lib/gorgon/version.rb +1 -1
- data/spec/listener_spec.rb +4 -6
- data/spec/originator_logger_spec.rb +8 -5
- data/spec/originator_protocol_spec.rb +2 -2
- metadata +8 -2
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
gorgon (0.6.
|
4
|
+
gorgon (0.6.1)
|
5
5
|
amqp (~> 0.9.7)
|
6
6
|
awesome_print
|
7
7
|
colorize (~> 0.5.8)
|
@@ -21,7 +21,7 @@ GEM
|
|
21
21
|
amq-client (~> 0.9.12)
|
22
22
|
amq-protocol (~> 1.2.0)
|
23
23
|
eventmachine
|
24
|
-
awesome_print (1.
|
24
|
+
awesome_print (1.2.0)
|
25
25
|
colorize (0.5.8)
|
26
26
|
diff-lcs (1.1.3)
|
27
27
|
eventmachine (1.0.3)
|
@@ -9,7 +9,7 @@ class OriginatorLogger
|
|
9
9
|
|
10
10
|
def log_message(payload)
|
11
11
|
if payload[:action] == "start"
|
12
|
-
log("Started running '#{payload[:filename]}' at '#{payload[:hostname]}'")
|
12
|
+
log("Started running '#{payload[:filename]}' at '#{payload[:hostname]}:#{payload[:worker_id]}'")
|
13
13
|
elsif payload[:action] == "finish"
|
14
14
|
print_finish(payload)
|
15
15
|
elsif payload[:type] == "crash" || payload[:type] == "exception"
|
@@ -23,7 +23,7 @@ class OriginatorLogger
|
|
23
23
|
private
|
24
24
|
|
25
25
|
def print_finish(payload)
|
26
|
-
msg = "Finished running '#{payload[:filename]}' at '#{payload[:hostname]}'"
|
26
|
+
msg = "Finished running '#{payload[:filename]}' at '#{payload[:hostname]}:#{payload[:worker_id]}'"
|
27
27
|
msg << failure_message(payload[:failures]) if payload[:type] == "fail"
|
28
28
|
log msg
|
29
29
|
end
|
data/lib/gorgon/version.rb
CHANGED
data/spec/listener_spec.rb
CHANGED
@@ -97,8 +97,8 @@ describe Listener do
|
|
97
97
|
|
98
98
|
describe "#poll" do
|
99
99
|
|
100
|
-
let(:empty_queue) {
|
101
|
-
let(:job_payload) {
|
100
|
+
let(:empty_queue) { [nil, nil, nil] }
|
101
|
+
let(:job_payload) { [nil, nil, Yajl::Encoder.encode({:type => "job_definition"})] }
|
102
102
|
before do
|
103
103
|
listener.stub(:run_job)
|
104
104
|
end
|
@@ -135,9 +135,7 @@ describe Listener do
|
|
135
135
|
end
|
136
136
|
|
137
137
|
context "ping message pending on queue" do
|
138
|
-
let(:ping_payload) {{
|
139
|
-
:payload => Yajl::Encoder.encode({:type => "ping", :reply_exchange_name => "name",
|
140
|
-
:body => {}}) }}
|
138
|
+
let(:ping_payload) { [nil, nil, Yajl::Encoder.encode({:type => "ping", :reply_exchange_name => "name", :body => {}}) ] }
|
141
139
|
|
142
140
|
before do
|
143
141
|
queue.stub!(:pop => ping_payload)
|
@@ -165,7 +163,7 @@ describe Listener do
|
|
165
163
|
let(:gem_command_handler) { stub("GemCommandHandler", :handle => nil) }
|
166
164
|
let(:configuration) { {:worker_slots => 3} }
|
167
165
|
before do
|
168
|
-
queue.stub!(:pop =>
|
166
|
+
queue.stub!(:pop => [nil, nil, Yajl::Encoder.encode(payload)])
|
169
167
|
listener.stub(:configuration).and_return(configuration)
|
170
168
|
end
|
171
169
|
|
@@ -11,16 +11,18 @@ describe OriginatorLogger do
|
|
11
11
|
it "prints start messages" do
|
12
12
|
payload = {:action => "start",
|
13
13
|
:hostname => "host",
|
14
|
-
:filename => "filename"
|
15
|
-
|
14
|
+
:filename => "filename",
|
15
|
+
:worker_id => "a_worker_id"}
|
16
|
+
originator_logger.should_receive(:log).with("Started running 'filename' at 'host:a_worker_id'")
|
16
17
|
originator_logger.log_message(payload)
|
17
18
|
end
|
18
19
|
|
19
20
|
it "prints finish messages" do
|
20
21
|
payload = {:action => "finish",
|
21
22
|
:hostname => "host",
|
22
|
-
:filename => "filename"
|
23
|
-
|
23
|
+
:filename => "filename",
|
24
|
+
:worker_id => "a_worker_id"}
|
25
|
+
originator_logger.should_receive(:log).with("Finished running 'filename' at 'host:a_worker_id'")
|
24
26
|
originator_logger.log_message(payload)
|
25
27
|
end
|
26
28
|
|
@@ -29,11 +31,12 @@ describe OriginatorLogger do
|
|
29
31
|
:type => "fail",
|
30
32
|
:hostname => "host",
|
31
33
|
:filename => "filename",
|
34
|
+
:worker_id => "a_worker_id",
|
32
35
|
:failures => [
|
33
36
|
"failure"
|
34
37
|
]}
|
35
38
|
|
36
|
-
originator_logger.should_receive(:log).with("Finished running 'filename' at 'host'failure\n")
|
39
|
+
originator_logger.should_receive(:log).with("Finished running 'filename' at 'host:a_worker_id'failure\n")
|
37
40
|
originator_logger.log_message(payload)
|
38
41
|
end
|
39
42
|
end
|
@@ -39,13 +39,13 @@ describe OriginatorProtocol do
|
|
39
39
|
|
40
40
|
it "opens a reply and exchange queue" do
|
41
41
|
UUIDTools::UUID.stub!(:timestamp_create).and_return 1
|
42
|
-
channel.should_receive(:queue).once.with("reply_queue_1")
|
42
|
+
channel.should_receive(:queue).once.with("reply_queue_1", :auto_delete => true)
|
43
43
|
@originator_p.connect @conn_information
|
44
44
|
end
|
45
45
|
|
46
46
|
it "opens a reply exchange and binds reply queue to it" do
|
47
47
|
UUIDTools::UUID.stub!(:timestamp_create).and_return 1
|
48
|
-
channel.should_receive(:direct).with("reply_exchange_1")
|
48
|
+
channel.should_receive(:direct).with("reply_exchange_1", :auto_delete => true)
|
49
49
|
queue.should_receive(:bind).with(exchange)
|
50
50
|
@originator_p.connect @conn_information
|
51
51
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gorgon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -322,15 +322,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
322
322
|
- - ! '>='
|
323
323
|
- !ruby/object:Gem::Version
|
324
324
|
version: '0'
|
325
|
+
segments:
|
326
|
+
- 0
|
327
|
+
hash: 337737538623619091
|
325
328
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
326
329
|
none: false
|
327
330
|
requirements:
|
328
331
|
- - ! '>='
|
329
332
|
- !ruby/object:Gem::Version
|
330
333
|
version: '0'
|
334
|
+
segments:
|
335
|
+
- 0
|
336
|
+
hash: 337737538623619091
|
331
337
|
requirements: []
|
332
338
|
rubyforge_project: gorgon
|
333
|
-
rubygems_version: 1.8.
|
339
|
+
rubygems_version: 1.8.25
|
334
340
|
signing_key:
|
335
341
|
specification_version: 3
|
336
342
|
summary: Distributed testing for ruby with centralized management
|