hive-runner 2.1.24 → 2.1.25
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 +4 -4
- data/lib/hive/file_system.rb +5 -0
- data/lib/hive/worker.rb +10 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d7be365592edb7a5230701b8349103112795d0d
|
4
|
+
data.tar.gz: 1b36dab91f7df3b6b5a17d6c0c1b223462c3e852
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b94468aba8dba9f4e0db4b316f92c9c4a875ec7db8fba87294ed084936dbcb3deeb30c82c2121ba59890c3fbd95743de0a8903cb3679d2240e1bba8233daac05
|
7
|
+
data.tar.gz: 74099f827f77ed2abdc49c8c5a6eac403e18429aa6c6427cb1344cb18d28b729493ce8a7da1c95e3e512e7ada7497f497ed139789ad1bdf2d58b4e057df6ea07
|
data/lib/hive/file_system.rb
CHANGED
@@ -11,6 +11,7 @@ module Hive
|
|
11
11
|
make_directory(results_path)
|
12
12
|
make_directory(logs_path)
|
13
13
|
make_directory(testbed_path)
|
14
|
+
FileUtils.touch(script_errors_file)
|
14
15
|
end
|
15
16
|
|
16
17
|
def home_path
|
@@ -25,6 +26,10 @@ module Hive
|
|
25
26
|
@logs_path ||= "#{home_path}/logs"
|
26
27
|
end
|
27
28
|
|
29
|
+
def script_errors_file
|
30
|
+
@script_errors_file ||= File.expand_path('script_errors.txt', logs_path)
|
31
|
+
end
|
32
|
+
|
28
33
|
def testbed_path
|
29
34
|
@testbed_path ||= "#{home_path}/test_code"
|
30
35
|
end
|
data/lib/hive/worker.rb
CHANGED
@@ -172,6 +172,7 @@ module Hive
|
|
172
172
|
|
173
173
|
@log.info "Setting the execution variables in the environment"
|
174
174
|
@script.set_env 'HIVE_RESULTS', @file_system.results_path
|
175
|
+
@script.set_env 'HIVE_SCRIPT_ERRORS', @file_system.script_errors_file
|
175
176
|
@job.execution_variables.to_h.each_pair do |var, val|
|
176
177
|
@script.set_env "HIVE_#{var.to_s}".upcase, val if ! val.kind_of?(Array)
|
177
178
|
end
|
@@ -212,15 +213,20 @@ module Hive
|
|
212
213
|
@log.error(" : #{e.backtrace.join("\n : ")}")
|
213
214
|
end
|
214
215
|
|
215
|
-
if exception
|
216
|
-
@job.error( exception.message )
|
216
|
+
if exception or File.size(@file_system.script_errors_file) > 0
|
217
217
|
set_job_state_to :completed
|
218
218
|
begin
|
219
219
|
upload_files(@job, @file_system.results_path, @file_system.logs_path)
|
220
220
|
rescue => e
|
221
221
|
@log.error("Exception while uploading files: #{e.backtrace.join("\n : ")}")
|
222
222
|
end
|
223
|
-
|
223
|
+
if exception
|
224
|
+
@job.error( exception.message )
|
225
|
+
raise exception
|
226
|
+
else
|
227
|
+
@job.error( 'Errors raised by execution script' )
|
228
|
+
raise 'See errors file for errors reported in test.'
|
229
|
+
end
|
224
230
|
else
|
225
231
|
@job.complete
|
226
232
|
begin
|
@@ -406,7 +412,7 @@ module Hive
|
|
406
412
|
# Keep the execution script running
|
407
413
|
def keep_script_running?
|
408
414
|
@log.debug("Keep Running check ")
|
409
|
-
if exceeded_time_limit?
|
415
|
+
if exceeded_time_limit? or parent_process_dead? or File.size(@file_system.script_errors_file) > 0
|
410
416
|
return false
|
411
417
|
else
|
412
418
|
return true
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hive-runner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.25
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Joe Haig
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-03
|
11
|
+
date: 2017-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chamber
|