mortar 0.7.9 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/mortar/command/base.rb +8 -6
- data/lib/mortar/command/describe.rb +2 -2
- data/lib/mortar/command/illustrate.rb +3 -2
- data/lib/mortar/command/jobs.rb +44 -14
- data/lib/mortar/command/local.rb +5 -5
- data/lib/mortar/command/pigscripts.rb +1 -1
- data/lib/mortar/project.rb +11 -0
- data/lib/mortar/version.rb +1 -1
- data/spec/mortar/command/describe_spec.rb +50 -6
- data/spec/mortar/command/illustrate_spec.rb +44 -10
- data/spec/mortar/command/jobs_spec.rb +81 -14
- data/spec/mortar/command/local_spec.rb +27 -9
- data/spec/mortar/command/pigscripts_spec.rb +3 -3
- data/spec/mortar/project_spec.rb +1 -0
- metadata +138 -129
data/lib/mortar/command/base.rb
CHANGED
@@ -310,11 +310,12 @@ protected
|
|
310
310
|
end
|
311
311
|
|
312
312
|
def validate_script!(script_name)
|
313
|
-
|
314
|
-
|
313
|
+
shortened_script_name = File.basename(script_name, ".*")
|
314
|
+
pigscript = project.pigscripts[shortened_script_name]
|
315
|
+
controlscript = project.controlscripts[shortened_script_name]
|
315
316
|
unless pigscript || controlscript
|
316
|
-
available_pigscripts = project.pigscripts.none? ? "No pigscripts found" : "Available pigscripts:\n#{project.pigscripts.
|
317
|
-
available_controlscripts = project.controlscripts.none? ? "No controlscripts found" : "Available controlscripts:\n#{project.controlscripts.
|
317
|
+
available_pigscripts = project.pigscripts.none? ? "No pigscripts found" : "Available pigscripts:\n#{project.pigscripts.collect{|k,v| v.executable_path}.sort.join("\n")}"
|
318
|
+
available_controlscripts = project.controlscripts.none? ? "No controlscripts found" : "Available controlscripts:\n#{project.controlscripts.collect{|k,v| v.executable_path}.sort.join("\n")}"
|
318
319
|
error("Unable to find a pigscript or controlscript for #{script_name}\n\n#{available_pigscripts}\n\n#{available_controlscripts}")
|
319
320
|
end
|
320
321
|
|
@@ -326,8 +327,9 @@ protected
|
|
326
327
|
end
|
327
328
|
|
328
329
|
def validate_pigscript!(pigscript_name)
|
329
|
-
|
330
|
-
|
330
|
+
shortened_pigscript_name = File.basename(pigscript_name, ".*")
|
331
|
+
unless pigscript = project.pigscripts[shortened_pigscript_name]
|
332
|
+
available_scripts = project.pigscripts.none? ? "No pigscripts found" : "Available scripts:\n#{project.pigscripts.collect{|k,v| v.executable_path}.sort.join("\n")}"
|
331
333
|
error("Unable to find pigscript #{pigscript_name}\n#{available_scripts}")
|
332
334
|
end
|
333
335
|
pigscript
|
@@ -31,8 +31,8 @@ class Mortar::Command::Describe < Mortar::Command::Base
|
|
31
31
|
#
|
32
32
|
# Examples:
|
33
33
|
#
|
34
|
-
# Describe the songs_sample relation in the generate_regression_model_coefficients
|
35
|
-
# $ mortar describe generate_regression_model_coefficients songs_sample
|
34
|
+
# Describe the songs_sample relation in the generate_regression_model_coefficients.pig pigscript.
|
35
|
+
# $ mortar describe pigscripts/generate_regression_model_coefficients.pig songs_sample
|
36
36
|
def index
|
37
37
|
pigscript_name = shift_argument
|
38
38
|
alias_name = shift_argument
|
@@ -33,8 +33,9 @@ class Mortar::Command::Illustrate < Mortar::Command::Base
|
|
33
33
|
#
|
34
34
|
# Examples:
|
35
35
|
#
|
36
|
-
# Illustrate
|
37
|
-
# $ mortar illustrate generate_regression_model_coefficients
|
36
|
+
# Illustrate all relations in the generate_regression_model_coefficients pigscript.
|
37
|
+
# $ mortar illustrate pigscripts/generate_regression_model_coefficients.pig
|
38
|
+
#
|
38
39
|
def index
|
39
40
|
pigscript_name = shift_argument
|
40
41
|
alias_name = shift_argument
|
data/lib/mortar/command/jobs.rb
CHANGED
@@ -65,11 +65,16 @@ class Mortar::Command::Jobs < Mortar::Command::Base
|
|
65
65
|
# -p, --parameter NAME=VALUE # Set a pig parameter value in your script.
|
66
66
|
# -f, --param-file PARAMFILE # Load pig parameter values from a file.
|
67
67
|
# -d, --donotnotify # Don't send an email on job completion. (Default: false--an email will be sent to you once the job completes)
|
68
|
+
# -P, --project PROJECTNAME # Use a project that is not checked out in the current directory. Runs code from project's master branch in github rather than snapshotting local code.
|
69
|
+
# -B, --branch BRANCHNAME # Used with --project to specify a non-master branch
|
68
70
|
#
|
69
71
|
#Examples:
|
70
72
|
#
|
71
|
-
# Run the generate_regression_model_coefficients
|
72
|
-
# $ mortar jobs:run generate_regression_model_coefficients --clustersize 3
|
73
|
+
# Run the generate_regression_model_coefficients pigscript on a 3 node cluster.
|
74
|
+
# $ mortar jobs:run pigscripts/generate_regression_model_coefficients.pig --clustersize 3
|
75
|
+
#
|
76
|
+
# Run the regression_controller control script on a 3 node cluster.
|
77
|
+
# $ mortar jobs:run controlscripts/regression_controller.py --clustersize 3
|
73
78
|
def run
|
74
79
|
script_name = shift_argument
|
75
80
|
unless script_name
|
@@ -77,18 +82,35 @@ class Mortar::Command::Jobs < Mortar::Command::Base
|
|
77
82
|
end
|
78
83
|
|
79
84
|
validate_arguments!
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
85
|
+
if options[:project]
|
86
|
+
project_name = options[:project]
|
87
|
+
|
88
|
+
if File.extname(script_name) == ".pig"
|
89
|
+
is_control_script = false
|
90
|
+
script_name = File.basename(script_name, ".*")
|
91
|
+
elsif File.extname(script_name) == ".py"
|
92
|
+
is_control_script = true
|
93
|
+
script_name = File.basename(script_name, ".*")
|
94
|
+
else
|
95
|
+
error "Unable to guess script type (controlscript vs pigscript).\n" +
|
96
|
+
"When running a script with the --project option, please provide the full path and filename, e.g.\n" +
|
97
|
+
" mortar run pigscripts/#{script_name}.pig --project #{project_name}"
|
98
|
+
end
|
87
99
|
else
|
88
|
-
|
100
|
+
project_name = project.name
|
101
|
+
script = validate_script!(script_name)
|
102
|
+
|
103
|
+
script_name = script.name
|
104
|
+
case script
|
105
|
+
when Mortar::Project::PigScript
|
106
|
+
is_control_script = false
|
107
|
+
when Mortar::Project::ControlScript
|
108
|
+
is_control_script = true
|
109
|
+
else
|
110
|
+
error "Unknown Script Type"
|
111
|
+
end
|
89
112
|
end
|
90
113
|
|
91
|
-
|
92
114
|
unless options[:clusterid] || options[:clustersize]
|
93
115
|
clusters = api.get_clusters().body['clusters']
|
94
116
|
|
@@ -114,7 +136,15 @@ class Mortar::Command::Jobs < Mortar::Command::Base
|
|
114
136
|
end
|
115
137
|
end
|
116
138
|
|
117
|
-
|
139
|
+
if options[:project]
|
140
|
+
if options[:branch]
|
141
|
+
git_ref = options[:branch]
|
142
|
+
else
|
143
|
+
git_ref = "master"
|
144
|
+
end
|
145
|
+
else
|
146
|
+
git_ref = sync_code_with_cloud()
|
147
|
+
end
|
118
148
|
|
119
149
|
notify_on_job_finish = ! options[:donotnotify]
|
120
150
|
|
@@ -131,14 +161,14 @@ class Mortar::Command::Jobs < Mortar::Command::Base
|
|
131
161
|
elsif options[:permanentcluster]
|
132
162
|
cluster_type = CLUSTER_TYPE__PERMANENT
|
133
163
|
end
|
134
|
-
api.post_job_new_cluster(
|
164
|
+
api.post_job_new_cluster(project_name, script_name, git_ref, cluster_size,
|
135
165
|
:parameters => pig_parameters,
|
136
166
|
:cluster_type => cluster_type,
|
137
167
|
:notify_on_job_finish => notify_on_job_finish,
|
138
168
|
:is_control_script => is_control_script).body
|
139
169
|
else
|
140
170
|
cluster_id = options[:clusterid]
|
141
|
-
api.post_job_existing_cluster(
|
171
|
+
api.post_job_existing_cluster(project_name, script_name, git_ref, cluster_id,
|
142
172
|
:parameters => pig_parameters,
|
143
173
|
:notify_on_job_finish => notify_on_job_finish,
|
144
174
|
:is_control_script => is_control_script).body
|
data/lib/mortar/command/local.rb
CHANGED
@@ -42,7 +42,7 @@ class Mortar::Command::Local < Mortar::Command::Base
|
|
42
42
|
#Examples:
|
43
43
|
#
|
44
44
|
# Run the generate_regression_model_coefficients script locally.
|
45
|
-
# $ mortar local:run generate_regression_model_coefficients
|
45
|
+
# $ mortar local:run pigscripts/generate_regression_model_coefficients.pig
|
46
46
|
def run
|
47
47
|
script_name = shift_argument
|
48
48
|
unless script_name
|
@@ -67,8 +67,8 @@ class Mortar::Command::Local < Mortar::Command::Base
|
|
67
67
|
#
|
68
68
|
# Examples:
|
69
69
|
#
|
70
|
-
# Illustrate
|
71
|
-
# $ mortar illustrate generate_regression_model_coefficients
|
70
|
+
# Illustrate all relations in the generate_regression_model_coefficients pigscript:
|
71
|
+
# $ mortar illustrate pigscripts/generate_regression_model_coefficients.pig
|
72
72
|
def illustrate
|
73
73
|
pigscript_name = shift_argument
|
74
74
|
alias_name = shift_argument
|
@@ -95,8 +95,8 @@ class Mortar::Command::Local < Mortar::Command::Base
|
|
95
95
|
#
|
96
96
|
#Examples:
|
97
97
|
#
|
98
|
-
# Check the pig syntax of the generate_regression_model_coefficients
|
99
|
-
# $ mortar local:validate generate_regression_model_coefficients
|
98
|
+
# Check the pig syntax of the generate_regression_model_coefficients pigscript locally.
|
99
|
+
# $ mortar local:validate pigscripts/generate_regression_model_coefficients.pig
|
100
100
|
def validate
|
101
101
|
script_name = shift_argument
|
102
102
|
unless script_name
|
@@ -28,7 +28,7 @@ class Mortar::Command::PigScripts < Mortar::Command::Base
|
|
28
28
|
validate_arguments!
|
29
29
|
if project.pigscripts.any?
|
30
30
|
styled_header("pigscripts")
|
31
|
-
styled_array(project.pigscripts.
|
31
|
+
styled_array(project.pigscripts.collect{|k,v| v.executable_path}.sort)
|
32
32
|
else
|
33
33
|
display("You have no pigscripts.")
|
34
34
|
end
|
data/lib/mortar/project.rb
CHANGED
@@ -182,8 +182,19 @@ module Mortar
|
|
182
182
|
end
|
183
183
|
|
184
184
|
class ControlScript < Script
|
185
|
+
|
186
|
+
def executable_path
|
187
|
+
"controlscripts/#{self.name}.pig"
|
188
|
+
end
|
189
|
+
|
185
190
|
end
|
191
|
+
|
186
192
|
class PigScript < Script
|
193
|
+
|
194
|
+
def executable_path
|
195
|
+
"pigscripts/#{self.name}.pig"
|
196
|
+
end
|
197
|
+
|
187
198
|
end
|
188
199
|
|
189
200
|
end
|
data/lib/mortar/version.rb
CHANGED
@@ -33,7 +33,7 @@ module Mortar::Command
|
|
33
33
|
it "errors when an alias is not provided" do
|
34
34
|
with_git_initialized_project do |p|
|
35
35
|
write_file(File.join(p.pigscripts_path, "my_script.pig"))
|
36
|
-
stderr, stdout = execute("describe my_script", p)
|
36
|
+
stderr, stdout = execute("describe pigscripts/my_script.pig", p)
|
37
37
|
stderr.should == <<-STDERR
|
38
38
|
! Usage: mortar describe PIGSCRIPT ALIAS
|
39
39
|
! Must specify PIGSCRIPT and ALIAS.
|
@@ -46,14 +46,14 @@ STDERR
|
|
46
46
|
@git.git('remote rm mortar')
|
47
47
|
p.remote = nil
|
48
48
|
write_file(File.join(p.pigscripts_path, "my_script.pig"))
|
49
|
-
stderr, stdout = execute("describe my_script my_alias", p, @git)
|
49
|
+
stderr, stdout = execute("describe pigscripts/my_script.pig my_alias", p, @git)
|
50
50
|
stderr.should == <<-STDERR
|
51
51
|
! Unable to find git remote for project myproject
|
52
52
|
STDERR
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
|
-
it "errors when requested pigscript cannot be found" do
|
56
|
+
it "errors when requested pigscript cannot be found with old pigscript access style" do
|
57
57
|
with_git_initialized_project do |p|
|
58
58
|
stderr, stdout = execute("describe does_not_exist my_alias", p, @git)
|
59
59
|
stderr.should == <<-STDERR
|
@@ -62,6 +62,19 @@ STDERR
|
|
62
62
|
! No pigscripts found
|
63
63
|
!
|
64
64
|
! No controlscripts found
|
65
|
+
STDERR
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|
69
|
+
it "errors when requested pigscript cannot be found with new full-path pigscript access style" do
|
70
|
+
with_git_initialized_project do |p|
|
71
|
+
stderr, stdout = execute("describe pigscripts/does_not_exist.pig my_alias", p, @git)
|
72
|
+
stderr.should == <<-STDERR
|
73
|
+
! Unable to find a pigscript or controlscript for pigscripts/does_not_exist.pig
|
74
|
+
!
|
75
|
+
! No pigscripts found
|
76
|
+
!
|
77
|
+
! No controlscripts found
|
65
78
|
STDERR
|
66
79
|
end
|
67
80
|
end
|
@@ -76,7 +89,7 @@ STDERR
|
|
76
89
|
end
|
77
90
|
end
|
78
91
|
|
79
|
-
it "requests and reports on a successful describe" do
|
92
|
+
it "requests and reports on a successful describe using deprecated no-path pigscript syntax" do
|
80
93
|
with_git_initialized_project do |p|
|
81
94
|
# stub api requests
|
82
95
|
describe_id = "c571a8c7f76a4fd4a67c103d753e2dd5"
|
@@ -101,6 +114,37 @@ Starting describe... done
|
|
101
114
|
|
102
115
|
\r\e[0K[/] Calculating schema for my_alias and ancestors...\r\e[0K[-] Calculating schema for my_alias and ancestors...\r\e[0K[\\] Calculating schema for my_alias and ancestors...\r\e[0K[|] Calculating schema for my_alias and ancestors...
|
103
116
|
|
117
|
+
Results available at https://api.mortardata.com/describe/c571a8c7f76a4fd4a67c103d753e2dd5
|
118
|
+
Opening web browser to show results... done
|
119
|
+
STDOUT
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
it "requests and reports on a successful describe using new full path pigscript syntax" do
|
124
|
+
with_git_initialized_project do |p|
|
125
|
+
# stub api requests
|
126
|
+
describe_id = "c571a8c7f76a4fd4a67c103d753e2dd5"
|
127
|
+
describe_url = "https://api.mortardata.com/describe/#{describe_id}"
|
128
|
+
parameters = ["name"=>"key", "value"=>"value" ]
|
129
|
+
|
130
|
+
mock(Mortar::Auth.api).post_describe("myproject", "my_script", "my_alias", is_a(String), :parameters => parameters) {Excon::Response.new(:body => {"describe_id" => describe_id})}
|
131
|
+
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
|
132
|
+
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
|
133
|
+
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
|
134
|
+
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
|
135
|
+
|
136
|
+
# stub launchy
|
137
|
+
mock(Launchy).open(describe_url) {Thread.new {}}
|
138
|
+
|
139
|
+
write_file(File.join(p.pigscripts_path, "my_script.pig"))
|
140
|
+
stderr, stdout = execute("describe pigscripts/my_script.pig my_alias --polling_interval 0.05 -p key=value", p, @git)
|
141
|
+
stdout.should == <<-STDOUT
|
142
|
+
Taking code snapshot... done
|
143
|
+
Sending code snapshot to Mortar... done
|
144
|
+
Starting describe... done
|
145
|
+
|
146
|
+
\r\e[0K[/] Calculating schema for my_alias and ancestors...\r\e[0K[-] Calculating schema for my_alias and ancestors...\r\e[0K[\\] Calculating schema for my_alias and ancestors...\r\e[0K[|] Calculating schema for my_alias and ancestors...
|
147
|
+
|
104
148
|
Results available at https://api.mortardata.com/describe/c571a8c7f76a4fd4a67c103d753e2dd5
|
105
149
|
Opening web browser to show results... done
|
106
150
|
STDOUT
|
@@ -126,7 +170,7 @@ STDOUT
|
|
126
170
|
"error_type" => error_type})).ordered
|
127
171
|
|
128
172
|
write_file(File.join(p.pigscripts_path, "my_script.pig"))
|
129
|
-
stderr, stdout = execute("describe my_script my_alias --polling_interval 0.05", p, @git)
|
173
|
+
stderr, stdout = execute("describe pigscripts/my_script.pig my_alias --polling_interval 0.05", p, @git)
|
130
174
|
stdout.should == <<-STDOUT
|
131
175
|
Taking code snapshot... done
|
132
176
|
Sending code snapshot to Mortar... done
|
@@ -164,7 +208,7 @@ STDERR
|
|
164
208
|
mock(Launchy).open(describe_url) {Thread.new {}}
|
165
209
|
|
166
210
|
write_file(File.join(p.pigscripts_path, "my_script.pig"))
|
167
|
-
stderr, stdout = execute("describe my_script my_alias --polling_interval 0.05 -p key=value", p, @git)
|
211
|
+
stderr, stdout = execute("describe pigscripts/my_script.pig my_alias --polling_interval 0.05 -p key=value", p, @git)
|
168
212
|
end
|
169
213
|
end
|
170
214
|
end
|
@@ -34,7 +34,7 @@ module Mortar::Command
|
|
34
34
|
@git.git('remote rm mortar')
|
35
35
|
p.remote = nil
|
36
36
|
write_file(File.join(p.pigscripts_path, "my_script.pig"))
|
37
|
-
stderr, stdout = execute("illustrate my_script my_alias", p, @git)
|
37
|
+
stderr, stdout = execute("illustrate pigscripts/my_script.pig my_alias", p, @git)
|
38
38
|
stderr.should == <<-STDERR
|
39
39
|
! Unable to find git remote for project myproject
|
40
40
|
STDERR
|
@@ -43,9 +43,9 @@ STDERR
|
|
43
43
|
|
44
44
|
it "errors when requested pigscript cannot be found" do
|
45
45
|
with_git_initialized_project do |p|
|
46
|
-
stderr, stdout = execute("illustrate does_not_exist my_alias", p, @git)
|
46
|
+
stderr, stdout = execute("illustrate pigscripts/does_not_exist.pig my_alias", p, @git)
|
47
47
|
stderr.should == <<-STDERR
|
48
|
-
! Unable to find a pigscript or controlscript for does_not_exist
|
48
|
+
! Unable to find a pigscript or controlscript for pigscripts/does_not_exist.pig
|
49
49
|
!
|
50
50
|
! No pigscripts found
|
51
51
|
!
|
@@ -57,14 +57,14 @@ STDERR
|
|
57
57
|
it "errors when requested with controlscript" do
|
58
58
|
with_git_initialized_project do |p|
|
59
59
|
write_file(File.join(p.controlscripts_path, "my_script.py"))
|
60
|
-
stderr, stdout = execute("illustrate my_script my_alias", p, @git)
|
60
|
+
stderr, stdout = execute("illustrate pigscripts/my_script.pig my_alias", p, @git)
|
61
61
|
stderr.should == <<-STDERR
|
62
62
|
! Currently Mortar does not support illustrating control scripts
|
63
63
|
STDERR
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
67
|
-
it "requests and reports on a successful illustrate" do
|
67
|
+
it "requests and reports on a successful illustrate using deprecated no-path pigscript syntax" do
|
68
68
|
with_git_initialized_project do |p|
|
69
69
|
# stub api requests
|
70
70
|
illustrate_id = "c571a8c7f76a4fd4a67c103d753e2dd5"
|
@@ -92,6 +92,40 @@ Starting illustrate... done
|
|
92
92
|
|
93
93
|
\r\e[0KStatus: Pending... /\r\e[0KStatus: GATEWAY_STARTING... -\r\e[0KStatus: In progress... \\\r\e[0KStatus: Reading data... |\r\e[0KStatus: Pruning data... /\r\e[0KStatus: Succeeded
|
94
94
|
|
95
|
+
Results available at https://api.mortardata.com/illustrates/c571a8c7f76a4fd4a67c103d753e2dd5
|
96
|
+
Opening web browser to show results... done
|
97
|
+
STDOUT
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
it "requests and reports on a successful illustrate using new full-path pigscript syntax" do
|
102
|
+
with_git_initialized_project do |p|
|
103
|
+
# stub api requests
|
104
|
+
illustrate_id = "c571a8c7f76a4fd4a67c103d753e2dd5"
|
105
|
+
illustrate_url = "https://api.mortardata.com/illustrates/#{illustrate_id}"
|
106
|
+
parameters = ["name"=>"key", "value"=>"value" ]
|
107
|
+
|
108
|
+
# These don't test the validity of the error message, it only tests that the CLI can handle a message returned from the server
|
109
|
+
mock(Mortar::Auth.api).post_illustrate("myproject", "my_script", "my_alias", false, is_a(String), :parameters => parameters) {Excon::Response.new(:body => {"illustrate_id" => illustrate_id})}
|
110
|
+
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
|
111
|
+
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
|
112
|
+
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
|
113
|
+
mock(Mortar::Auth.api).get_illustrate(illustrate_id, :exclude_result => true).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Illustrate::STATUS_READING_DATA, "status_description" => "Reading data"})).ordered
|
114
|
+
mock(Mortar::Auth.api).get_illustrate(illustrate_id, :exclude_result => true).returns(Excon::Response.new(:body => {"status_code" => Mortar::API::Illustrate::STATUS_PRUNING_DATA, "status_description" => "Pruning data"})).ordered
|
115
|
+
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
|
116
|
+
|
117
|
+
# stub launchy
|
118
|
+
mock(Launchy).open(illustrate_url) {Thread.new {}}
|
119
|
+
|
120
|
+
write_file(File.join(p.pigscripts_path, "my_script.pig"))
|
121
|
+
stderr, stdout = execute("illustrate pigscripts/my_script.pig my_alias --polling_interval 0.05 -p key=value", p, @git)
|
122
|
+
stdout.should == <<-STDOUT
|
123
|
+
Taking code snapshot... done
|
124
|
+
Sending code snapshot to Mortar... done
|
125
|
+
Starting illustrate... done
|
126
|
+
|
127
|
+
\r\e[0KStatus: Pending... /\r\e[0KStatus: GATEWAY_STARTING... -\r\e[0KStatus: In progress... \\\r\e[0KStatus: Reading data... |\r\e[0KStatus: Pruning data... /\r\e[0KStatus: Succeeded
|
128
|
+
|
95
129
|
Results available at https://api.mortardata.com/illustrates/c571a8c7f76a4fd4a67c103d753e2dd5
|
96
130
|
Opening web browser to show results... done
|
97
131
|
STDOUT
|
@@ -111,7 +145,7 @@ STDOUT
|
|
111
145
|
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
|
112
146
|
|
113
147
|
write_file(File.join(p.pigscripts_path, "my_script.pig"))
|
114
|
-
stderr, stdout = execute("illustrate my_script my_alias --polling_interval 0.05 -p key=value --no_browser", p, @git)
|
148
|
+
stderr, stdout = execute("illustrate pigscripts/my_script.pig my_alias --polling_interval 0.05 -p key=value --no_browser", p, @git)
|
115
149
|
stdout.should == <<-STDOUT
|
116
150
|
Taking code snapshot... done
|
117
151
|
Sending code snapshot to Mortar... done
|
@@ -138,7 +172,7 @@ STDOUT
|
|
138
172
|
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
|
139
173
|
|
140
174
|
write_file(File.join(p.pigscripts_path, "my_script.pig"))
|
141
|
-
stderr, stdout = execute("illustrate my_script my_alias --polling_interval 0.05 -p key=value -s --no_browser", p, @git)
|
175
|
+
stderr, stdout = execute("illustrate pigscripts/my_script.pig my_alias --polling_interval 0.05 -p key=value -s --no_browser", p, @git)
|
142
176
|
stdout.should == <<-STDOUT
|
143
177
|
Taking code snapshot... done
|
144
178
|
Sending code snapshot to Mortar... done
|
@@ -171,7 +205,7 @@ STDOUT
|
|
171
205
|
mock(Launchy).open(illustrate_url) {Thread.new {}}
|
172
206
|
|
173
207
|
write_file(File.join(p.pigscripts_path, "my_script.pig"))
|
174
|
-
stderr, stdout = execute("illustrate my_script --polling_interval 0.05 -p key=value", p, @git)
|
208
|
+
stderr, stdout = execute("illustrate pigscripts/my_script.pig --polling_interval 0.05 -p key=value", p, @git)
|
175
209
|
stdout.should == <<-STDOUT
|
176
210
|
Taking code snapshot... done
|
177
211
|
Sending code snapshot to Mortar... done
|
@@ -206,7 +240,7 @@ STDOUT
|
|
206
240
|
"status_description" => "Failed"})).ordered
|
207
241
|
|
208
242
|
write_file(File.join(p.pigscripts_path, "my_script.pig"))
|
209
|
-
stderr, stdout = execute("illustrate my_script my_alias --polling_interval 0.05", p, @git)
|
243
|
+
stderr, stdout = execute("illustrate pigscripts/my_script.pig my_alias --polling_interval 0.05", p, @git)
|
210
244
|
stdout.should == <<-STDOUT
|
211
245
|
Taking code snapshot... done
|
212
246
|
Sending code snapshot to Mortar... done
|
@@ -246,7 +280,7 @@ STDERR
|
|
246
280
|
mock(Launchy).open(illustrate_url) {Thread.new {}}
|
247
281
|
|
248
282
|
write_file(File.join(p.pigscripts_path, "my_script.pig"))
|
249
|
-
stderr, stdout = execute("illustrate my_script --polling_interval 0.05 -p key=value", p, @git)
|
283
|
+
stderr, stdout = execute("illustrate pigscripts/my_script.pig --polling_interval 0.05 -p key=value", p, @git)
|
250
284
|
end
|
251
285
|
end
|
252
286
|
end
|
@@ -53,7 +53,7 @@ module Mortar::Command
|
|
53
53
|
:is_control_script=> false) {Excon::Response.new(:body => {"job_id" => job_id, "web_job_url" => job_url})}
|
54
54
|
|
55
55
|
write_file(File.join(p.pigscripts_path, "my_script.pig"))
|
56
|
-
stderr, stdout = execute("jobs:run my_script -1 --clustersize 5 -p FIRST_PARAM=FOO -p SECOND_PARAM=BAR", p, @git)
|
56
|
+
stderr, stdout = execute("jobs:run pigscripts/my_script.pig -1 --clustersize 5 -p FIRST_PARAM=FOO -p SECOND_PARAM=BAR", p, @git)
|
57
57
|
stdout.should == <<-STDOUT
|
58
58
|
Taking code snapshot... done
|
59
59
|
Sending code snapshot to Mortar... done
|
@@ -86,7 +86,7 @@ STDOUT
|
|
86
86
|
:is_control_script=> false) {Excon::Response.new(:body => {"job_id" => job_id, "web_job_url" => job_url})}
|
87
87
|
|
88
88
|
write_file(File.join(p.pigscripts_path, "my_script.pig"))
|
89
|
-
stderr, stdout = execute("jobs:run my_script -2 --clustersize 5 -p FIRST_PARAM=FOO -p SECOND_PARAM=BAR", p, @git)
|
89
|
+
stderr, stdout = execute("jobs:run pigscripts/my_script.pig -2 --clustersize 5 -p FIRST_PARAM=FOO -p SECOND_PARAM=BAR", p, @git)
|
90
90
|
stdout.should == <<-STDOUT
|
91
91
|
Taking code snapshot... done
|
92
92
|
Sending code snapshot to Mortar... done
|
@@ -110,7 +110,7 @@ Or by running:
|
|
110
110
|
with_git_initialized_project do |p|
|
111
111
|
|
112
112
|
write_file(File.join(p.pigscripts_path, "my_script.pig"))
|
113
|
-
stderr, stdout = execute("jobs:run my_script -2 -1 --clustersize 5 -p FIRST_PARAM=FOO -p SECOND_PARAM=BAR", p, @git)
|
113
|
+
stderr, stdout = execute("jobs:run pigscripts/my_script.pig -2 -1 --clustersize 5 -p FIRST_PARAM=FOO -p SECOND_PARAM=BAR", p, @git)
|
114
114
|
stderr.should == <<-STDERR
|
115
115
|
! Cannot declare cluster as both --singlejobcluster and --permanentcluster
|
116
116
|
STDERR
|
@@ -122,7 +122,7 @@ STDERR
|
|
122
122
|
cluster_id = "e2790e7e8c7d48e39157238d58191346"
|
123
123
|
|
124
124
|
write_file(File.join(p.pigscripts_path, "my_script.pig"))
|
125
|
-
stderr, stdout = execute("jobs:run my_script -2 --clusterid e2790e7e8c7d48e39157238d58191346 -p FIRST_PARAM=FOO -p SECOND_PARAM=BAR", p, @git)
|
125
|
+
stderr, stdout = execute("jobs:run pigscripts/my_script.pig -2 --clusterid e2790e7e8c7d48e39157238d58191346 -p FIRST_PARAM=FOO -p SECOND_PARAM=BAR", p, @git)
|
126
126
|
stderr.should == <<-STDERR
|
127
127
|
! Option permanentcluster cannot be set when running a job on an existing cluster (with --clusterid option)
|
128
128
|
STDERR
|
@@ -143,7 +143,7 @@ STDERR
|
|
143
143
|
:is_control_script=>false) {Excon::Response.new(:body => {"job_id" => job_id, "web_job_url" => job_url})}
|
144
144
|
|
145
145
|
write_file(File.join(p.pigscripts_path, "my_script.pig"))
|
146
|
-
stderr, stdout = execute("jobs:run my_script --clustersize 5 -p FIRST_PARAM=FOO -p SECOND_PARAM=BAR", p, @git)
|
146
|
+
stderr, stdout = execute("jobs:run pigscripts/my_script.pig --clustersize 5 -p FIRST_PARAM=FOO -p SECOND_PARAM=BAR", p, @git)
|
147
147
|
stdout.should == <<-STDOUT
|
148
148
|
Taking code snapshot... done
|
149
149
|
Sending code snapshot to Mortar... done
|
@@ -162,7 +162,39 @@ STDOUT
|
|
162
162
|
end
|
163
163
|
end
|
164
164
|
|
165
|
-
it "runs a control script" do
|
165
|
+
it "runs a control script using new full-path syntax" do
|
166
|
+
with_git_initialized_project do |p|
|
167
|
+
# stub api requests
|
168
|
+
job_id = "c571a8c7f76a4fd4a67c103d753e2dd5"
|
169
|
+
job_url = "http://127.0.0.1:5000/jobs/job_detail?job_id=c571a8c7f76a4fd4a67c103d753e2dd5"
|
170
|
+
cluster_id = "e2790e7e8c7d48e39157238d58191346"
|
171
|
+
|
172
|
+
mock(Mortar::Auth.api).post_job_existing_cluster("myproject", "my_script", is_a(String), cluster_id,
|
173
|
+
:parameters => [],
|
174
|
+
:notify_on_job_finish => false,
|
175
|
+
:is_control_script=>true) {Excon::Response.new(:body => {"job_id" => job_id, "web_job_url" => job_url})}
|
176
|
+
|
177
|
+
write_file(File.join(p.controlscripts_path, "my_script.py"))
|
178
|
+
stderr, stdout = execute("jobs:run controlscripts/my_script.pig --clusterid e2790e7e8c7d48e39157238d58191346 -d", p, @git)
|
179
|
+
stdout.should == <<-STDOUT
|
180
|
+
Taking code snapshot... done
|
181
|
+
Sending code snapshot to Mortar... done
|
182
|
+
Requesting job execution... done
|
183
|
+
job_id: c571a8c7f76a4fd4a67c103d753e2dd5
|
184
|
+
|
185
|
+
Job status can be viewed on the web at:
|
186
|
+
|
187
|
+
http://127.0.0.1:5000/jobs/job_detail?job_id=c571a8c7f76a4fd4a67c103d753e2dd5
|
188
|
+
|
189
|
+
Or by running:
|
190
|
+
|
191
|
+
mortar jobs:status c571a8c7f76a4fd4a67c103d753e2dd5 --poll
|
192
|
+
|
193
|
+
STDOUT
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
197
|
+
it "runs a control script using deprecated no-path controlscript syntax" do
|
166
198
|
with_git_initialized_project do |p|
|
167
199
|
# stub api requests
|
168
200
|
job_id = "c571a8c7f76a4fd4a67c103d753e2dd5"
|
@@ -194,7 +226,42 @@ STDOUT
|
|
194
226
|
end
|
195
227
|
end
|
196
228
|
|
197
|
-
it "runs a job with no cluster defined" do
|
229
|
+
it "runs a job with no cluster defined using deprecated no-path pigscript syntax" do
|
230
|
+
with_git_initialized_project do |p|
|
231
|
+
job_id = "c571a8c7f76a4fd4a67c103d753e2dd5"
|
232
|
+
job_url = "http://127.0.0.1:5000/jobs/job_detail?job_id=c571a8c7f76a4fd4a67c103d753e2dd5"
|
233
|
+
cluster_size = 2
|
234
|
+
|
235
|
+
mock(Mortar::Auth.api).get_clusters() {Excon::Response.new(:body => {'clusters' => []})}
|
236
|
+
mock(Mortar::Auth.api).post_job_new_cluster("myproject", "my_script", is_a(String), cluster_size,
|
237
|
+
:parameters => [],
|
238
|
+
:cluster_type => Jobs::CLUSTER_TYPE__PERSISTENT,
|
239
|
+
:notify_on_job_finish => true,
|
240
|
+
:is_control_script=>false) {Excon::Response.new(:body => {"job_id" => job_id, "web_job_url" => job_url})}
|
241
|
+
|
242
|
+
write_file(File.join(p.pigscripts_path, "my_script.pig"))
|
243
|
+
stderr, stdout = execute("jobs:run my_script", p, @git)
|
244
|
+
stdout.should == <<-STDOUT
|
245
|
+
Defaulting to running job on new cluster of size 2
|
246
|
+
Taking code snapshot... done
|
247
|
+
Sending code snapshot to Mortar... done
|
248
|
+
Requesting job execution... done
|
249
|
+
job_id: c571a8c7f76a4fd4a67c103d753e2dd5
|
250
|
+
|
251
|
+
Job status can be viewed on the web at:
|
252
|
+
|
253
|
+
http://127.0.0.1:5000/jobs/job_detail?job_id=c571a8c7f76a4fd4a67c103d753e2dd5
|
254
|
+
|
255
|
+
Or by running:
|
256
|
+
|
257
|
+
mortar jobs:status c571a8c7f76a4fd4a67c103d753e2dd5 --poll
|
258
|
+
|
259
|
+
STDOUT
|
260
|
+
|
261
|
+
end
|
262
|
+
end
|
263
|
+
|
264
|
+
it "runs a job with no cluster defined using new full-path pigscript syntax" do
|
198
265
|
with_git_initialized_project do |p|
|
199
266
|
job_id = "c571a8c7f76a4fd4a67c103d753e2dd5"
|
200
267
|
job_url = "http://127.0.0.1:5000/jobs/job_detail?job_id=c571a8c7f76a4fd4a67c103d753e2dd5"
|
@@ -208,7 +275,7 @@ STDOUT
|
|
208
275
|
:is_control_script=>false) {Excon::Response.new(:body => {"job_id" => job_id, "web_job_url" => job_url})}
|
209
276
|
|
210
277
|
write_file(File.join(p.pigscripts_path, "my_script.pig"))
|
211
|
-
stderr, stdout = execute("jobs:run my_script ", p, @git)
|
278
|
+
stderr, stdout = execute("jobs:run pigscripts/my_script.pig ", p, @git)
|
212
279
|
stdout.should == <<-STDOUT
|
213
280
|
Defaulting to running job on new cluster of size 2
|
214
281
|
Taking code snapshot... done
|
@@ -239,7 +306,7 @@ STDOUT
|
|
239
306
|
mock(Mortar::Auth.api).post_job_existing_cluster("myproject", "my_script", is_a(String), cluster_id, :parameters => [], :notify_on_job_finish => false, :is_control_script=>false) {Excon::Response.new(:body => {"job_id" => job_id, "web_job_url" => job_url})}
|
240
307
|
|
241
308
|
write_file(File.join(p.pigscripts_path, "my_script.pig"))
|
242
|
-
stderr, stdout = execute("jobs:run my_script --clusterid e2790e7e8c7d48e39157238d58191346 -d", p, @git)
|
309
|
+
stderr, stdout = execute("jobs:run pigscripts/my_script.pig --clusterid e2790e7e8c7d48e39157238d58191346 -d", p, @git)
|
243
310
|
stdout.should == <<-STDOUT
|
244
311
|
Taking code snapshot... done
|
245
312
|
Sending code snapshot to Mortar... done
|
@@ -294,7 +361,7 @@ STDOUT
|
|
294
361
|
:is_control_script=>false) {Excon::Response.new(:body => {"job_id" => job_id, "web_job_url" => job_url})}
|
295
362
|
|
296
363
|
write_file(File.join(p.pigscripts_path, "my_script.pig"))
|
297
|
-
stderr, stdout = execute("jobs:run my_script ", p, @git)
|
364
|
+
stderr, stdout = execute("jobs:run pigscripts/my_script.pig ", p, @git)
|
298
365
|
stdout.should == <<-STDOUT
|
299
366
|
Defaulting to running job on largest existing free cluster, id = 510bf0db3004860820ab6590, size = 5
|
300
367
|
Taking code snapshot... done
|
@@ -336,7 +403,7 @@ THIRD=BEAR
|
|
336
403
|
PARAMS
|
337
404
|
|
338
405
|
write_file(File.join(p.root_path, "params.ini"), parameters)
|
339
|
-
stderr, stdout = execute("jobs:run my_script --clustersize 5 -p FIRST=FOO -p SECOND=BAR --param-file params.ini", p, @git)
|
406
|
+
stderr, stdout = execute("jobs:run pigscripts/my_script.pig --clustersize 5 -p FIRST=FOO -p SECOND=BAR --param-file params.ini", p, @git)
|
340
407
|
end
|
341
408
|
end
|
342
409
|
|
@@ -362,7 +429,7 @@ THIRD=BEAR
|
|
362
429
|
PARAMS
|
363
430
|
|
364
431
|
write_file(File.join(p.root_path, "params.ini"), parameters)
|
365
|
-
stderr, stdout = execute("jobs:run my_script --clustersize 5 -p FIRST=FOO -p SECOND=BAR --param-file params.ini", p, @git)
|
432
|
+
stderr, stdout = execute("jobs:run pigscripts/my_script.pig --clustersize 5 -p FIRST=FOO -p SECOND=BAR --param-file params.ini", p, @git)
|
366
433
|
end
|
367
434
|
end
|
368
435
|
|
@@ -382,7 +449,7 @@ THIRD=BEAR
|
|
382
449
|
PARAMS
|
383
450
|
|
384
451
|
write_file(File.join(p.root_path, "params.ini"), parameters)
|
385
|
-
stderr, stdout = execute("jobs:run my_script --clustersize 5 -p FIRST=FOO -p SECOND=BAR --param-file params.ini", p, @git)
|
452
|
+
stderr, stdout = execute("jobs:run pigscripts/my_script.pig --clustersize 5 -p FIRST=FOO -p SECOND=BAR --param-file params.ini", p, @git)
|
386
453
|
stderr.should == <<-STDERR
|
387
454
|
! Parameter file is malformed
|
388
455
|
STDERR
|
@@ -405,7 +472,7 @@ STDERR
|
|
405
472
|
:is_control_script=>false) {Excon::Response.new(:body => {"job_id" => job_id, "web_job_url" => job_url})}
|
406
473
|
|
407
474
|
write_file(File.join(p.pigscripts_path, "my_script.pig"))
|
408
|
-
stderr, stdout = execute("jobs:run my_script --clustersize 5 -p FIRST_PARAM=FOO -p SECOND_PARAM=BAR", p, @git)
|
475
|
+
stderr, stdout = execute("jobs:run pigscripts/my_script.pig --clustersize 5 -p FIRST_PARAM=FOO -p SECOND_PARAM=BAR", p, @git)
|
409
476
|
end
|
410
477
|
end
|
411
478
|
end
|
@@ -26,11 +26,11 @@ module Mortar::Command
|
|
26
26
|
it "errors when the script doesn't exist" do
|
27
27
|
with_git_initialized_project do |p|
|
28
28
|
write_file(File.join(p.pigscripts_path, "my_other_script.pig"))
|
29
|
-
stderr, stdout = execute("local:illustrate my_script some_alias", p)
|
29
|
+
stderr, stdout = execute("local:illustrate pigscripts/my_script.pig some_alias", p)
|
30
30
|
stderr.should == <<-STDERR
|
31
|
-
! Unable to find pigscript my_script
|
31
|
+
! Unable to find pigscript pigscripts/my_script.pig
|
32
32
|
! Available scripts:
|
33
|
-
! my_other_script
|
33
|
+
! pigscripts/my_other_script.pig
|
34
34
|
STDERR
|
35
35
|
end
|
36
36
|
end
|
@@ -74,15 +74,15 @@ STDERR
|
|
74
74
|
with_git_initialized_project do |p|
|
75
75
|
write_file(File.join(p.pigscripts_path, "my_other_script.pig"))
|
76
76
|
write_file(File.join(p.controlscripts_path, "my_control_script.py"))
|
77
|
-
stderr, stdout = execute("local:run my_script", p)
|
77
|
+
stderr, stdout = execute("local:run pigscripts/my_script.pig", p)
|
78
78
|
stderr.should == <<-STDERR
|
79
|
-
! Unable to find a pigscript or controlscript for my_script
|
79
|
+
! Unable to find a pigscript or controlscript for pigscripts/my_script.pig
|
80
80
|
!
|
81
81
|
! Available pigscripts:
|
82
|
-
! my_other_script
|
82
|
+
! pigscripts/my_other_script.pig
|
83
83
|
!
|
84
84
|
! Available controlscripts:
|
85
|
-
! my_control_script
|
85
|
+
! controlscripts/my_control_script.pig
|
86
86
|
STDERR
|
87
87
|
end
|
88
88
|
end
|
@@ -97,7 +97,7 @@ STDERR
|
|
97
97
|
any_instance_of(Mortar::Local::Controller) do |u|
|
98
98
|
mock(u).run(pigscript, []).returns(nil)
|
99
99
|
end
|
100
|
-
stderr, stdout = execute("local:run
|
100
|
+
stderr, stdout = execute("local:run pigscripts/#{script_name}.pig", p)
|
101
101
|
stderr.should == ""
|
102
102
|
end
|
103
103
|
end
|
@@ -156,7 +156,7 @@ STDERR
|
|
156
156
|
|
157
157
|
context "local:validate" do
|
158
158
|
|
159
|
-
it "Runs pig with the -check command option" do
|
159
|
+
it "Runs pig with the -check command option for deprecated no-path pigscript syntax" do
|
160
160
|
with_git_initialized_project do |p|
|
161
161
|
script_name = "some_script"
|
162
162
|
script_path = File.join(p.pigscripts_path, "#{script_name}.pig")
|
@@ -174,6 +174,24 @@ STDERR
|
|
174
174
|
end
|
175
175
|
end
|
176
176
|
|
177
|
+
it "Runs pig with the -check command option for new full-path pigscript syntax" do
|
178
|
+
with_git_initialized_project do |p|
|
179
|
+
script_name = "some_script"
|
180
|
+
script_path = File.join(p.pigscripts_path, "#{script_name}.pig")
|
181
|
+
write_file(script_path)
|
182
|
+
pigscript = Mortar::Project::PigScript.new(script_name, script_path)
|
183
|
+
mock(Mortar::Project::PigScript).new(script_name, script_path).returns(pigscript)
|
184
|
+
any_instance_of(Mortar::Local::Controller) do |u|
|
185
|
+
mock(u).install_and_configure
|
186
|
+
end
|
187
|
+
any_instance_of(Mortar::Local::Pig) do |u|
|
188
|
+
mock(u).run_pig_command(" -check #{pigscript.path}", [])
|
189
|
+
end
|
190
|
+
stderr, stdout = execute("local:validate pigscripts/#{script_name}.pig", p)
|
191
|
+
stderr.should == ""
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
177
195
|
end
|
178
196
|
|
179
197
|
end
|
@@ -46,7 +46,7 @@ STDOUT
|
|
46
46
|
stderr, stdout = execute("pigscripts", p)
|
47
47
|
stdout.should == <<-STDOUT
|
48
48
|
=== pigscripts
|
49
|
-
my_script
|
49
|
+
pigscripts/my_script.pig
|
50
50
|
|
51
51
|
STDOUT
|
52
52
|
end
|
@@ -59,8 +59,8 @@ STDOUT
|
|
59
59
|
stderr, stdout = execute("pigscripts", p)
|
60
60
|
stdout.should == <<-STDOUT
|
61
61
|
=== pigscripts
|
62
|
-
a_script
|
63
|
-
b_script
|
62
|
+
pigscripts/a_script.pig
|
63
|
+
pigscripts/b_script.pig
|
64
64
|
|
65
65
|
STDOUT
|
66
66
|
end
|
data/spec/mortar/project_spec.rb
CHANGED
metadata
CHANGED
@@ -1,167 +1,164 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: mortar
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 63
|
5
5
|
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 8
|
9
|
+
- 0
|
10
|
+
version: 0.8.0
|
6
11
|
platform: ruby
|
7
|
-
authors:
|
12
|
+
authors:
|
8
13
|
- Mortar Data
|
9
14
|
autorequire:
|
10
15
|
bindir: bin
|
11
16
|
cert_chain: []
|
12
|
-
|
13
|
-
|
14
|
-
|
17
|
+
|
18
|
+
date: 2013-05-10 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
15
21
|
name: mortar-api-ruby
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - ~>
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: 0.6.3
|
22
|
-
type: :runtime
|
23
22
|
prerelease: false
|
24
|
-
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
24
|
none: false
|
26
|
-
requirements:
|
25
|
+
requirements:
|
27
26
|
- - ~>
|
28
|
-
- !ruby/object:Gem::Version
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 1
|
29
|
+
segments:
|
30
|
+
- 0
|
31
|
+
- 6
|
32
|
+
- 3
|
29
33
|
version: 0.6.3
|
30
|
-
- !ruby/object:Gem::Dependency
|
31
|
-
name: netrc
|
32
|
-
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
|
-
requirements:
|
35
|
-
- - ~>
|
36
|
-
- !ruby/object:Gem::Version
|
37
|
-
version: '0.7'
|
38
34
|
type: :runtime
|
35
|
+
version_requirements: *id001
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: netrc
|
39
38
|
prerelease: false
|
40
|
-
|
39
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
41
40
|
none: false
|
42
|
-
requirements:
|
41
|
+
requirements:
|
43
42
|
- - ~>
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
requirements:
|
51
|
-
- - ~>
|
52
|
-
- !ruby/object:Gem::Version
|
53
|
-
version: '2.1'
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
hash: 5
|
45
|
+
segments:
|
46
|
+
- 0
|
47
|
+
- 7
|
48
|
+
version: "0.7"
|
54
49
|
type: :runtime
|
50
|
+
version_requirements: *id002
|
51
|
+
- !ruby/object:Gem::Dependency
|
52
|
+
name: launchy
|
55
53
|
prerelease: false
|
56
|
-
|
54
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
57
55
|
none: false
|
58
|
-
requirements:
|
56
|
+
requirements:
|
59
57
|
- - ~>
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
|
62
|
-
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
hash: 1
|
60
|
+
segments:
|
61
|
+
- 2
|
62
|
+
- 1
|
63
|
+
version: "2.1"
|
64
|
+
type: :runtime
|
65
|
+
version_requirements: *id003
|
66
|
+
- !ruby/object:Gem::Dependency
|
63
67
|
name: excon
|
64
|
-
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
|
-
requirements:
|
67
|
-
- - ~>
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '0.15'
|
70
|
-
type: :development
|
71
68
|
prerelease: false
|
72
|
-
|
73
|
-
none: false
|
74
|
-
requirements:
|
75
|
-
- - ~>
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
version: '0.15'
|
78
|
-
- !ruby/object:Gem::Dependency
|
79
|
-
name: fakefs
|
80
|
-
requirement: !ruby/object:Gem::Requirement
|
69
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
81
70
|
none: false
|
82
|
-
requirements:
|
71
|
+
requirements:
|
83
72
|
- - ~>
|
84
|
-
- !ruby/object:Gem::Version
|
85
|
-
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
hash: 21
|
75
|
+
segments:
|
76
|
+
- 0
|
77
|
+
- 15
|
78
|
+
version: "0.15"
|
86
79
|
type: :development
|
80
|
+
version_requirements: *id004
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: fakefs
|
87
83
|
prerelease: false
|
88
|
-
|
84
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
89
85
|
none: false
|
90
|
-
requirements:
|
86
|
+
requirements:
|
91
87
|
- - ~>
|
92
|
-
- !ruby/object:Gem::Version
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
hash: 11
|
90
|
+
segments:
|
91
|
+
- 0
|
92
|
+
- 4
|
93
|
+
- 2
|
93
94
|
version: 0.4.2
|
94
|
-
- !ruby/object:Gem::Dependency
|
95
|
-
name: gem-release
|
96
|
-
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
|
-
requirements:
|
99
|
-
- - ! '>='
|
100
|
-
- !ruby/object:Gem::Version
|
101
|
-
version: '0'
|
102
95
|
type: :development
|
96
|
+
version_requirements: *id005
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: gem-release
|
103
99
|
prerelease: false
|
104
|
-
|
105
|
-
none: false
|
106
|
-
requirements:
|
107
|
-
- - ! '>='
|
108
|
-
- !ruby/object:Gem::Version
|
109
|
-
version: '0'
|
110
|
-
- !ruby/object:Gem::Dependency
|
111
|
-
name: rake
|
112
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
113
101
|
none: false
|
114
|
-
requirements:
|
115
|
-
- -
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
|
102
|
+
requirements:
|
103
|
+
- - ">="
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
hash: 3
|
106
|
+
segments:
|
107
|
+
- 0
|
108
|
+
version: "0"
|
118
109
|
type: :development
|
110
|
+
version_requirements: *id006
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rake
|
119
113
|
prerelease: false
|
120
|
-
|
121
|
-
none: false
|
122
|
-
requirements:
|
123
|
-
- - ! '>='
|
124
|
-
- !ruby/object:Gem::Version
|
125
|
-
version: '0'
|
126
|
-
- !ruby/object:Gem::Dependency
|
127
|
-
name: rr
|
128
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
129
115
|
none: false
|
130
|
-
requirements:
|
131
|
-
- -
|
132
|
-
- !ruby/object:Gem::Version
|
133
|
-
|
116
|
+
requirements:
|
117
|
+
- - ">="
|
118
|
+
- !ruby/object:Gem::Version
|
119
|
+
hash: 3
|
120
|
+
segments:
|
121
|
+
- 0
|
122
|
+
version: "0"
|
134
123
|
type: :development
|
124
|
+
version_requirements: *id007
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: rr
|
135
127
|
prerelease: false
|
136
|
-
|
128
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
137
129
|
none: false
|
138
|
-
requirements:
|
139
|
-
- -
|
140
|
-
- !ruby/object:Gem::Version
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
none: false
|
146
|
-
requirements:
|
147
|
-
- - ! '>='
|
148
|
-
- !ruby/object:Gem::Version
|
149
|
-
version: '0'
|
130
|
+
requirements:
|
131
|
+
- - ">="
|
132
|
+
- !ruby/object:Gem::Version
|
133
|
+
hash: 3
|
134
|
+
segments:
|
135
|
+
- 0
|
136
|
+
version: "0"
|
150
137
|
type: :development
|
138
|
+
version_requirements: *id008
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rspec
|
151
141
|
prerelease: false
|
152
|
-
|
142
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
153
143
|
none: false
|
154
|
-
requirements:
|
155
|
-
- -
|
156
|
-
- !ruby/object:Gem::Version
|
157
|
-
|
144
|
+
requirements:
|
145
|
+
- - ">="
|
146
|
+
- !ruby/object:Gem::Version
|
147
|
+
hash: 3
|
148
|
+
segments:
|
149
|
+
- 0
|
150
|
+
version: "0"
|
151
|
+
type: :development
|
152
|
+
version_requirements: *id009
|
158
153
|
description: Client library and command-line tool to interact with the Mortar service.
|
159
154
|
email: support@mortardata.com
|
160
|
-
executables:
|
155
|
+
executables:
|
161
156
|
- mortar
|
162
157
|
extensions: []
|
158
|
+
|
163
159
|
extra_rdoc_files: []
|
164
|
-
|
160
|
+
|
161
|
+
files:
|
165
162
|
- README.md
|
166
163
|
- bin/mortar
|
167
164
|
- css/illustrate.css
|
@@ -252,26 +249,38 @@ files:
|
|
252
249
|
- spec/support/display_message_matcher.rb
|
253
250
|
homepage: http://mortardata.com/
|
254
251
|
licenses: []
|
252
|
+
|
255
253
|
post_install_message:
|
256
254
|
rdoc_options: []
|
257
|
-
|
255
|
+
|
256
|
+
require_paths:
|
258
257
|
- lib
|
259
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
258
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
260
259
|
none: false
|
261
|
-
requirements:
|
262
|
-
- -
|
263
|
-
- !ruby/object:Gem::Version
|
260
|
+
requirements:
|
261
|
+
- - ">="
|
262
|
+
- !ruby/object:Gem::Version
|
263
|
+
hash: 57
|
264
|
+
segments:
|
265
|
+
- 1
|
266
|
+
- 8
|
267
|
+
- 7
|
264
268
|
version: 1.8.7
|
265
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
269
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
266
270
|
none: false
|
267
|
-
requirements:
|
268
|
-
- -
|
269
|
-
- !ruby/object:Gem::Version
|
270
|
-
|
271
|
+
requirements:
|
272
|
+
- - ">="
|
273
|
+
- !ruby/object:Gem::Version
|
274
|
+
hash: 3
|
275
|
+
segments:
|
276
|
+
- 0
|
277
|
+
version: "0"
|
271
278
|
requirements: []
|
279
|
+
|
272
280
|
rubyforge_project:
|
273
|
-
rubygems_version: 1.8.
|
281
|
+
rubygems_version: 1.8.24
|
274
282
|
signing_key:
|
275
283
|
specification_version: 3
|
276
284
|
summary: Client library and CLI to interact with the Mortar service.
|
277
285
|
test_files: []
|
286
|
+
|