mortar 0.15.47 → 0.15.48
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.
- checksums.yaml +5 -5
- data/README.md +5 -1
- data/lib/mortar/command/base.rb +1 -1
- data/lib/mortar/command/spark.rb +3 -4
- data/lib/mortar/version.rb +1 -1
- data/spec/mortar/auth_spec.rb +2 -2
- data/spec/mortar/command/generate_spec.rb +17 -17
- data/spec/mortar/command/local_spec.rb +4 -4
- data/spec/mortar/command/projects_spec.rb +29 -29
- data/spec/mortar/git_spec.rb +61 -61
- data/spec/mortar/helpers_spec.rb +5 -5
- data/spec/mortar/local/installutil_spec.rb +6 -6
- data/spec/mortar/local/jython_spec.rb +4 -4
- data/spec/mortar/local/pig_spec.rb +8 -8
- data/spec/mortar/local/python_spec.rb +2 -2
- data/spec/mortar/plugin_spec.rb +11 -11
- data/spec/mortar/project_spec.rb +4 -4
- data/spec/spec_helper.rb +4 -4
- metadata +29 -29
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: df7144cd0787fbc7bf15d5506271c61db16f9bc903094c4bfbc5176bc6f1c094
|
|
4
|
+
data.tar.gz: 11be2d17acefd3d8954551b755e06db9f0c18523a813b7d09a0a7f39b943e5db
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b9b279c857d9a1d150541dd3b7a0505d3a7c1d28782c318ad3810ccc376102c06fb60db5797508c64501e6b5778e53e50c660d3bce44098b5143ca0ce867beed
|
|
7
|
+
data.tar.gz: 26ccbb82a30aa177086b14567cafba034df1e3fb4664b7b783bdb456ffd79751e76d764b73a60900fafc27cdaea0216a8747f4298fd3c437dcc8757301f49f19
|
data/README.md
CHANGED
|
@@ -16,7 +16,7 @@ The Mortar Development Framework lets you develop Mortar Hadoop jobs directly on
|
|
|
16
16
|
|
|
17
17
|
## Installation
|
|
18
18
|
|
|
19
|
-
gem install mortar
|
|
19
|
+
sudo gem install mortar --bindir /usr/local/bin
|
|
20
20
|
|
|
21
21
|
# Development
|
|
22
22
|
|
|
@@ -26,6 +26,10 @@ To develop on the gem, install the bundle, and then use bundle exec to run morta
|
|
|
26
26
|
bundle install
|
|
27
27
|
bundle exec mortar <command> <args>
|
|
28
28
|
|
|
29
|
+
If you want to run the modified `mortar` from a different directory (e.g. from `dd-analytics`), you need to do it like this:
|
|
30
|
+
|
|
31
|
+
BUNDLE_GEMFILE="/path/to/mortar/Gemfile" bundle exec mortar
|
|
32
|
+
|
|
29
33
|
# Tests
|
|
30
34
|
|
|
31
35
|
You can run all the RSpec tests with rake:
|
data/lib/mortar/command/base.rb
CHANGED
data/lib/mortar/command/spark.rb
CHANGED
|
@@ -109,10 +109,9 @@ class Mortar::Command::Spark < Mortar::Command::Base
|
|
|
109
109
|
|
|
110
110
|
response = action("Requesting job execution") do
|
|
111
111
|
cluster_id = options[:clusterid]
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
).body
|
|
112
|
+
args = { script_arguments: script_arguments }
|
|
113
|
+
args[:clustersize] = options[:clustersize] if options[:clustersize]
|
|
114
|
+
api.post_spark_job_on_jobserver(project_name, class_name, git_ref, cluster_id, **args).body
|
|
116
115
|
end
|
|
117
116
|
|
|
118
117
|
display("job_id: #{response['job_id']}")
|
data/lib/mortar/version.rb
CHANGED
data/spec/mortar/auth_spec.rb
CHANGED
|
@@ -165,12 +165,12 @@ module Mortar
|
|
|
165
165
|
|
|
166
166
|
it "is true if the user is currently logged in" do
|
|
167
167
|
# login (aka writing the auth file) is done in setup
|
|
168
|
-
expect(@cli.has_credentials).to
|
|
168
|
+
expect(@cli.has_credentials).to be_truthy
|
|
169
169
|
end
|
|
170
170
|
|
|
171
171
|
it "is false if the user is not logged in" do
|
|
172
172
|
@cli.logout
|
|
173
|
-
expect(@cli.has_credentials).to
|
|
173
|
+
expect(@cli.has_credentials).to be_falsy
|
|
174
174
|
end
|
|
175
175
|
|
|
176
176
|
it "uses path from env when specified" do
|
|
@@ -30,17 +30,17 @@ describe Mortar::Command::Generate do
|
|
|
30
30
|
describe "generate:project" do
|
|
31
31
|
it "creates new project" do
|
|
32
32
|
stderr, stdout = execute("generate:project Test")
|
|
33
|
-
File.exists?("Test").should
|
|
34
|
-
File.exists?("Test/macros").should
|
|
35
|
-
File.exists?("Test/pigscripts").should
|
|
36
|
-
File.exists?("Test/udfs").should
|
|
37
|
-
File.exists?("Test/README.md").should
|
|
38
|
-
File.exists?("Test/Gemfile").should
|
|
39
|
-
File.exists?("Test/macros/.gitkeep").should
|
|
40
|
-
File.exists?("Test/pigscripts/Test.pig").should
|
|
41
|
-
File.exists?("Test/udfs/python/Test.py").should
|
|
42
|
-
File.exists?("Test/luigiscripts/README").should
|
|
43
|
-
File.exists?("Test/sparkscripts/README").should
|
|
33
|
+
File.exists?("Test").should be_truthy
|
|
34
|
+
File.exists?("Test/macros").should be_truthy
|
|
35
|
+
File.exists?("Test/pigscripts").should be_truthy
|
|
36
|
+
File.exists?("Test/udfs").should be_truthy
|
|
37
|
+
File.exists?("Test/README.md").should be_truthy
|
|
38
|
+
File.exists?("Test/Gemfile").should be_falsy
|
|
39
|
+
File.exists?("Test/macros/.gitkeep").should be_truthy
|
|
40
|
+
File.exists?("Test/pigscripts/Test.pig").should be_truthy
|
|
41
|
+
File.exists?("Test/udfs/python/Test.py").should be_truthy
|
|
42
|
+
File.exists?("Test/luigiscripts/README").should be_truthy
|
|
43
|
+
File.exists?("Test/sparkscripts/README").should be_truthy
|
|
44
44
|
|
|
45
45
|
File.read("Test/pigscripts/Test.pig").each_line { |line| line.match(/<%.*%>/).should be_nil }
|
|
46
46
|
end
|
|
@@ -62,7 +62,7 @@ STDERR
|
|
|
62
62
|
rescue => e
|
|
63
63
|
e.message.should == 'Bad Copy'
|
|
64
64
|
end
|
|
65
|
-
File.exists?("Test").should
|
|
65
|
+
File.exists?("Test").should be_falsy
|
|
66
66
|
end
|
|
67
67
|
|
|
68
68
|
it 'does not remove pre-existing project directory when generate:project fails' do
|
|
@@ -75,7 +75,7 @@ STDERR
|
|
|
75
75
|
rescue => e
|
|
76
76
|
e.message.should == 'Bad Copy'
|
|
77
77
|
end
|
|
78
|
-
File.exists?("Test").should
|
|
78
|
+
File.exists?("Test").should be_truthy
|
|
79
79
|
end
|
|
80
80
|
end
|
|
81
81
|
|
|
@@ -83,7 +83,7 @@ STDERR
|
|
|
83
83
|
it "Generate a new pigscript in a project" do
|
|
84
84
|
with_blank_project do |p|
|
|
85
85
|
stderr, stdout = execute("generate:pigscript Oink", p)
|
|
86
|
-
File.exists?(File.join(p.root_path, "pigscripts/Oink.pig")).should
|
|
86
|
+
File.exists?(File.join(p.root_path, "pigscripts/Oink.pig")).should be_truthy
|
|
87
87
|
File.read("pigscripts/Oink.pig").each_line { |line| line.match(/<%.*%>/).should be_nil }
|
|
88
88
|
end
|
|
89
89
|
end
|
|
@@ -103,7 +103,7 @@ STDERR
|
|
|
103
103
|
it "Generate a new controlscript in a project" do
|
|
104
104
|
with_blank_project do |p|
|
|
105
105
|
stderr, stdout = execute("generate:controlscript Oink", p)
|
|
106
|
-
File.exists?(File.join(p.root_path, "controlscripts/Oink.py")).should
|
|
106
|
+
File.exists?(File.join(p.root_path, "controlscripts/Oink.py")).should be_truthy
|
|
107
107
|
File.read("controlscripts/Oink.py").each_line { |line| line.match(/<%.*%>/).should be_nil }
|
|
108
108
|
end
|
|
109
109
|
end
|
|
@@ -123,7 +123,7 @@ STDERR
|
|
|
123
123
|
it "Generate a new python udf in a project" do
|
|
124
124
|
with_blank_project do |p|
|
|
125
125
|
stderr, stdout = execute("generate:python_udf slither", p)
|
|
126
|
-
File.exists?(File.join(p.root_path, "udfs/python/slither.py")).should
|
|
126
|
+
File.exists?(File.join(p.root_path, "udfs/python/slither.py")).should be_truthy
|
|
127
127
|
File.read("udfs/python/slither.py").each_line { |line| line.match(/<%.*%>/).should be_nil }
|
|
128
128
|
end
|
|
129
129
|
end
|
|
@@ -143,7 +143,7 @@ STDERR
|
|
|
143
143
|
it "Generate a new macro in a project" do
|
|
144
144
|
with_blank_project do |p|
|
|
145
145
|
stderr, stdout = execute("generate:macro big_mac", p)
|
|
146
|
-
File.exists?(File.join(p.root_path, "macros/big_mac.pig")).should
|
|
146
|
+
File.exists?(File.join(p.root_path, "macros/big_mac.pig")).should be_truthy
|
|
147
147
|
File.read("macros/big_mac.pig").each_line { |line| line.match(/<%.*%>/).should be_nil }
|
|
148
148
|
end
|
|
149
149
|
end
|
|
@@ -152,10 +152,10 @@ PARAMS
|
|
|
152
152
|
end
|
|
153
153
|
stderr, stdout = execute("generate:project Test")
|
|
154
154
|
stderr, stdout = execute("local:characterize -f test.params --project_root Test")
|
|
155
|
-
File.exists?("Test/pigscripts/characterize.pig").should
|
|
156
|
-
File.exists?("Test/macros/characterize_macro.pig").should
|
|
157
|
-
File.exists?("Test/udfs/jython/top_5_tuple.py").should
|
|
158
|
-
File.exists?("Test/controlscripts/lib/characterize_control.py").should
|
|
155
|
+
File.exists?("Test/pigscripts/characterize.pig").should be_falsy
|
|
156
|
+
File.exists?("Test/macros/characterize_macro.pig").should be_falsy
|
|
157
|
+
File.exists?("Test/udfs/jython/top_5_tuple.py").should be_falsy
|
|
158
|
+
File.exists?("Test/controlscripts/lib/characterize_control.py").should be_falsy
|
|
159
159
|
File.delete("test.params")
|
|
160
160
|
end
|
|
161
161
|
|
|
@@ -139,25 +139,25 @@ STDOUT
|
|
|
139
139
|
mock(@git).push_master
|
|
140
140
|
|
|
141
141
|
stderr, stdout = execute("projects:create #{project_name}", nil, @git)
|
|
142
|
-
Dir.pwd.end_with?("some_new_project").should
|
|
143
|
-
File.exists?("macros").should
|
|
144
|
-
File.exists?("pigscripts").should
|
|
145
|
-
File.exists?("udfs").should
|
|
146
|
-
File.exists?("project.properties").should
|
|
147
|
-
File.exists?("project.manifest").should
|
|
148
|
-
File.exists?("requirements.txt").should
|
|
149
|
-
File.exists?("README.md").should
|
|
150
|
-
File.exists?("Gemfile").should
|
|
151
|
-
File.exists?("macros/.gitkeep").should
|
|
152
|
-
File.exists?("pigscripts/some_new_project.pig").should
|
|
153
|
-
File.exists?("udfs/python/some_new_project.py").should
|
|
154
|
-
File.exists?("luigiscripts/README").should
|
|
155
|
-
File.exists?("luigiscripts/some_new_project_luigi.py").should
|
|
156
|
-
File.exists?("luigiscripts/client.cfg.template").should
|
|
157
|
-
File.exists?("sparkscripts/README").should
|
|
158
|
-
File.exists?("sparkscripts/some_new_project_pi.py").should
|
|
159
|
-
File.exists?("lib/README").should
|
|
160
|
-
File.exists?("params/README").should
|
|
142
|
+
Dir.pwd.end_with?("some_new_project").should be_truthy
|
|
143
|
+
File.exists?("macros").should be_truthy
|
|
144
|
+
File.exists?("pigscripts").should be_truthy
|
|
145
|
+
File.exists?("udfs").should be_truthy
|
|
146
|
+
File.exists?("project.properties").should be_truthy
|
|
147
|
+
File.exists?("project.manifest").should be_truthy
|
|
148
|
+
File.exists?("requirements.txt").should be_truthy
|
|
149
|
+
File.exists?("README.md").should be_truthy
|
|
150
|
+
File.exists?("Gemfile").should be_falsy
|
|
151
|
+
File.exists?("macros/.gitkeep").should be_truthy
|
|
152
|
+
File.exists?("pigscripts/some_new_project.pig").should be_truthy
|
|
153
|
+
File.exists?("udfs/python/some_new_project.py").should be_truthy
|
|
154
|
+
File.exists?("luigiscripts/README").should be_truthy
|
|
155
|
+
File.exists?("luigiscripts/some_new_project_luigi.py").should be_truthy
|
|
156
|
+
File.exists?("luigiscripts/client.cfg.template").should be_truthy
|
|
157
|
+
File.exists?("sparkscripts/README").should be_truthy
|
|
158
|
+
File.exists?("sparkscripts/some_new_project_pi.py").should be_truthy
|
|
159
|
+
File.exists?("lib/README").should be_truthy
|
|
160
|
+
File.exists?("params/README").should be_truthy
|
|
161
161
|
|
|
162
162
|
File.read("pigscripts/some_new_project.pig").each_line { |line| line.match(/<%.*%>/).should be_nil }
|
|
163
163
|
File.read("luigiscripts/some_new_project_luigi.py").each_line { |line| line.match(/<%.*%>/).should be_nil }
|
|
@@ -225,16 +225,16 @@ STDOUT
|
|
|
225
225
|
mock(@git).sync_embedded_project.with_any_args.times(1) { true }
|
|
226
226
|
|
|
227
227
|
stderr, stdout = execute("projects:create #{project_name} --embedded", nil, @git)
|
|
228
|
-
Dir.pwd.end_with?("some_new_project").should
|
|
229
|
-
File.exists?(".mortar-project-remote").should
|
|
230
|
-
File.exists?("macros").should
|
|
231
|
-
File.exists?("pigscripts").should
|
|
232
|
-
File.exists?("udfs").should
|
|
233
|
-
File.exists?("README.md").should
|
|
234
|
-
File.exists?("Gemfile").should
|
|
235
|
-
File.exists?("macros/.gitkeep").should
|
|
236
|
-
File.exists?("pigscripts/some_new_project.pig").should
|
|
237
|
-
File.exists?("udfs/python/some_new_project.py").should
|
|
228
|
+
Dir.pwd.end_with?("some_new_project").should be_truthy
|
|
229
|
+
File.exists?(".mortar-project-remote").should be_truthy
|
|
230
|
+
File.exists?("macros").should be_truthy
|
|
231
|
+
File.exists?("pigscripts").should be_truthy
|
|
232
|
+
File.exists?("udfs").should be_truthy
|
|
233
|
+
File.exists?("README.md").should be_truthy
|
|
234
|
+
File.exists?("Gemfile").should be_falsy
|
|
235
|
+
File.exists?("macros/.gitkeep").should be_truthy
|
|
236
|
+
File.exists?("pigscripts/some_new_project.pig").should be_truthy
|
|
237
|
+
File.exists?("udfs/python/some_new_project.py").should be_truthy
|
|
238
238
|
|
|
239
239
|
File.read("pigscripts/some_new_project.pig").each_line { |line| line.match(/<%.*%>/).should be_nil }
|
|
240
240
|
end
|
data/spec/mortar/git_spec.rb
CHANGED
|
@@ -29,36 +29,36 @@ module Mortar
|
|
|
29
29
|
context "has_git?" do
|
|
30
30
|
it "returns false with no git installed" do
|
|
31
31
|
mock(@git).run_cmd("git --version").returns(["-bash: git: command not found",-1])
|
|
32
|
-
@git.has_git?.should
|
|
32
|
+
@git.has_git?.should be_falsy
|
|
33
33
|
end
|
|
34
34
|
|
|
35
35
|
it "returns false with unsupported git version" do
|
|
36
36
|
mock(@git).run_cmd("git --version").returns(["git version 1.7.6",0])
|
|
37
|
-
@git.has_git?.should
|
|
37
|
+
@git.has_git?.should be_falsy
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
it "returns true with supported git version 2.0.0" do
|
|
41
41
|
mock(@git).run_cmd("git --version").returns(["git version 2.0.0", 0])
|
|
42
|
-
@git.has_git?.should
|
|
42
|
+
@git.has_git?.should be_truthy
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
it "returns true with supported git version 1.8.0" do
|
|
46
46
|
mock(@git).run_cmd("git --version").returns(["git version 1.8.0", 0])
|
|
47
|
-
@git.has_git?.should
|
|
47
|
+
@git.has_git?.should be_truthy
|
|
48
48
|
end
|
|
49
49
|
|
|
50
50
|
it "returns false with unsupported git version" do
|
|
51
|
-
@git.has_git?.should
|
|
51
|
+
@git.has_git?.should be_truthy
|
|
52
52
|
end
|
|
53
53
|
|
|
54
54
|
it "returns true with supported version with params" do
|
|
55
55
|
mock(@git).run_cmd("git --version").returns(["git version 1.8.0", 0])
|
|
56
|
-
@git.has_git?(major_version=1,minor_version=8,revision_version=0).should
|
|
56
|
+
@git.has_git?(major_version=1,minor_version=8,revision_version=0).should be_truthy
|
|
57
57
|
end
|
|
58
58
|
|
|
59
59
|
it "returns false with unsupported version with params" do
|
|
60
60
|
mock(@git).run_cmd("git --version").returns(["git version 1.7.12", 0])
|
|
61
|
-
@git.has_git?(major_version=1,minor_version=8,revision_version=0).should
|
|
61
|
+
@git.has_git?(major_version=1,minor_version=8,revision_version=0).should be_falsy
|
|
62
62
|
end
|
|
63
63
|
|
|
64
64
|
end
|
|
@@ -67,13 +67,13 @@ module Mortar
|
|
|
67
67
|
|
|
68
68
|
it "finds no commits on a blank project" do
|
|
69
69
|
with_blank_project do |p|
|
|
70
|
-
@git.has_commits?.should
|
|
70
|
+
@git.has_commits?.should be_falsy
|
|
71
71
|
end
|
|
72
72
|
end
|
|
73
73
|
|
|
74
74
|
it "finds commits when a project has them" do
|
|
75
75
|
with_git_initialized_project do |p|
|
|
76
|
-
@git.has_commits?.should
|
|
76
|
+
@git.has_commits?.should be_truthy
|
|
77
77
|
end
|
|
78
78
|
end
|
|
79
79
|
end
|
|
@@ -81,7 +81,7 @@ module Mortar
|
|
|
81
81
|
context "git-rev" do
|
|
82
82
|
it "looks up a revision" do
|
|
83
83
|
with_git_initialized_project do |p|
|
|
84
|
-
@git.git_ref("master").nil?.should
|
|
84
|
+
@git.git_ref("master").nil?.should be_falsy
|
|
85
85
|
end
|
|
86
86
|
end
|
|
87
87
|
end
|
|
@@ -117,9 +117,9 @@ module Mortar
|
|
|
117
117
|
context "working directory" do
|
|
118
118
|
it "finds clean and dirty working directories" do
|
|
119
119
|
with_git_initialized_project do |p|
|
|
120
|
-
@git.is_clean_working_directory?.should
|
|
120
|
+
@git.is_clean_working_directory?.should be_truthy
|
|
121
121
|
write_file(File.join(p.root_path, "new_file.txt"))
|
|
122
|
-
@git.is_clean_working_directory?.should
|
|
122
|
+
@git.is_clean_working_directory?.should be_falsy
|
|
123
123
|
end
|
|
124
124
|
end
|
|
125
125
|
end
|
|
@@ -131,9 +131,9 @@ module Mortar
|
|
|
131
131
|
write_file(File.join(p.root_path, "tmp", "ignored_file.txt"), "some text")
|
|
132
132
|
write_file(File.join(p.root_path, "included_file.txt"), "some text")
|
|
133
133
|
untracked_files = @git.untracked_files
|
|
134
|
-
untracked_files.include?(".gitignore").should
|
|
135
|
-
untracked_files.include?("included_file.txt").should
|
|
136
|
-
untracked_files.include?("tmp/ignored_file.txt").should
|
|
134
|
+
untracked_files.include?(".gitignore").should be_truthy
|
|
135
|
+
untracked_files.include?("included_file.txt").should be_truthy
|
|
136
|
+
untracked_files.include?("tmp/ignored_file.txt").should be_falsy
|
|
137
137
|
end
|
|
138
138
|
end
|
|
139
139
|
end
|
|
@@ -160,7 +160,7 @@ MANIFEST0
|
|
|
160
160
|
write_file(manifest_path, manifest_without_gitignore)
|
|
161
161
|
|
|
162
162
|
project_manifest_before = File.open(manifest_path, "r").read
|
|
163
|
-
project_manifest_before.include?(".gitignore").should
|
|
163
|
+
project_manifest_before.include?(".gitignore").should be_falsy
|
|
164
164
|
|
|
165
165
|
@git.ensure_gitignore_in_project_manifest()
|
|
166
166
|
|
|
@@ -198,7 +198,7 @@ MANIFEST1
|
|
|
198
198
|
write_file(manifest_path, manifest_without_gitignore)
|
|
199
199
|
|
|
200
200
|
project_manifest_before = File.open(manifest_path, "r").read
|
|
201
|
-
project_manifest_before.include?(".gitignore").should
|
|
201
|
+
project_manifest_before.include?(".gitignore").should be_falsy
|
|
202
202
|
|
|
203
203
|
@git.ensure_gitignore_in_project_manifest()
|
|
204
204
|
|
|
@@ -233,7 +233,7 @@ MANIFEST0
|
|
|
233
233
|
write_file(manifest_path, manifest_without_luigiscripts)
|
|
234
234
|
|
|
235
235
|
project_manifest_before = File.open(manifest_path, "r").read
|
|
236
|
-
project_manifest_before.include?("luigiscripts").should
|
|
236
|
+
project_manifest_before.include?("luigiscripts").should be_falsy
|
|
237
237
|
|
|
238
238
|
@git.ensure_luigiscripts_in_project_manifest()
|
|
239
239
|
|
|
@@ -267,7 +267,7 @@ MANIFEST1
|
|
|
267
267
|
write_file(manifest_path, manifest_without_luigiscripts)
|
|
268
268
|
|
|
269
269
|
project_manifest_before = File.open(manifest_path, "r").read
|
|
270
|
-
project_manifest_before.include?("luigiscripts").should
|
|
270
|
+
project_manifest_before.include?("luigiscripts").should be_falsy
|
|
271
271
|
|
|
272
272
|
@git.ensure_luigiscripts_in_project_manifest()
|
|
273
273
|
|
|
@@ -300,7 +300,7 @@ MANIFEST0
|
|
|
300
300
|
write_file(manifest_path, manifest_without_sparkscripts)
|
|
301
301
|
|
|
302
302
|
project_manifest_before = File.open(manifest_path, "r").read
|
|
303
|
-
project_manifest_before.include?("sparkscripts").should
|
|
303
|
+
project_manifest_before.include?("sparkscripts").should be_falsy
|
|
304
304
|
|
|
305
305
|
@git.ensure_sparkscripts_in_project_manifest()
|
|
306
306
|
|
|
@@ -334,7 +334,7 @@ MANIFEST1
|
|
|
334
334
|
write_file(manifest_path, manifest_without_sparkscripts)
|
|
335
335
|
|
|
336
336
|
project_manifest_before = File.open(manifest_path, "r").read
|
|
337
|
-
project_manifest_before.include?("sparkscripts").should
|
|
337
|
+
project_manifest_before.include?("sparkscripts").should be_falsy
|
|
338
338
|
|
|
339
339
|
@git.ensure_sparkscripts_in_project_manifest()
|
|
340
340
|
|
|
@@ -369,7 +369,7 @@ MANIFEST2
|
|
|
369
369
|
write_file(manifest_path, manifest_without_luigiscripts)
|
|
370
370
|
|
|
371
371
|
project_manifest_before = File.open(manifest_path, "r").read
|
|
372
|
-
project_manifest_before.include?("luigiscripts").should
|
|
372
|
+
project_manifest_before.include?("luigiscripts").should be_falsy
|
|
373
373
|
|
|
374
374
|
@git.ensure_luigiscripts_in_project_manifest()
|
|
375
375
|
|
|
@@ -389,7 +389,7 @@ MANIFEST2AFTER
|
|
|
389
389
|
context "did_stash_changes" do
|
|
390
390
|
it "finds that no changes were stashed" do
|
|
391
391
|
with_git_initialized_project do |p|
|
|
392
|
-
@git.did_stash_changes?("No local changes to save").should
|
|
392
|
+
@git.did_stash_changes?("No local changes to save").should be_falsy
|
|
393
393
|
end
|
|
394
394
|
end
|
|
395
395
|
|
|
@@ -398,36 +398,36 @@ MANIFEST2AFTER
|
|
|
398
398
|
Saved working directory and index state On master: myproject
|
|
399
399
|
HEAD is now at f3d74e8 Add an example
|
|
400
400
|
STASH
|
|
401
|
-
@git.did_stash_changes?(stash_message).should
|
|
401
|
+
@git.did_stash_changes?(stash_message).should be_truthy
|
|
402
402
|
end
|
|
403
403
|
end
|
|
404
404
|
|
|
405
405
|
context "stash_working_dir" do
|
|
406
406
|
it "does not error on a clean working directory" do
|
|
407
407
|
with_git_initialized_project do |p|
|
|
408
|
-
@git.stash_working_dir("my_description").should
|
|
408
|
+
@git.stash_working_dir("my_description").should be_falsy
|
|
409
409
|
end
|
|
410
410
|
end
|
|
411
411
|
|
|
412
412
|
it "stashes an added file" do
|
|
413
413
|
with_git_initialized_project do |p|
|
|
414
414
|
git_add_file(@git, p)
|
|
415
|
-
@git.is_clean_working_directory?.should
|
|
415
|
+
@git.is_clean_working_directory?.should be_falsy
|
|
416
416
|
|
|
417
417
|
# stash
|
|
418
|
-
@git.stash_working_dir("my_description").should
|
|
419
|
-
@git.is_clean_working_directory?.should
|
|
418
|
+
@git.stash_working_dir("my_description").should be_truthy
|
|
419
|
+
@git.is_clean_working_directory?.should be_truthy
|
|
420
420
|
end
|
|
421
421
|
end
|
|
422
422
|
|
|
423
423
|
it "stashes an untracked file" do
|
|
424
424
|
with_git_initialized_project do |p|
|
|
425
425
|
git_create_untracked_file(p)
|
|
426
|
-
@git.is_clean_working_directory?.should
|
|
426
|
+
@git.is_clean_working_directory?.should be_falsy
|
|
427
427
|
|
|
428
428
|
# stash
|
|
429
|
-
@git.stash_working_dir("my_description").should
|
|
430
|
-
@git.is_clean_working_directory?.should
|
|
429
|
+
@git.stash_working_dir("my_description").should be_truthy
|
|
430
|
+
@git.is_clean_working_directory?.should be_truthy
|
|
431
431
|
end
|
|
432
432
|
end
|
|
433
433
|
end
|
|
@@ -460,10 +460,10 @@ STASH
|
|
|
460
460
|
new_branch_name = "new_branch_to_delete"
|
|
461
461
|
@git.current_branch.should == "master"
|
|
462
462
|
@git.git("checkout -b #{new_branch_name}")
|
|
463
|
-
@git.branches.include?(new_branch_name).should
|
|
463
|
+
@git.branches.include?(new_branch_name).should be_truthy
|
|
464
464
|
@git.git("checkout master")
|
|
465
465
|
@git.branch_delete(new_branch_name)
|
|
466
|
-
@git.branches.include?(new_branch_name).should
|
|
466
|
+
@git.branches.include?(new_branch_name).should be_falsy
|
|
467
467
|
@git.current_branch.should == "master"
|
|
468
468
|
end
|
|
469
469
|
end
|
|
@@ -473,7 +473,7 @@ STASH
|
|
|
473
473
|
it "handles when no remotes are defined" do
|
|
474
474
|
with_git_initialized_project do |p|
|
|
475
475
|
@git.git("remote rm mortar")
|
|
476
|
-
@git.remotes("mortarcode").empty?.should
|
|
476
|
+
@git.remotes("mortarcode").empty?.should be_truthy
|
|
477
477
|
end
|
|
478
478
|
end
|
|
479
479
|
|
|
@@ -504,17 +504,17 @@ STASH
|
|
|
504
504
|
it "detects conflicts" do
|
|
505
505
|
with_git_initialized_project do |p|
|
|
506
506
|
|
|
507
|
-
@git.is_clean_working_directory?.should
|
|
508
|
-
@git.has_conflicts?.should
|
|
507
|
+
@git.is_clean_working_directory?.should be_truthy
|
|
508
|
+
@git.has_conflicts?.should be_falsy
|
|
509
509
|
git_create_conflict(@git, p)
|
|
510
|
-
@git.is_clean_working_directory?.should
|
|
511
|
-
@git.has_conflicts?.should
|
|
510
|
+
@git.is_clean_working_directory?.should be_falsy
|
|
511
|
+
@git.has_conflicts?.should be_truthy
|
|
512
512
|
end
|
|
513
513
|
end
|
|
514
514
|
|
|
515
515
|
it "detects no conflicts" do
|
|
516
516
|
with_git_initialized_project do |p|
|
|
517
|
-
@git.has_conflicts?.should
|
|
517
|
+
@git.has_conflicts?.should be_falsy
|
|
518
518
|
end
|
|
519
519
|
end
|
|
520
520
|
end
|
|
@@ -594,7 +594,7 @@ STASH
|
|
|
594
594
|
|
|
595
595
|
@git.sync_embedded_project(p, "master", "mortarcode-dev")
|
|
596
596
|
|
|
597
|
-
File.directory?(mirror_dir).should
|
|
597
|
+
File.directory?(mirror_dir).should be_truthy
|
|
598
598
|
FileUtils.rm_rf(mirror_dir)
|
|
599
599
|
end
|
|
600
600
|
end
|
|
@@ -622,7 +622,7 @@ STASH
|
|
|
622
622
|
|
|
623
623
|
@git.sync_embedded_project(p, "master", "mortarcode-dev")
|
|
624
624
|
|
|
625
|
-
File.directory?(mirror_dir).should
|
|
625
|
+
File.directory?(mirror_dir).should be_truthy
|
|
626
626
|
FileUtils.rm_rf(mirror_dir)
|
|
627
627
|
end
|
|
628
628
|
end
|
|
@@ -649,7 +649,7 @@ STASH
|
|
|
649
649
|
|
|
650
650
|
@git.sync_embedded_project(p, "master", "mortarcode-dev")
|
|
651
651
|
|
|
652
|
-
File.directory?(mirror_dir).should
|
|
652
|
+
File.directory?(mirror_dir).should be_truthy
|
|
653
653
|
FileUtils.rm_rf(mirror_dir)
|
|
654
654
|
end
|
|
655
655
|
end
|
|
@@ -677,7 +677,7 @@ STASH
|
|
|
677
677
|
|
|
678
678
|
@git.sync_embedded_project(p, "bob-the-builder-base", "mortarcode-dev")
|
|
679
679
|
|
|
680
|
-
File.exists?("#{project_mirror_dir}/pigscripts/calydonian_boar.pig").should
|
|
680
|
+
File.exists?("#{project_mirror_dir}/pigscripts/calydonian_boar.pig").should be_truthy
|
|
681
681
|
FileUtils.rm_rf(mirror_dir)
|
|
682
682
|
end
|
|
683
683
|
end
|
|
@@ -706,7 +706,7 @@ STASH
|
|
|
706
706
|
|
|
707
707
|
@git.sync_embedded_project(p, "bob-the-builder-base", "mortarcode-dev")
|
|
708
708
|
|
|
709
|
-
File.exists?("#{project_mirror_dir}/pigscripts/calydonian_boar.pig").should
|
|
709
|
+
File.exists?("#{project_mirror_dir}/pigscripts/calydonian_boar.pig").should be_falsy
|
|
710
710
|
FileUtils.rm_rf(mirror_dir)
|
|
711
711
|
end
|
|
712
712
|
end
|
|
@@ -715,7 +715,7 @@ STASH
|
|
|
715
715
|
context "checking updates for forked projects" do
|
|
716
716
|
it "skips non forked projects" do
|
|
717
717
|
with_git_initialized_project do |p|
|
|
718
|
-
@git.is_fork_repo_updated("mortarcode-dev").should
|
|
718
|
+
@git.is_fork_repo_updated("mortarcode-dev").should be_falsy
|
|
719
719
|
end
|
|
720
720
|
end
|
|
721
721
|
|
|
@@ -725,12 +725,12 @@ STASH
|
|
|
725
725
|
new_commit_hash = "ANewCommitHash"
|
|
726
726
|
mock(@git).get_latest_hash(@git.fork_base_remote_name) {new_commit_hash}
|
|
727
727
|
|
|
728
|
-
@git.is_fork_repo_updated("mortarcode-dev").should
|
|
729
|
-
File.exists?(@git.mortar_fork_meta_file).should
|
|
728
|
+
@git.is_fork_repo_updated("mortarcode-dev").should be_truthy
|
|
729
|
+
File.exists?(@git.mortar_fork_meta_file).should be_truthy
|
|
730
730
|
File.open(@git.mortar_fork_meta_file, "r") do |f|
|
|
731
731
|
file_contents = f.read()
|
|
732
732
|
file_contents.strip
|
|
733
|
-
file_contents.eql?(new_commit_hash).should
|
|
733
|
+
file_contents.eql?(new_commit_hash).should be_truthy
|
|
734
734
|
end
|
|
735
735
|
end
|
|
736
736
|
end
|
|
@@ -743,9 +743,9 @@ STASH
|
|
|
743
743
|
File.open(@git.mortar_fork_meta_file, "wb") do |f|
|
|
744
744
|
f.write(new_commit_hash)
|
|
745
745
|
end
|
|
746
|
-
File.exists?(@git.mortar_fork_meta_file).should
|
|
746
|
+
File.exists?(@git.mortar_fork_meta_file).should be_truthy
|
|
747
747
|
|
|
748
|
-
@git.is_fork_repo_updated("mortarcode-dev").should
|
|
748
|
+
@git.is_fork_repo_updated("mortarcode-dev").should be_falsy
|
|
749
749
|
end
|
|
750
750
|
end
|
|
751
751
|
|
|
@@ -755,7 +755,7 @@ STASH
|
|
|
755
755
|
current_latest_hash = @git.get_latest_hash("")
|
|
756
756
|
mock(@git).get_latest_hash(@git.fork_base_remote_name) {current_latest_hash}
|
|
757
757
|
|
|
758
|
-
@git.is_fork_repo_updated("mortarcode-dev").should
|
|
758
|
+
@git.is_fork_repo_updated("mortarcode-dev").should be_falsy
|
|
759
759
|
end
|
|
760
760
|
end
|
|
761
761
|
end
|
|
@@ -788,15 +788,15 @@ STASH
|
|
|
788
788
|
new_tmp_dir = @git.safe_copy(pathlist)
|
|
789
789
|
|
|
790
790
|
Dir.chdir(new_tmp_dir)
|
|
791
|
-
File.exists?(root_file).should
|
|
792
|
-
File.exists?(root_dir_file).should
|
|
793
|
-
File.exists?(non_root_dir_file).should
|
|
794
|
-
File.exists?(dir_file).should
|
|
791
|
+
File.exists?(root_file).should be_truthy
|
|
792
|
+
File.exists?(root_dir_file).should be_truthy
|
|
793
|
+
File.exists?(non_root_dir_file).should be_truthy
|
|
794
|
+
File.exists?(dir_file).should be_truthy
|
|
795
795
|
|
|
796
|
-
File.exists?(ex_root_file).should
|
|
797
|
-
File.exists?(ex_root_dir_file).should
|
|
798
|
-
File.exists?(ex_dir_file).should
|
|
799
|
-
File.exists?(ex_non_root_dir_file).should
|
|
796
|
+
File.exists?(ex_root_file).should be_falsy
|
|
797
|
+
File.exists?(ex_root_dir_file).should be_falsy
|
|
798
|
+
File.exists?(ex_dir_file).should be_falsy
|
|
799
|
+
File.exists?(ex_non_root_dir_file).should be_falsy
|
|
800
800
|
end
|
|
801
801
|
end
|
|
802
802
|
|
|
@@ -807,9 +807,9 @@ STASH
|
|
|
807
807
|
context "clone" do
|
|
808
808
|
it "clones repo successfully" do
|
|
809
809
|
with_no_git_directory do
|
|
810
|
-
File.directory?("rollup").should
|
|
810
|
+
File.directory?("rollup").should be_falsy
|
|
811
811
|
@git.clone("git@github.com:mortarcode-dev/4fbbd83cce875be8a4000000_rollup", "rollup")
|
|
812
|
-
File.directory?("rollup").should
|
|
812
|
+
File.directory?("rollup").should be_truthy
|
|
813
813
|
Dir.chdir("rollup")
|
|
814
814
|
lambda { @git.git("--version") }.should_not raise_error
|
|
815
815
|
end
|
data/spec/mortar/helpers_spec.rb
CHANGED
|
@@ -73,7 +73,7 @@ OUT
|
|
|
73
73
|
filepath = File.join(Dir.tmpdir, "my_new_dir", "my_new_file.txt")
|
|
74
74
|
data = "foo\nbar"
|
|
75
75
|
write_to_file(data, filepath)
|
|
76
|
-
File.exists?(filepath).should
|
|
76
|
+
File.exists?(filepath).should be_truthy
|
|
77
77
|
infile = File.open(filepath, "r")
|
|
78
78
|
infile.read.should == data
|
|
79
79
|
infile.close()
|
|
@@ -85,9 +85,9 @@ OUT
|
|
|
85
85
|
it "does not have an existing directory" do
|
|
86
86
|
FakeFS do
|
|
87
87
|
dir_name = "./foo-bar-dir"
|
|
88
|
-
expect(File.directory?(dir_name)).to
|
|
88
|
+
expect(File.directory?(dir_name)).to be_falsy
|
|
89
89
|
ensure_dir_exists(dir_name)
|
|
90
|
-
expect(File.directory?(dir_name)).to
|
|
90
|
+
expect(File.directory?(dir_name)).to be_truthy
|
|
91
91
|
end
|
|
92
92
|
end
|
|
93
93
|
|
|
@@ -95,9 +95,9 @@ OUT
|
|
|
95
95
|
FakeFS do
|
|
96
96
|
dir_name = "./foo-bar-dir"
|
|
97
97
|
FileUtils.mkdir_p(dir_name)
|
|
98
|
-
expect(File.directory?(dir_name)).to
|
|
98
|
+
expect(File.directory?(dir_name)).to be_truthy
|
|
99
99
|
ensure_dir_exists(dir_name)
|
|
100
|
-
expect(File.directory?(dir_name)).to
|
|
100
|
+
expect(File.directory?(dir_name)).to be_truthy
|
|
101
101
|
end
|
|
102
102
|
end
|
|
103
103
|
|
|
@@ -99,7 +99,7 @@ module Mortar::Local
|
|
|
99
99
|
FakeFS do
|
|
100
100
|
FileUtils.mkdir_p(File.dirname(install_file_path))
|
|
101
101
|
@installutil.note_install("foo")
|
|
102
|
-
expect(File.exists?(install_file_path)).to
|
|
102
|
+
expect(File.exists?(install_file_path)).to be_truthy
|
|
103
103
|
end
|
|
104
104
|
end
|
|
105
105
|
|
|
@@ -110,19 +110,19 @@ module Mortar::Local
|
|
|
110
110
|
it "is if remote file is newer" do
|
|
111
111
|
stub(@installutil).install_date.returns(1)
|
|
112
112
|
stub(@installutil).url_date.returns(2)
|
|
113
|
-
expect(@installutil.is_newer_version('foo', 'http://bar')).to
|
|
113
|
+
expect(@installutil.is_newer_version('foo', 'http://bar')).to be_truthy
|
|
114
114
|
end
|
|
115
115
|
|
|
116
116
|
it "is if remote file last-modfied is unavailable" do
|
|
117
117
|
stub(@installutil).install_date.returns(1)
|
|
118
118
|
stub(@installutil).url_date.returns(nil)
|
|
119
|
-
expect(@installutil.is_newer_version('foo', 'http://bar')).to
|
|
119
|
+
expect(@installutil.is_newer_version('foo', 'http://bar')).to be_falsy
|
|
120
120
|
end
|
|
121
121
|
|
|
122
122
|
it "is not if remote file is older" do
|
|
123
123
|
stub(@installutil).install_date.returns(2)
|
|
124
124
|
stub(@installutil).url_date.returns(1)
|
|
125
|
-
expect(@installutil.is_newer_version('foo', 'http://bar')).to
|
|
125
|
+
expect(@installutil.is_newer_version('foo', 'http://bar')).to be_falsy
|
|
126
126
|
end
|
|
127
127
|
|
|
128
128
|
it "if no version is present" do
|
|
@@ -130,7 +130,7 @@ module Mortar::Local
|
|
|
130
130
|
stub(@installutil).url_date.returns(1)
|
|
131
131
|
FakeFS do
|
|
132
132
|
FileUtils.rm_rf(File.dirname(install_file_path), :force => true)
|
|
133
|
-
expect(@installutil.is_newer_version('foo', 'http://bar')).to
|
|
133
|
+
expect(@installutil.is_newer_version('foo', 'http://bar')).to be_truthy
|
|
134
134
|
end
|
|
135
135
|
end
|
|
136
136
|
|
|
@@ -180,7 +180,7 @@ module Mortar::Local
|
|
|
180
180
|
FakeFS do
|
|
181
181
|
FileUtils.mkdir_p(local_install_directory)
|
|
182
182
|
@installutil.download_file('http://foo/bar', expected_file_path)
|
|
183
|
-
expect(File.exists?(expected_file_path)).to
|
|
183
|
+
expect(File.exists?(expected_file_path)).to be_truthy
|
|
184
184
|
end
|
|
185
185
|
end
|
|
186
186
|
|
|
@@ -32,9 +32,9 @@ module Mortar::Local
|
|
|
32
32
|
mock(jython).install
|
|
33
33
|
FakeFS do
|
|
34
34
|
FileUtils.mkdir_p(install_dir)
|
|
35
|
-
expect(File.directory?(install_dir)).to
|
|
35
|
+
expect(File.directory?(install_dir)).to be_truthy
|
|
36
36
|
jython.update
|
|
37
|
-
expect(File.directory?(install_dir)).to
|
|
37
|
+
expect(File.directory?(install_dir)).to be_falsy
|
|
38
38
|
end
|
|
39
39
|
end
|
|
40
40
|
|
|
@@ -48,7 +48,7 @@ module Mortar::Local
|
|
|
48
48
|
mock(jython).jython_directory.returns(install_dir)
|
|
49
49
|
FakeFS do
|
|
50
50
|
FileUtils.mkdir_p(install_dir)
|
|
51
|
-
expect(jython.should_install).to
|
|
51
|
+
expect(jython.should_install).to be_falsy
|
|
52
52
|
end
|
|
53
53
|
end
|
|
54
54
|
|
|
@@ -58,7 +58,7 @@ module Mortar::Local
|
|
|
58
58
|
mock(jython).jython_directory.returns(install_dir)
|
|
59
59
|
FakeFS do
|
|
60
60
|
FileUtils.rm_rf(install_dir, :force => true)
|
|
61
|
-
expect(jython.should_install).to
|
|
61
|
+
expect(jython.should_install).to be_truthy
|
|
62
62
|
end
|
|
63
63
|
end
|
|
64
64
|
|
|
@@ -51,7 +51,7 @@ module Mortar::Local
|
|
|
51
51
|
ensure
|
|
52
52
|
$stdout = previous_stdout
|
|
53
53
|
end
|
|
54
|
-
expect(File.exists?(local_pig_archive)).to
|
|
54
|
+
expect(File.exists?(local_pig_archive)).to be_falsy
|
|
55
55
|
end
|
|
56
56
|
end
|
|
57
57
|
|
|
@@ -71,8 +71,8 @@ module Mortar::Local
|
|
|
71
71
|
FileUtils.mkdir_p(File.dirname(pig.local_install_directory))
|
|
72
72
|
FileUtils.rm_rf(pig.local_install_directory, :force => true)
|
|
73
73
|
pig.install_or_update(pig012Hadoop2)
|
|
74
|
-
expect(File.exists?(pig.pig_directory(pig012Hadoop2))).to
|
|
75
|
-
expect(File.exists?(pig.lib_directory)).to
|
|
74
|
+
expect(File.exists?(pig.pig_directory(pig012Hadoop2))).to be_falsy
|
|
75
|
+
expect(File.exists?(pig.lib_directory)).to be_falsy
|
|
76
76
|
|
|
77
77
|
end
|
|
78
78
|
end
|
|
@@ -156,7 +156,7 @@ module Mortar::Local
|
|
|
156
156
|
ensure
|
|
157
157
|
$stdout = previous_stdout
|
|
158
158
|
end
|
|
159
|
-
expect(File.exists?(output_path)).to
|
|
159
|
+
expect(File.exists?(output_path)).to be_truthy
|
|
160
160
|
end
|
|
161
161
|
end
|
|
162
162
|
|
|
@@ -251,9 +251,9 @@ module Mortar::Local
|
|
|
251
251
|
FakeFS do
|
|
252
252
|
FileUtils.mkdir_p(pig.local_log_dir)
|
|
253
253
|
FileUtils.touch(marker_file)
|
|
254
|
-
expect(File.exists?(marker_file)).to
|
|
254
|
+
expect(File.exists?(marker_file)).to be_truthy
|
|
255
255
|
pig.reset_local_logs
|
|
256
|
-
expect(File.exists?(marker_file)).to
|
|
256
|
+
expect(File.exists?(marker_file)).to be_falsy
|
|
257
257
|
end
|
|
258
258
|
|
|
259
259
|
end
|
|
@@ -263,13 +263,13 @@ module Mortar::Local
|
|
|
263
263
|
it "Uses default pig" do
|
|
264
264
|
pig = Mortar::Local::Pig.new
|
|
265
265
|
tpc = pig.template_params_classpath
|
|
266
|
-
expect(tpc.include?("pig-0.12")).to
|
|
266
|
+
expect(tpc.include?("pig-0.12")).to be_truthy
|
|
267
267
|
end
|
|
268
268
|
|
|
269
269
|
it "Works with 0.12-Hadoop-2.7.3 pig" do
|
|
270
270
|
pig = Mortar::Local::Pig.new
|
|
271
271
|
tpc = pig.template_params_classpath(Mortar::PigVersion::Pig012Hadoop273.new)
|
|
272
|
-
expect(tpc.include?("pig-0.12")).to
|
|
272
|
+
expect(tpc.include?("pig-0.12")).to be_truthy
|
|
273
273
|
end
|
|
274
274
|
end
|
|
275
275
|
|
|
@@ -104,7 +104,7 @@ module Mortar::Local
|
|
|
104
104
|
python.install_python_dependencies
|
|
105
105
|
end
|
|
106
106
|
dir_to_be_created = "#{python.local_install_directory}/#{python.mortar_packages_dir}"
|
|
107
|
-
expect(File.exists?(dir_to_be_created)).to
|
|
107
|
+
expect(File.exists?(dir_to_be_created)).to be_truthy
|
|
108
108
|
end
|
|
109
109
|
end
|
|
110
110
|
|
|
@@ -123,7 +123,7 @@ module Mortar::Local
|
|
|
123
123
|
FileUtils.mkdir_p "#{python.local_install_directory}/#{python.mortar_packages_dir}"
|
|
124
124
|
python.install_mortar_python_package "pip"
|
|
125
125
|
dir_to_be_created = "#{python.local_install_directory}/#{python.mortar_packages_dir}/pip"
|
|
126
|
-
expect(File.exists?(dir_to_be_created)).to
|
|
126
|
+
expect(File.exists?(dir_to_be_created)).to be_truthy
|
|
127
127
|
end
|
|
128
128
|
end
|
|
129
129
|
|
data/spec/mortar/plugin_spec.rb
CHANGED
|
@@ -52,7 +52,7 @@ MESSAGE
|
|
|
52
52
|
FileUtils.mkdir_p(plugin_folder)
|
|
53
53
|
`cd #{plugin_folder} && git init && echo 'test' > README && git add . && git commit -m 'my plugin'`
|
|
54
54
|
Plugin.new(plugin_folder).install
|
|
55
|
-
File.directory?("#{@sandbox}/mortar_plugin").should
|
|
55
|
+
File.directory?("#{@sandbox}/mortar_plugin").should be_truthy
|
|
56
56
|
File.read("#{@sandbox}/mortar_plugin/README").should == "test\n"
|
|
57
57
|
end
|
|
58
58
|
|
|
@@ -63,7 +63,7 @@ MESSAGE
|
|
|
63
63
|
`cd #{plugin_folder} && git init && echo 'test' > README && git add . && git commit -m 'my plugin'`
|
|
64
64
|
Plugin.new(plugin_folder).install
|
|
65
65
|
Plugin.new(plugin_folder).install
|
|
66
|
-
File.directory?("#{@sandbox}/mortar_plugin").should
|
|
66
|
+
File.directory?("#{@sandbox}/mortar_plugin").should be_truthy
|
|
67
67
|
File.read("#{@sandbox}/mortar_plugin/README").should == "test\n"
|
|
68
68
|
end
|
|
69
69
|
|
|
@@ -79,7 +79,7 @@ MESSAGE
|
|
|
79
79
|
|
|
80
80
|
it "updates existing copies" do
|
|
81
81
|
Plugin.new('mortar_plugin').update
|
|
82
|
-
File.directory?("#{@sandbox}/mortar_plugin").should
|
|
82
|
+
File.directory?("#{@sandbox}/mortar_plugin").should be_truthy
|
|
83
83
|
File.read("#{@sandbox}/mortar_plugin/README").should == "updated\n"
|
|
84
84
|
end
|
|
85
85
|
|
|
@@ -108,7 +108,7 @@ MESSAGE
|
|
|
108
108
|
FileUtils.mkdir_p(@sandbox + '/plugin')
|
|
109
109
|
File.open(@sandbox + '/plugin/init.rb', 'w') { |f| f.write "LoadedInit = true" }
|
|
110
110
|
Plugin.load!
|
|
111
|
-
LoadedInit.should
|
|
111
|
+
LoadedInit.should be_truthy
|
|
112
112
|
end
|
|
113
113
|
|
|
114
114
|
describe "installing plugins with dependencies", :broken => true do
|
|
@@ -130,13 +130,13 @@ EOS
|
|
|
130
130
|
}
|
|
131
131
|
`cd #{plugin_folder} && git init && echo 'test' > README && git add . && git commit -m 'my plugin'`
|
|
132
132
|
Plugin.new(plugin_folder).install
|
|
133
|
-
File.directory?("#{@sandbox}/mortar_plugin").should
|
|
134
|
-
File.directory?("#{@sandbox}/mortar_plugin/bundle").should
|
|
135
|
-
File.exist?("#{@sandbox}/mortar_plugin/Gemfile").should
|
|
133
|
+
File.directory?("#{@sandbox}/mortar_plugin").should be_truthy
|
|
134
|
+
File.directory?("#{@sandbox}/mortar_plugin/bundle").should be_truthy
|
|
135
|
+
File.exist?("#{@sandbox}/mortar_plugin/Gemfile").should be_truthy
|
|
136
136
|
File.read("#{@sandbox}/mortar_plugin/README").should == "test\n"
|
|
137
137
|
|
|
138
138
|
Plugin.load!
|
|
139
|
-
PluginTest.should
|
|
139
|
+
PluginTest.should be_truthy
|
|
140
140
|
end
|
|
141
141
|
|
|
142
142
|
it "should fail to install plugin with bad dependencies" do
|
|
@@ -154,7 +154,7 @@ EOS
|
|
|
154
154
|
File.open(plugin_folder + '/Gemfile', 'w') { |f| f.write "non_existent_command" }
|
|
155
155
|
`cd #{plugin_folder} && git init && echo 'test' > README && git add . && git commit -m 'my plugin'`
|
|
156
156
|
lambda { Plugin.new(plugin_folder).install }.should raise_error Mortar::Plugin::ErrorInstallingDependencies
|
|
157
|
-
File.exists?("#{Plugin.directory}/plugin_install.log").should
|
|
157
|
+
File.exists?("#{Plugin.directory}/plugin_install.log").should be_truthy
|
|
158
158
|
end
|
|
159
159
|
|
|
160
160
|
it "should clean plugin if bundler isn't installed" do
|
|
@@ -165,7 +165,7 @@ EOS
|
|
|
165
165
|
File.open(plugin_folder + '/Gemfile', 'w') { |f| f.write "# dummy content" }
|
|
166
166
|
`cd #{plugin_folder} && git init && echo 'test' > README && git add . && git commit -m 'my plugin'`
|
|
167
167
|
lambda { Plugin.new(plugin_folder).install }.should raise_error BundlerNotInstalledError
|
|
168
|
-
File.exist?("#{@sandbox}/mortar_plugin").should
|
|
168
|
+
File.exist?("#{@sandbox}/mortar_plugin").should be_falsy
|
|
169
169
|
end
|
|
170
170
|
end
|
|
171
171
|
|
|
@@ -195,7 +195,7 @@ EOS
|
|
|
195
195
|
Plugin.load!
|
|
196
196
|
end
|
|
197
197
|
stderr.should include('some_non_existant_file (LoadError)')
|
|
198
|
-
LoadedPlugin2.should
|
|
198
|
+
LoadedPlugin2.should be_truthy
|
|
199
199
|
end
|
|
200
200
|
end
|
|
201
201
|
end
|
data/spec/mortar/project_spec.rb
CHANGED
|
@@ -24,7 +24,7 @@ module Mortar
|
|
|
24
24
|
with_blank_project do |p|
|
|
25
25
|
# create it
|
|
26
26
|
tmp_path_0 = p.tmp_path
|
|
27
|
-
File.directory?(tmp_path_0).should
|
|
27
|
+
File.directory?(tmp_path_0).should be_truthy
|
|
28
28
|
|
|
29
29
|
# reuse it
|
|
30
30
|
p.tmp_path.should == tmp_path_0
|
|
@@ -54,7 +54,7 @@ module Mortar
|
|
|
54
54
|
|
|
55
55
|
it "finds no pigscripts in an empty dir" do
|
|
56
56
|
with_blank_project do |p|
|
|
57
|
-
p.pigscripts.none?.should
|
|
57
|
+
p.pigscripts.none?.should be_truthy
|
|
58
58
|
end
|
|
59
59
|
end
|
|
60
60
|
|
|
@@ -65,7 +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.end_with?("pigscripts/my_script.pig")
|
|
68
|
-
p.pigscripts.my_script.rel_path.end_with?('pigscripts').should
|
|
68
|
+
p.pigscripts.my_script.rel_path.end_with?('pigscripts').should be_truthy
|
|
69
69
|
end
|
|
70
70
|
end
|
|
71
71
|
|
|
@@ -75,7 +75,7 @@ module Mortar
|
|
|
75
75
|
write_file pigscript_path
|
|
76
76
|
p.pigscripts.my_script.name.should == "my_script"
|
|
77
77
|
p.pigscripts.my_script.path.should == pigscript_path
|
|
78
|
-
p.pigscripts.my_script.rel_path.end_with?("pigscripts/subdir").should
|
|
78
|
+
p.pigscripts.my_script.rel_path.end_with?("pigscripts/subdir").should be_truthy
|
|
79
79
|
end
|
|
80
80
|
end
|
|
81
81
|
|
data/spec/spec_helper.rb
CHANGED
|
@@ -346,16 +346,16 @@ def create_and_validate_git_snapshot(git)
|
|
|
346
346
|
snapshot_branch.should_not == "master"
|
|
347
347
|
git.current_branch.should == "master"
|
|
348
348
|
git.status.should == initial_status
|
|
349
|
-
git.has_conflicts?.should
|
|
349
|
+
git.has_conflicts?.should be_falsy
|
|
350
350
|
|
|
351
351
|
# ensure snapshot is in a temp directory
|
|
352
|
-
File.exists?(snapshot_dir).should
|
|
352
|
+
File.exists?(snapshot_dir).should be_truthy
|
|
353
353
|
|
|
354
354
|
curdir = Dir.pwd
|
|
355
355
|
Dir.chdir(snapshot_dir)
|
|
356
356
|
|
|
357
357
|
# ensure the snapshot branch exists
|
|
358
|
-
git.git("branch").include?(snapshot_branch).should
|
|
358
|
+
git.git("branch").include?(snapshot_branch).should be_truthy
|
|
359
359
|
|
|
360
360
|
snapshotted_paths = Dir.glob("**/*")
|
|
361
361
|
snapshotted_paths.should include("pigscripts")
|
|
@@ -393,7 +393,7 @@ end
|
|
|
393
393
|
|
|
394
394
|
RSpec.configure do |config|
|
|
395
395
|
config.mock_with :rr
|
|
396
|
-
config.
|
|
396
|
+
config.color = true
|
|
397
397
|
config.filter_run_excluding :broken => true
|
|
398
398
|
config.include DisplayMessageMatcher
|
|
399
399
|
config.before { Mortar::Helpers.error_with_failure = false }
|
metadata
CHANGED
|
@@ -1,55 +1,55 @@
|
|
|
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.48
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mortar Data
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2018-09-19 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rdoc
|
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
|
16
16
|
requirements:
|
|
17
|
-
- -
|
|
17
|
+
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
19
|
version: 4.0.0
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
|
-
- -
|
|
24
|
+
- - ">="
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: 4.0.0
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: mortar-api-ruby
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
30
30
|
requirements:
|
|
31
|
-
- - ~>
|
|
31
|
+
- - "~>"
|
|
32
32
|
- !ruby/object:Gem::Version
|
|
33
33
|
version: 0.8.16
|
|
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
40
|
version: 0.8.16
|
|
41
41
|
- !ruby/object:Gem::Dependency
|
|
42
42
|
name: netrc
|
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
|
44
44
|
requirements:
|
|
45
|
-
- - ~>
|
|
45
|
+
- - "~>"
|
|
46
46
|
- !ruby/object:Gem::Version
|
|
47
47
|
version: '0.7'
|
|
48
48
|
type: :runtime
|
|
49
49
|
prerelease: false
|
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
51
|
requirements:
|
|
52
|
-
- - ~>
|
|
52
|
+
- - "~>"
|
|
53
53
|
- !ruby/object:Gem::Version
|
|
54
54
|
version: '0.7'
|
|
55
55
|
- !ruby/object:Gem::Dependency
|
|
@@ -70,126 +70,126 @@ dependencies:
|
|
|
70
70
|
name: parseconfig
|
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
|
72
72
|
requirements:
|
|
73
|
-
- - ~>
|
|
73
|
+
- - "~>"
|
|
74
74
|
- !ruby/object:Gem::Version
|
|
75
75
|
version: 1.0.2
|
|
76
76
|
type: :runtime
|
|
77
77
|
prerelease: false
|
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
|
79
79
|
requirements:
|
|
80
|
-
- - ~>
|
|
80
|
+
- - "~>"
|
|
81
81
|
- !ruby/object:Gem::Version
|
|
82
82
|
version: 1.0.2
|
|
83
83
|
- !ruby/object:Gem::Dependency
|
|
84
84
|
name: aws-sdk
|
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
|
86
86
|
requirements:
|
|
87
|
-
- - ~>
|
|
87
|
+
- - "~>"
|
|
88
88
|
- !ruby/object:Gem::Version
|
|
89
89
|
version: '1.0'
|
|
90
90
|
type: :runtime
|
|
91
91
|
prerelease: false
|
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
|
93
93
|
requirements:
|
|
94
|
-
- - ~>
|
|
94
|
+
- - "~>"
|
|
95
95
|
- !ruby/object:Gem::Version
|
|
96
96
|
version: '1.0'
|
|
97
97
|
- !ruby/object:Gem::Dependency
|
|
98
98
|
name: nokogiri
|
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
|
100
100
|
requirements:
|
|
101
|
-
- - ~>
|
|
101
|
+
- - "~>"
|
|
102
102
|
- !ruby/object:Gem::Version
|
|
103
103
|
version: 1.5.0
|
|
104
104
|
type: :runtime
|
|
105
105
|
prerelease: false
|
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
|
107
107
|
requirements:
|
|
108
|
-
- - ~>
|
|
108
|
+
- - "~>"
|
|
109
109
|
- !ruby/object:Gem::Version
|
|
110
110
|
version: 1.5.0
|
|
111
111
|
- !ruby/object:Gem::Dependency
|
|
112
112
|
name: excon
|
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
|
114
114
|
requirements:
|
|
115
|
-
- - ~>
|
|
115
|
+
- - "~>"
|
|
116
116
|
- !ruby/object:Gem::Version
|
|
117
117
|
version: '0.28'
|
|
118
118
|
type: :development
|
|
119
119
|
prerelease: false
|
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
|
121
121
|
requirements:
|
|
122
|
-
- - ~>
|
|
122
|
+
- - "~>"
|
|
123
123
|
- !ruby/object:Gem::Version
|
|
124
124
|
version: '0.28'
|
|
125
125
|
- !ruby/object:Gem::Dependency
|
|
126
126
|
name: fakefs
|
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
|
128
128
|
requirements:
|
|
129
|
-
- - ~>
|
|
129
|
+
- - "~>"
|
|
130
130
|
- !ruby/object:Gem::Version
|
|
131
131
|
version: 0.4.2
|
|
132
132
|
type: :development
|
|
133
133
|
prerelease: false
|
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
|
135
135
|
requirements:
|
|
136
|
-
- - ~>
|
|
136
|
+
- - "~>"
|
|
137
137
|
- !ruby/object:Gem::Version
|
|
138
138
|
version: 0.4.2
|
|
139
139
|
- !ruby/object:Gem::Dependency
|
|
140
140
|
name: gem-release
|
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|
|
142
142
|
requirements:
|
|
143
|
-
- -
|
|
143
|
+
- - ">="
|
|
144
144
|
- !ruby/object:Gem::Version
|
|
145
145
|
version: '0'
|
|
146
146
|
type: :development
|
|
147
147
|
prerelease: false
|
|
148
148
|
version_requirements: !ruby/object:Gem::Requirement
|
|
149
149
|
requirements:
|
|
150
|
-
- -
|
|
150
|
+
- - ">="
|
|
151
151
|
- !ruby/object:Gem::Version
|
|
152
152
|
version: '0'
|
|
153
153
|
- !ruby/object:Gem::Dependency
|
|
154
154
|
name: rake
|
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
|
156
156
|
requirements:
|
|
157
|
-
- - ~>
|
|
157
|
+
- - "~>"
|
|
158
158
|
- !ruby/object:Gem::Version
|
|
159
159
|
version: 10.1.1
|
|
160
160
|
type: :development
|
|
161
161
|
prerelease: false
|
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
|
163
163
|
requirements:
|
|
164
|
-
- - ~>
|
|
164
|
+
- - "~>"
|
|
165
165
|
- !ruby/object:Gem::Version
|
|
166
166
|
version: 10.1.1
|
|
167
167
|
- !ruby/object:Gem::Dependency
|
|
168
168
|
name: rr
|
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
|
170
170
|
requirements:
|
|
171
|
-
- - ~>
|
|
171
|
+
- - "~>"
|
|
172
172
|
- !ruby/object:Gem::Version
|
|
173
173
|
version: 1.1.2
|
|
174
174
|
type: :development
|
|
175
175
|
prerelease: false
|
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
|
177
177
|
requirements:
|
|
178
|
-
- - ~>
|
|
178
|
+
- - "~>"
|
|
179
179
|
- !ruby/object:Gem::Version
|
|
180
180
|
version: 1.1.2
|
|
181
181
|
- !ruby/object:Gem::Dependency
|
|
182
182
|
name: rspec
|
|
183
183
|
requirement: !ruby/object:Gem::Requirement
|
|
184
184
|
requirements:
|
|
185
|
-
- - ~>
|
|
185
|
+
- - "~>"
|
|
186
186
|
- !ruby/object:Gem::Version
|
|
187
187
|
version: '2.0'
|
|
188
188
|
type: :development
|
|
189
189
|
prerelease: false
|
|
190
190
|
version_requirements: !ruby/object:Gem::Requirement
|
|
191
191
|
requirements:
|
|
192
|
-
- - ~>
|
|
192
|
+
- - "~>"
|
|
193
193
|
- !ruby/object:Gem::Version
|
|
194
194
|
version: '2.0'
|
|
195
195
|
description: Client library and command-line tool to interact with the Mortar service.
|
|
@@ -352,17 +352,17 @@ require_paths:
|
|
|
352
352
|
- lib
|
|
353
353
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
354
354
|
requirements:
|
|
355
|
-
- -
|
|
355
|
+
- - ">="
|
|
356
356
|
- !ruby/object:Gem::Version
|
|
357
357
|
version: 1.8.7
|
|
358
358
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
359
359
|
requirements:
|
|
360
|
-
- -
|
|
360
|
+
- - ">="
|
|
361
361
|
- !ruby/object:Gem::Version
|
|
362
362
|
version: '0'
|
|
363
363
|
requirements: []
|
|
364
364
|
rubyforge_project:
|
|
365
|
-
rubygems_version: 2.
|
|
365
|
+
rubygems_version: 2.7.7
|
|
366
366
|
signing_key:
|
|
367
367
|
specification_version: 4
|
|
368
368
|
summary: Client library and CLI to interact with the Mortar service.
|