Skip to content
Browse files

Introduce exit status in stream protocol.

Change-Id: I5d6f72d1be27ca14d8d92b01805310031701de17
  • Loading branch information...
1 parent 3cbbf7d commit fbe1384c9e47cbe84220e2f416386986e9bf67b3 @kowshik kowshik committed
View
5 warden-client/lib/warden/client/v1.rb
@@ -123,10 +123,7 @@ def self.convert_stream_request(args)
end
def self.convert_stream_response(response)
- to_return = []
- to_return << response.name if response.name
- to_return << response.data if response.data
- to_return
+ [response.name, response.data, response.exit_status]
end
def self.convert_run_request(args)
View
2 warden-client/lib/warden/client/version.rb
@@ -1,5 +1,5 @@
module Warden
class Client
- VERSION = "0.0.4"
+ VERSION = "0.0.5"
end
end
View
11 warden-client/spec/client/v1_spec.rb
@@ -218,22 +218,19 @@ def to_response(response)
end
describe "response" do
- it "should return a 2-element tuple" do
+ it "should return a 3-element tuple" do
response = to_response \
Warden::Protocol::StreamResponse.new(
:name => "stdout",
- :data => "data"
+ :data => "data",
+ :exit_status => 25,
)
response[0].should == "stdout"
response[1].should == "data"
+ response[2].should == 25
end
end
-
- it "should return an empty tuple when streaming stops" do
- response = to_response Warden::Protocol::StreamResponse.new
- response.size.should == 0
- end
end
describe "run" do
View
2 warden-protocol/Gemfile
@@ -2,3 +2,5 @@ source 'https://rubygems.org'
# Specify your gem's dependencies in warden-protocol.gemspec
gemspec
+
+gem 'rake'
View
1 warden-protocol/lib/warden/protocol/stream.rb
@@ -12,6 +12,7 @@ class StreamRequest < BaseRequest
class StreamResponse < BaseResponse
optional :name, :string, 1
optional :data, :string, 2
+ optional :exit_status, :uint32, 3
end
end
end
View
2 warden-protocol/lib/warden/protocol/version.rb
@@ -2,6 +2,6 @@
module Warden
module Protocol
- VERSION = "0.0.3"
+ VERSION = "0.0.4"
end
end
View
5 warden-protocol/spec/stream_spec.rb
@@ -50,4 +50,9 @@
it_should_be_optional
it_should_be_typed_as_string
end
+
+ field :exit_status do
+ it_should_be_optional
+ it_should_be_typed_as_uint
+ end
end

0 comments on commit fbe1384

Please sign in to comment.
Something went wrong with that request. Please try again.