mortar 0.15.6 → 0.15.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/mortar/command/describe.rb +4 -1
- data/lib/mortar/command/illustrate.rb +4 -1
- data/lib/mortar/command/jobs.rb +2 -0
- data/lib/mortar/command/validate.rb +4 -1
- data/lib/mortar/project.rb +6 -0
- data/lib/mortar/version.rb +1 -1
- data/spec/mortar/command/base_spec.rb +3 -3
- data/spec/mortar/command/describe_spec.rb +4 -4
- data/spec/mortar/command/illustrate_spec.rb +7 -7
- data/spec/mortar/command/jobs_spec.rb +15 -3
- data/spec/mortar/command/validate_spec.rb +4 -4
- data/spec/mortar/project_spec.rb +2 -0
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YjQyM2RmYTBiYjJjNjI3NzA2NDkyMWM0ZmNjZmFkZTgwMGQxNDRkZQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YjY1ZDAzMjlmZjEzNTQyZDcwNjQ3ZjAyYmI0MDNlY2ZjNmQxMmY5MQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ODc3YWI0NDkwOGUyOTRlYjI0MzQ3MzgyYmY1MjA4MzBkNjEyZTM1YmUwZmM0
|
10
|
+
MTFjOTNlMmJhOGYxNTllMDhmODQ5MmE4N2ZjM2RjNDY2ZDY4ZTU5MGYxNjYz
|
11
|
+
ZWNjNzYyMTQ5NDc2ODRkM2QyMDE3MjAwOGNjYjg3MzhkYzQyYzA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ODU5MzE3YTRhYmZmMzEzNWVlMjdlZGViNmY3Mzk4MTJiMjE1MTBhNjNiYjUy
|
14
|
+
ZDUwNjM0NTM1OGY1MzgzM2QwODRlYWRhMmFhMWE4NjQxYTQ0Y2RiMTJjN2Fi
|
15
|
+
Zjg0MjQzNjNkZmE5Mjk1ODdjZDE3ZjJjNzYzMDMyOWUxNWY4YzY=
|
@@ -52,7 +52,10 @@ class Mortar::Command::Describe < Mortar::Command::Base
|
|
52
52
|
|
53
53
|
describe_id = nil
|
54
54
|
action("Starting describe") do
|
55
|
-
describe_id = api.post_describe(project.name, pigscript.name, alias_name, git_ref,
|
55
|
+
describe_id = api.post_describe(project.name, pigscript.name, alias_name, git_ref,
|
56
|
+
:pig_version => pig_version.version,
|
57
|
+
:project_script_path => pigscript.rel_path,
|
58
|
+
:parameters => pig_parameters).body["describe_id"]
|
56
59
|
end
|
57
60
|
|
58
61
|
describe_result = nil
|
@@ -57,7 +57,10 @@ class Mortar::Command::Illustrate < Mortar::Command::Base
|
|
57
57
|
|
58
58
|
illustrate_id = nil
|
59
59
|
action("Starting illustrate") do
|
60
|
-
illustrate_id = api.post_illustrate(project.name, pigscript.name, alias_name, skip_pruning, git_ref,
|
60
|
+
illustrate_id = api.post_illustrate(project.name, pigscript.name, alias_name, skip_pruning, git_ref,
|
61
|
+
:pig_version => pig_version.version,
|
62
|
+
:project_script_path => pigscript.rel_path,
|
63
|
+
:parameters => pig_parameters).body["illustrate_id"]
|
61
64
|
end
|
62
65
|
|
63
66
|
illustrate_result = nil
|
data/lib/mortar/command/jobs.rb
CHANGED
@@ -166,6 +166,7 @@ class Mortar::Command::Jobs < Mortar::Command::Base
|
|
166
166
|
use_spot_instances = options[:spot] || false
|
167
167
|
api.post_job_new_cluster(project_name, script_name, git_ref, cluster_size,
|
168
168
|
:pig_version => pig_version.version,
|
169
|
+
:project_script_path => script.rel_path,
|
169
170
|
:parameters => pig_parameters,
|
170
171
|
:cluster_type => cluster_type,
|
171
172
|
:notify_on_job_finish => notify_on_job_finish,
|
@@ -175,6 +176,7 @@ class Mortar::Command::Jobs < Mortar::Command::Base
|
|
175
176
|
cluster_id = options[:clusterid]
|
176
177
|
api.post_job_existing_cluster(project_name, script_name, git_ref, cluster_id,
|
177
178
|
:pig_version => pig_version.version,
|
179
|
+
:project_script_path => script.rel_path,
|
178
180
|
:parameters => pig_parameters,
|
179
181
|
:notify_on_job_finish => notify_on_job_finish,
|
180
182
|
:is_control_script => is_control_script).body
|
@@ -47,7 +47,10 @@ class Mortar::Command::Validate < Mortar::Command::Base
|
|
47
47
|
|
48
48
|
validate_id = nil
|
49
49
|
action("Starting validate") do
|
50
|
-
validate_id = api.post_validate(project.name, pigscript.name, git_ref,
|
50
|
+
validate_id = api.post_validate(project.name, pigscript.name, git_ref,
|
51
|
+
:pig_version => pig_version.version,
|
52
|
+
:project_script_path => pigscript.rel_path,
|
53
|
+
:parameters => pig_parameters).body["validate_id"]
|
51
54
|
end
|
52
55
|
|
53
56
|
validate_result = nil
|
data/lib/mortar/project.rb
CHANGED
@@ -15,6 +15,7 @@
|
|
15
15
|
#
|
16
16
|
|
17
17
|
require 'fileutils'
|
18
|
+
require 'pathname'
|
18
19
|
|
19
20
|
module Mortar
|
20
21
|
module Project
|
@@ -194,6 +195,11 @@ module Mortar
|
|
194
195
|
script_file.close
|
195
196
|
script_contents
|
196
197
|
end
|
198
|
+
|
199
|
+
def rel_path
|
200
|
+
p = Pathname.new(@path).dirname
|
201
|
+
rel_path = p.relative_path_from(Pathname.pwd).to_s
|
202
|
+
end
|
197
203
|
|
198
204
|
def to_s
|
199
205
|
code
|
data/lib/mortar/version.rb
CHANGED
@@ -176,7 +176,7 @@ no_browser=true
|
|
176
176
|
describe_id = "c571a8c7f76a4fd4a67c103d753e2dd5"
|
177
177
|
describe_url = "https://api.mortardata.com/describe/#{describe_id}"
|
178
178
|
|
179
|
-
mock(Mortar::Auth.api).post_describe("myproject", "my_script", "my_alias", is_a(String), :pig_version => "0.12", :parameters=>[]) {Excon::Response.new(:body => {"describe_id" => describe_id})}
|
179
|
+
mock(Mortar::Auth.api).post_describe("myproject", "my_script", "my_alias", is_a(String), :pig_version => "0.12", :project_script_path => be_a_kind_of(String), :parameters=>[]) {Excon::Response.new(:body => {"describe_id" => describe_id})}
|
180
180
|
mock(Mortar::Auth.api).get_describe(describe_id, :exclude_result => true).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Describe::STATUS_SUCCESS, "status_description" => "Success", "web_result_url" => describe_url})).ordered
|
181
181
|
mock(Launchy).open(describe_url) {Thread.new {}}
|
182
182
|
|
@@ -204,7 +204,7 @@ no_browser=true
|
|
204
204
|
describe_id = "c571a8c7f76a4fd4a67c103d753e2dd5"
|
205
205
|
describe_url = "https://api.mortardata.com/describe/#{describe_id}"
|
206
206
|
|
207
|
-
mock(Mortar::Auth.api).post_describe("myproject", "my_script", "my_alias", is_a(String), :pig_version => "0.12", :parameters=>[]) {Excon::Response.new(:body => {"describe_id" => describe_id})}
|
207
|
+
mock(Mortar::Auth.api).post_describe("myproject", "my_script", "my_alias", is_a(String), :pig_version => "0.12", :project_script_path => be_a_kind_of(String), :parameters=>[]) {Excon::Response.new(:body => {"describe_id" => describe_id})}
|
208
208
|
mock(Mortar::Auth.api).get_describe(describe_id, :exclude_result => true).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Describe::STATUS_SUCCESS, "status_description" => "Success", "web_result_url" => describe_url})).ordered
|
209
209
|
write_file(File.join(p.pigscripts_path, "my_script.pig"))
|
210
210
|
|
@@ -232,7 +232,7 @@ polling_interval=10
|
|
232
232
|
describe_id = "c571a8c7f76a4fd4a67c103d753e2dd5"
|
233
233
|
describe_url = "https://api.mortardata.com/describe/#{describe_id}"
|
234
234
|
|
235
|
-
mock(Mortar::Auth.api).post_describe("myproject", "my_script", "my_alias", is_a(String), :pig_version => "0.9", :parameters=>[]) {Excon::Response.new(:body => {"describe_id" => describe_id})}
|
235
|
+
mock(Mortar::Auth.api).post_describe("myproject", "my_script", "my_alias", is_a(String), :pig_version => "0.9", :project_script_path => be_a_kind_of(String), :parameters=>[]) {Excon::Response.new(:body => {"describe_id" => describe_id})}
|
236
236
|
mock(Mortar::Auth.api).get_describe(describe_id, :exclude_result => true).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Describe::STATUS_SUCCESS, "status_description" => "Success", "web_result_url" => describe_url})).ordered
|
237
237
|
write_file(File.join(p.pigscripts_path, "my_script.pig"))
|
238
238
|
|
@@ -98,7 +98,7 @@ STDERR
|
|
98
98
|
describe_url = "https://api.mortardata.com/describe/#{describe_id}"
|
99
99
|
parameters = ["name"=>"key", "value"=>"value" ]
|
100
100
|
|
101
|
-
mock(Mortar::Auth.api).post_describe("myproject", "my_script", "my_alias", is_a(String), :pig_version => "0.9", :parameters => parameters) {Excon::Response.new(:body => {"describe_id" => describe_id})}
|
101
|
+
mock(Mortar::Auth.api).post_describe("myproject", "my_script", "my_alias", is_a(String), :pig_version => "0.9", :project_script_path => be_a_kind_of(String), :parameters => parameters) {Excon::Response.new(:body => {"describe_id" => describe_id})}
|
102
102
|
mock(Mortar::Auth.api).get_describe(describe_id, :exclude_result => true).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Describe::STATUS_QUEUED, "status_description" => "Pending"})).ordered
|
103
103
|
mock(Mortar::Auth.api).get_describe(describe_id, :exclude_result => true).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Describe::STATUS_GATEWAY_STARTING, "status_description" => "Gateway starting"})).ordered
|
104
104
|
mock(Mortar::Auth.api).get_describe(describe_id, :exclude_result => true).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Describe::STATUS_PROGRESS, "status_description" => "Starting pig"})).ordered
|
@@ -129,7 +129,7 @@ STDOUT
|
|
129
129
|
describe_url = "https://api.mortardata.com/describe/#{describe_id}"
|
130
130
|
parameters = ["name"=>"key", "value"=>"value" ]
|
131
131
|
|
132
|
-
mock(Mortar::Auth.api).post_describe("myproject", "my_script", "my_alias", is_a(String), :pig_version => "0.9", :parameters => parameters) {Excon::Response.new(:body => {"describe_id" => describe_id})}
|
132
|
+
mock(Mortar::Auth.api).post_describe("myproject", "my_script", "my_alias", is_a(String), :pig_version => "0.9", :project_script_path => be_a_kind_of(String), :parameters => parameters) {Excon::Response.new(:body => {"describe_id" => describe_id})}
|
133
133
|
mock(Mortar::Auth.api).get_describe(describe_id, :exclude_result => true).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Describe::STATUS_QUEUED, "status_description" => "Pending"})).ordered
|
134
134
|
mock(Mortar::Auth.api).get_describe(describe_id, :exclude_result => true).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Describe::STATUS_GATEWAY_STARTING, "status_description" => "Gateway starting"})).ordered
|
135
135
|
mock(Mortar::Auth.api).get_describe(describe_id, :exclude_result => true).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Describe::STATUS_PROGRESS, "status_description" => "Starting pig"})).ordered
|
@@ -163,7 +163,7 @@ STDOUT
|
|
163
163
|
column_number = 32
|
164
164
|
error_type = 'PigError'
|
165
165
|
|
166
|
-
mock(Mortar::Auth.api).post_describe("myproject", "my_script", "my_alias", is_a(String), :pig_version => "0.9", :parameters => []) {Excon::Response.new(:body => {"describe_id" => describe_id})}
|
166
|
+
mock(Mortar::Auth.api).post_describe("myproject", "my_script", "my_alias", is_a(String), :pig_version => "0.9", :project_script_path => be_a_kind_of(String), :parameters => []) {Excon::Response.new(:body => {"describe_id" => describe_id})}
|
167
167
|
mock(Mortar::Auth.api).get_describe(describe_id, :exclude_result => true).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Describe::STATUS_QUEUED, "status_description" => "Pending"})).ordered
|
168
168
|
mock(Mortar::Auth.api).get_describe(describe_id, :exclude_result => true).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Describe::STATUS_FAILURE, "status_description" => "Failed",
|
169
169
|
"error_message" => error_message,
|
@@ -198,7 +198,7 @@ STDERR
|
|
198
198
|
describe_url = "https://api.mortardata.com/describe/#{describe_id}"
|
199
199
|
parameters = ["name"=>"key", "value"=>"value" ]
|
200
200
|
|
201
|
-
mock(Mortar::Auth.api).post_describe("myproject", "my_script", "my_alias", is_a(String), :pig_version => "0.9", :parameters => parameters) {Excon::Response.new(:body => {"describe_id" => describe_id})}
|
201
|
+
mock(Mortar::Auth.api).post_describe("myproject", "my_script", "my_alias", is_a(String), :pig_version => "0.9", :project_script_path => be_a_kind_of(String), :parameters => parameters) {Excon::Response.new(:body => {"describe_id" => describe_id})}
|
202
202
|
mock(Mortar::Auth.api).get_describe(describe_id, :exclude_result => true).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Describe::STATUS_QUEUED, "status_description" => "Pending"})).ordered
|
203
203
|
mock(Mortar::Auth.api).get_describe(describe_id, :exclude_result => true).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Describe::STATUS_GATEWAY_STARTING, "status_description" => "Gateway starting"})).ordered
|
204
204
|
mock(Mortar::Auth.api).get_describe(describe_id, :exclude_result => true).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Describe::STATUS_PROGRESS, "status_description" => "Starting pig"})).ordered
|
@@ -74,7 +74,7 @@ STDERR
|
|
74
74
|
parameters = ["name"=>"key", "value"=>"value" ]
|
75
75
|
|
76
76
|
# These don't test the validity of the error message, it only tests that the CLI can handle a message returned from the server
|
77
|
-
mock(Mortar::Auth.api).post_illustrate("myproject", "my_script", "my_alias", false, is_a(String), :pig_version => "0.9", :parameters => parameters) {Excon::Response.new(:body => {"illustrate_id" => illustrate_id})}
|
77
|
+
mock(Mortar::Auth.api).post_illustrate("myproject", "my_script", "my_alias", false, is_a(String), :pig_version => "0.9", :project_script_path => be_a_kind_of(String), :parameters => parameters) {Excon::Response.new(:body => {"illustrate_id" => illustrate_id})}
|
78
78
|
mock(Mortar::Auth.api).get_illustrate(illustrate_id, :exclude_result => true).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Illustrate::STATUS_QUEUED, "status_description" => "Pending"})).ordered
|
79
79
|
mock(Mortar::Auth.api).get_illustrate(illustrate_id, :exclude_result => true).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Illustrate::STATUS_GATEWAY_STARTING, "status_description" => "GATEWAY_STARTING"})).ordered
|
80
80
|
mock(Mortar::Auth.api).get_illustrate(illustrate_id, :exclude_result => true).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Illustrate::STATUS_PROGRESS, "status_description" => "In progress"})).ordered
|
@@ -108,7 +108,7 @@ STDOUT
|
|
108
108
|
parameters = ["name"=>"key", "value"=>"value" ]
|
109
109
|
|
110
110
|
# These don't test the validity of the error message, it only tests that the CLI can handle a message returned from the server
|
111
|
-
mock(Mortar::Auth.api).post_illustrate("myproject", "my_script", "my_alias", false, is_a(String), :pig_version => "0.9", :parameters => parameters) {Excon::Response.new(:body => {"illustrate_id" => illustrate_id})}
|
111
|
+
mock(Mortar::Auth.api).post_illustrate("myproject", "my_script", "my_alias", false, is_a(String), :pig_version => "0.9", :project_script_path => be_a_kind_of(String), :parameters => parameters) {Excon::Response.new(:body => {"illustrate_id" => illustrate_id})}
|
112
112
|
mock(Mortar::Auth.api).get_illustrate(illustrate_id, :exclude_result => true).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Illustrate::STATUS_QUEUED, "status_description" => "Pending"})).ordered
|
113
113
|
mock(Mortar::Auth.api).get_illustrate(illustrate_id, :exclude_result => true).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Illustrate::STATUS_GATEWAY_STARTING, "status_description" => "GATEWAY_STARTING"})).ordered
|
114
114
|
mock(Mortar::Auth.api).get_illustrate(illustrate_id, :exclude_result => true).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Illustrate::STATUS_PROGRESS, "status_description" => "In progress"})).ordered
|
@@ -142,7 +142,7 @@ STDOUT
|
|
142
142
|
parameters = ["name"=>"key", "value"=>"value" ]
|
143
143
|
|
144
144
|
# These don't test the validity of the error message, it only tests that the CLI can handle a message returned from the server
|
145
|
-
mock(Mortar::Auth.api).post_illustrate("myproject", "my_script", "my_alias", false, is_a(String), :pig_version => "0.9", :parameters => parameters) {Excon::Response.new(:body => {"illustrate_id" => illustrate_id})}
|
145
|
+
mock(Mortar::Auth.api).post_illustrate("myproject", "my_script", "my_alias", false, is_a(String), :pig_version => "0.9", :project_script_path => be_a_kind_of(String), :parameters => parameters) {Excon::Response.new(:body => {"illustrate_id" => illustrate_id})}
|
146
146
|
mock(Mortar::Auth.api).get_illustrate(illustrate_id, :exclude_result => true).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Illustrate::STATUS_QUEUED, "status_description" => "Pending"})).ordered
|
147
147
|
mock(Mortar::Auth.api).get_illustrate(illustrate_id, :exclude_result => true).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Illustrate::STATUS_SUCCESS, "status_description" => "Succeeded", "web_result_url" => illustrate_url})).ordered
|
148
148
|
|
@@ -169,7 +169,7 @@ STDOUT
|
|
169
169
|
parameters = ["name"=>"key", "value"=>"value" ]
|
170
170
|
|
171
171
|
# These don't test the validity of the error message, it only tests that the CLI can handle a message returned from the server
|
172
|
-
mock(Mortar::Auth.api).post_illustrate("myproject", "my_script", "my_alias", true, is_a(String), :pig_version => "0.9", :parameters => parameters) {Excon::Response.new(:body => {"illustrate_id" => illustrate_id})}
|
172
|
+
mock(Mortar::Auth.api).post_illustrate("myproject", "my_script", "my_alias", true, is_a(String), :pig_version => "0.9", :project_script_path => be_a_kind_of(String), :parameters => parameters) {Excon::Response.new(:body => {"illustrate_id" => illustrate_id})}
|
173
173
|
mock(Mortar::Auth.api).get_illustrate(illustrate_id, :exclude_result => true).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Illustrate::STATUS_QUEUED, "status_description" => "Pending"})).ordered
|
174
174
|
mock(Mortar::Auth.api).get_illustrate(illustrate_id, :exclude_result => true).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Illustrate::STATUS_SUCCESS, "status_description" => "Succeeded", "web_result_url" => illustrate_url})).ordered
|
175
175
|
|
@@ -195,7 +195,7 @@ STDOUT
|
|
195
195
|
parameters = ["name"=>"key", "value"=>"value" ]
|
196
196
|
|
197
197
|
# These don't test the validity of the error message, it only tests that the CLI can handle a message returned from the server
|
198
|
-
mock(Mortar::Auth.api).post_illustrate("myproject", "my_script", nil, false, is_a(String), :pig_version => "0.9", :parameters => parameters) {Excon::Response.new(:body => {"illustrate_id" => illustrate_id})}
|
198
|
+
mock(Mortar::Auth.api).post_illustrate("myproject", "my_script", nil, false, is_a(String), :pig_version => "0.9", :project_script_path => be_a_kind_of(String), :parameters => parameters) {Excon::Response.new(:body => {"illustrate_id" => illustrate_id})}
|
199
199
|
mock(Mortar::Auth.api).get_illustrate(illustrate_id, :exclude_result => true).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Illustrate::STATUS_QUEUED, "status_description" => "Pending"})).ordered
|
200
200
|
mock(Mortar::Auth.api).get_illustrate(illustrate_id, :exclude_result => true).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Illustrate::STATUS_GATEWAY_STARTING, "status_description" => "GATEWAY_STARTING"})).ordered
|
201
201
|
mock(Mortar::Auth.api).get_illustrate(illustrate_id, :exclude_result => true).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Illustrate::STATUS_PROGRESS, "status_description" => "In progress"})).ordered
|
@@ -232,7 +232,7 @@ STDOUT
|
|
232
232
|
error_type = 'PigError'
|
233
233
|
|
234
234
|
# These don't test the validity of the error message, it only tests that the CLI can handle a message returned from the server
|
235
|
-
mock(Mortar::Auth.api).post_illustrate("myproject", "my_script", "my_alias", false, is_a(String), :pig_version => "0.9", :parameters => []) {Excon::Response.new(:body => {"illustrate_id" => illustrate_id})}
|
235
|
+
mock(Mortar::Auth.api).post_illustrate("myproject", "my_script", "my_alias", false, is_a(String), :pig_version => "0.9", :project_script_path => be_a_kind_of(String), :parameters => []) {Excon::Response.new(:body => {"illustrate_id" => illustrate_id})}
|
236
236
|
mock(Mortar::Auth.api).get_illustrate(illustrate_id, :exclude_result => true).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Illustrate::STATUS_QUEUED, "status_description" => "Pending"})).ordered
|
237
237
|
mock(Mortar::Auth.api).get_illustrate(illustrate_id, :exclude_result => true).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Illustrate::STATUS_FAILURE,
|
238
238
|
"error_message" => error_message,
|
@@ -268,7 +268,7 @@ STDERR
|
|
268
268
|
parameters = ["name"=>"key", "value"=>"value" ]
|
269
269
|
|
270
270
|
# These don't test the validity of the error message, it only tests that the CLI can handle a message returned from the server
|
271
|
-
mock(Mortar::Auth.api).post_illustrate("myproject", "my_script", nil, false, is_a(String), :pig_version => "0.9", :parameters => parameters) {Excon::Response.new(:body => {"illustrate_id" => illustrate_id})}
|
271
|
+
mock(Mortar::Auth.api).post_illustrate("myproject", "my_script", nil, false, is_a(String), :pig_version => "0.9", :project_script_path => be_a_kind_of(String), :parameters => parameters) {Excon::Response.new(:body => {"illustrate_id" => illustrate_id})}
|
272
272
|
mock(Mortar::Auth.api).get_illustrate(illustrate_id, :exclude_result => true).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Illustrate::STATUS_QUEUED, "status_description" => "Pending"})).ordered
|
273
273
|
mock(Mortar::Auth.api).get_illustrate(illustrate_id, :exclude_result => true).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Illustrate::STATUS_GATEWAY_STARTING, "status_description" => "GATEWAY_STARTING"})).ordered
|
274
274
|
mock(Mortar::Auth.api).get_illustrate(illustrate_id, :exclude_result => true).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Illustrate::STATUS_PROGRESS, "status_description" => "In progress"})).ordered
|
@@ -47,7 +47,8 @@ module Mortar::Command
|
|
47
47
|
cluster_size = 5
|
48
48
|
|
49
49
|
mock(Mortar::Auth.api).post_job_new_cluster("myproject", "my_script", is_a(String), cluster_size,
|
50
|
-
:pig_version => "0.9",
|
50
|
+
:pig_version => "0.9",
|
51
|
+
:project_script_path => be_a_kind_of(String),
|
51
52
|
:parameters => match_array([{"name" => "FIRST_PARAM", "value" => "FOO"}, {"name" => "SECOND_PARAM", "value" => "BAR"}]),
|
52
53
|
:cluster_type => Jobs::CLUSTER_TYPE__SINGLE_JOB,
|
53
54
|
:notify_on_job_finish => true,
|
@@ -83,6 +84,7 @@ STDOUT
|
|
83
84
|
|
84
85
|
mock(Mortar::Auth.api).post_job_new_cluster("myproject", "my_script", is_a(String),cluster_size,
|
85
86
|
:pig_version => "0.9",
|
87
|
+
:project_script_path => be_a_kind_of(String),
|
86
88
|
:parameters => match_array([{"name" => "FIRST_PARAM", "value" => "FOO"}, {"name" => "SECOND_PARAM", "value" => "BAR"}]),
|
87
89
|
:cluster_type => Jobs::CLUSTER_TYPE__PERMANENT,
|
88
90
|
:notify_on_job_finish => true,
|
@@ -142,6 +144,7 @@ STDERR
|
|
142
144
|
|
143
145
|
mock(Mortar::Auth.api).post_job_new_cluster("myproject", "my_script", is_a(String),cluster_size,
|
144
146
|
:pig_version => "0.9",
|
147
|
+
:project_script_path => be_a_kind_of(String),
|
145
148
|
:parameters => match_array([{"name" => "FIRST_PARAM", "value" => "FOO"}, {"name" => "SECOND_PARAM", "value" => "BAR"}]),
|
146
149
|
:cluster_type => Jobs::CLUSTER_TYPE__PERSISTENT,
|
147
150
|
:notify_on_job_finish => true,
|
@@ -177,6 +180,7 @@ STDOUT
|
|
177
180
|
|
178
181
|
mock(Mortar::Auth.api).post_job_new_cluster("myproject", "my_script", is_a(String),cluster_size,
|
179
182
|
:pig_version => "0.9",
|
183
|
+
:project_script_path => be_a_kind_of(String),
|
180
184
|
:parameters => match_array([{"name" => "FIRST_PARAM", "value" => "FOO"}, {"name" => "SECOND_PARAM", "value" => "BAR"}]),
|
181
185
|
:cluster_type => Jobs::CLUSTER_TYPE__PERSISTENT,
|
182
186
|
:notify_on_job_finish => true,
|
@@ -212,6 +216,7 @@ STDOUT
|
|
212
216
|
|
213
217
|
mock(Mortar::Auth.api).post_job_existing_cluster("myproject", "my_script", is_a(String), cluster_id,
|
214
218
|
:pig_version => "0.9",
|
219
|
+
:project_script_path => be_a_kind_of(String),
|
215
220
|
:parameters => [],
|
216
221
|
:notify_on_job_finish => false,
|
217
222
|
:is_control_script=>true) {Excon::Response.new(:body => {"job_id" => job_id, "web_job_url" => job_url})}
|
@@ -245,6 +250,7 @@ STDOUT
|
|
245
250
|
|
246
251
|
mock(Mortar::Auth.api).post_job_existing_cluster("myproject", "my_script", is_a(String), cluster_id,
|
247
252
|
:pig_version => "0.9",
|
253
|
+
:project_script_path => be_a_kind_of(String),
|
248
254
|
:parameters => [],
|
249
255
|
:notify_on_job_finish => false,
|
250
256
|
:is_control_script=>true) {Excon::Response.new(:body => {"job_id" => job_id, "web_job_url" => job_url})}
|
@@ -278,6 +284,7 @@ STDOUT
|
|
278
284
|
mock(Mortar::Auth.api).get_clusters() {Excon::Response.new(:body => {'clusters' => []})}
|
279
285
|
mock(Mortar::Auth.api).post_job_new_cluster("myproject", "my_script", is_a(String), cluster_size,
|
280
286
|
:pig_version => "0.9",
|
287
|
+
:project_script_path => be_a_kind_of(String),
|
281
288
|
:parameters => [],
|
282
289
|
:cluster_type => Jobs::CLUSTER_TYPE__PERSISTENT,
|
283
290
|
:notify_on_job_finish => true,
|
@@ -315,6 +322,7 @@ STDOUT
|
|
315
322
|
mock(Mortar::Auth.api).get_clusters() {Excon::Response.new(:body => {'clusters' => []})}
|
316
323
|
mock(Mortar::Auth.api).post_job_new_cluster("myproject", "my_script", is_a(String), cluster_size,
|
317
324
|
:pig_version => "0.9",
|
325
|
+
:project_script_path => be_a_kind_of(String),
|
318
326
|
:parameters => [],
|
319
327
|
:cluster_type => Jobs::CLUSTER_TYPE__PERSISTENT,
|
320
328
|
:notify_on_job_finish => true,
|
@@ -350,7 +358,7 @@ STDOUT
|
|
350
358
|
job_url = "http://127.0.0.1:5000/jobs/job_detail?job_id=c571a8c7f76a4fd4a67c103d753e2dd5"
|
351
359
|
cluster_id = "e2790e7e8c7d48e39157238d58191346"
|
352
360
|
|
353
|
-
mock(Mortar::Auth.api).post_job_existing_cluster("myproject", "my_script", is_a(String), cluster_id, :pig_version => "0.9", :parameters => [], :notify_on_job_finish => false, :is_control_script=>false) {Excon::Response.new(:body => {"job_id" => job_id, "web_job_url" => job_url})}
|
361
|
+
mock(Mortar::Auth.api).post_job_existing_cluster("myproject", "my_script", is_a(String), cluster_id, :pig_version => "0.9", :project_script_path => be_a_kind_of(String), :parameters => [], :notify_on_job_finish => false, :is_control_script=>false) {Excon::Response.new(:body => {"job_id" => job_id, "web_job_url" => job_url})}
|
354
362
|
|
355
363
|
write_file(File.join(p.pigscripts_path, "my_script.pig"))
|
356
364
|
stderr, stdout = execute("jobs:run pigscripts/my_script.pig --clusterid e2790e7e8c7d48e39157238d58191346 -d", p, @git)
|
@@ -404,6 +412,7 @@ STDOUT
|
|
404
412
|
}
|
405
413
|
mock(Mortar::Auth.api).post_job_existing_cluster("myproject", "my_script", is_a(String), large_cluster_id,
|
406
414
|
:pig_version => "0.9",
|
415
|
+
:project_script_path => be_a_kind_of(String),
|
407
416
|
:parameters => [],
|
408
417
|
:notify_on_job_finish => true,
|
409
418
|
:is_control_script=>false) {Excon::Response.new(:body => {"job_id" => job_id, "web_job_url" => job_url})}
|
@@ -436,7 +445,8 @@ STDOUT
|
|
436
445
|
cluster_size = 5
|
437
446
|
|
438
447
|
mock(Mortar::Auth.api).post_job_new_cluster("myproject", "my_script", is_a(String), cluster_size,
|
439
|
-
:pig_version => "0.9",
|
448
|
+
:pig_version => "0.9",
|
449
|
+
:project_script_path => be_a_kind_of(String),
|
440
450
|
:parameters => match_array([{"name" => "FIRST", "value" => "FOO"}, {"name" => "SECOND", "value" => "BAR"}, {"name" => "THIRD", "value" => "BEAR"}]),
|
441
451
|
:cluster_type => Jobs::CLUSTER_TYPE__PERSISTENT,
|
442
452
|
:notify_on_job_finish => true,
|
@@ -464,6 +474,7 @@ PARAMS
|
|
464
474
|
|
465
475
|
mock(Mortar::Auth.api).post_job_new_cluster("myproject", "my_script", is_a(String), cluster_size,
|
466
476
|
:pig_version => "0.9",
|
477
|
+
:project_script_path => be_a_kind_of(String),
|
467
478
|
:parameters => match_array([{"name" => "FIRST", "value" => "FOO"}, {"name" => "SECOND", "value" => "BAR"}, {"name" => "THIRD", "value" => "BEAR"}]),
|
468
479
|
:cluster_type => Jobs::CLUSTER_TYPE__PERSISTENT,
|
469
480
|
:notify_on_job_finish => true,
|
@@ -519,6 +530,7 @@ STDERR
|
|
519
530
|
|
520
531
|
mock(Mortar::Auth.api).post_job_new_cluster("myproject", "my_script", is_a(String), cluster_size,
|
521
532
|
:pig_version => "0.9",
|
533
|
+
:project_script_path => be_a_kind_of(String),
|
522
534
|
:parameters => match_array([{"name" => "FIRST_PARAM", "value" => "FOO"}, {"name" => "SECOND_PARAM", "value" => "BAR"}]),
|
523
535
|
:cluster_type => Jobs::CLUSTER_TYPE__PERSISTENT,
|
524
536
|
:notify_on_job_finish => true,
|
@@ -72,8 +72,8 @@ STDERR
|
|
72
72
|
# stub api requests
|
73
73
|
validate_id = "c571a8c7f76a4fd4a67c103d753e2dd5"
|
74
74
|
parameters = ["name"=>"key", "value"=>"value" ]
|
75
|
-
|
76
|
-
mock(Mortar::Auth.api).post_validate("myproject", "my_script", is_a(String), :pig_version => "0.9", :parameters => parameters) {Excon::Response.new(:body => {"validate_id" => validate_id})}
|
75
|
+
|
76
|
+
mock(Mortar::Auth.api).post_validate("myproject", "my_script", is_a(String), :pig_version => "0.9", :project_script_path => be_a_kind_of(String), :parameters => parameters) {Excon::Response.new(:body => {"validate_id" => validate_id})}
|
77
77
|
mock(Mortar::Auth.api).get_validate(validate_id).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Validate::STATUS_QUEUED, "status_description" => "Pending"})).ordered
|
78
78
|
mock(Mortar::Auth.api).get_validate(validate_id).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Validate::STATUS_GATEWAY_STARTING, "status_description" => "GATEWAY_STARTING"})).ordered
|
79
79
|
mock(Mortar::Auth.api).get_validate(validate_id).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Validate::STATUS_PROGRESS, "status_description" => "Starting"})).ordered
|
@@ -103,7 +103,7 @@ STDOUT
|
|
103
103
|
column_number = 32
|
104
104
|
error_type = 'PigError'
|
105
105
|
|
106
|
-
mock(Mortar::Auth.api).post_validate("myproject", "my_script", is_a(String), :pig_version => "0.9", :parameters => []) {Excon::Response.new(:body => {"validate_id" => validate_id})}
|
106
|
+
mock(Mortar::Auth.api).post_validate("myproject", "my_script", is_a(String), :pig_version => "0.9", :project_script_path => be_a_kind_of(String), :parameters => []) {Excon::Response.new(:body => {"validate_id" => validate_id})}
|
107
107
|
mock(Mortar::Auth.api).get_validate(validate_id).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Validate::STATUS_QUEUED, "status_description" => "Pending"})).ordered
|
108
108
|
mock(Mortar::Auth.api).get_validate(validate_id).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Validate::STATUS_FAILURE, "status_description" => "Failed",
|
109
109
|
"error_message" => error_message,
|
@@ -137,7 +137,7 @@ STDERR
|
|
137
137
|
validate_id = "c571a8c7f76a4fd4a67c103d753e2dd5"
|
138
138
|
parameters = ["name"=>"key", "value"=>"value" ]
|
139
139
|
|
140
|
-
mock(Mortar::Auth.api).post_validate("myproject", "my_script", is_a(String), :pig_version => "0.12", :parameters => parameters) {Excon::Response.new(:body => {"validate_id" => validate_id})}
|
140
|
+
mock(Mortar::Auth.api).post_validate("myproject", "my_script", is_a(String), :pig_version => "0.12", :project_script_path => be_a_kind_of(String), :parameters => parameters) {Excon::Response.new(:body => {"validate_id" => validate_id})}
|
141
141
|
mock(Mortar::Auth.api).get_validate(validate_id).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Validate::STATUS_QUEUED, "status_description" => "Pending"})).ordered
|
142
142
|
mock(Mortar::Auth.api).get_validate(validate_id).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Validate::STATUS_GATEWAY_STARTING, "status_description" => "GATEWAY_STARTING"})).ordered
|
143
143
|
mock(Mortar::Auth.api).get_validate(validate_id).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Validate::STATUS_PROGRESS, "status_description" => "Starting"})).ordered
|
data/spec/mortar/project_spec.rb
CHANGED
@@ -65,6 +65,7 @@ module Mortar
|
|
65
65
|
p.pigscripts.my_script.name.should == "my_script"
|
66
66
|
p.pigscripts.my_script.path.should == pigscript_path
|
67
67
|
p.pigscripts.my_script.executable_path.should == "pigscripts/my_script.pig"
|
68
|
+
p.pigscripts.my_script.rel_path.end_with?('pigscripts').should be_true
|
68
69
|
end
|
69
70
|
end
|
70
71
|
|
@@ -74,6 +75,7 @@ module Mortar
|
|
74
75
|
write_file pigscript_path
|
75
76
|
p.pigscripts.my_script.name.should == "my_script"
|
76
77
|
p.pigscripts.my_script.path.should == pigscript_path
|
78
|
+
p.pigscripts.my_script.rel_path.end_with?("pigscripts/subdir").should be_true
|
77
79
|
end
|
78
80
|
end
|
79
81
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mortar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.15.
|
4
|
+
version: 0.15.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mortar Data
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rdoc
|
@@ -30,14 +30,14 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.8.
|
33
|
+
version: 0.8.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.8.
|
40
|
+
version: 0.8.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: netrc
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|