libis-workflow 2.1.14 → 2.1.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 97c5ef592f59a3caa686b720be93627ac6c3b4ef0dc090b7c34fde4df0dd884f
4
- data.tar.gz: 1d94306c409a49e0e32a793b2776006f5cbd1bbea7cc249e6ac6c367929910b1
3
+ metadata.gz: e66dece77083326a3d88dcfa86846180adec96c38689f6881d9fae6c51b6ae47
4
+ data.tar.gz: 36257c4ab77177ae135a235d564cc43781bc8d04bc103cdf68e7279c103ea196
5
5
  SHA512:
6
- metadata.gz: 89cd04b42874247038d0f68ff9f99d9c69c73133db0434a36f7f3379987ddc268a9f724ee2ad8bb9fec1cf6bc8b0cf763c03282cca21e1baf197e06df41435f2
7
- data.tar.gz: c4f5932fe4f02ba30f225fa8100ae6907476f69f067de278be9cf5d5eb1f3b1e32f81f93603f215050b62534a53315b4d8dd6d55ab795f5178ac4d93a7d691e4
6
+ metadata.gz: 2a332c4a3b6417e52d6f71cf3346dcb83666cd6404ab3c8c391bd6607b7ace204462632d3ac7864283cb6204c1b635ba6b1a623bd380b1b5ef14a19201b6e194
7
+ data.tar.gz: f56a7cde0ff9ec1bfbf2c276234a39672310c22b18e811fc62fdcb8c53529260b35eeb04f64c68be39633c70848af58e13e16a26a4b8b27f7cd73e0bea44c416
@@ -0,0 +1,23 @@
1
+ {
2
+ // Use IntelliSense to learn about possible attributes.
3
+ // Hover to view descriptions of existing attributes.
4
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5
+ "version": "0.2.0",
6
+ "configurations": [
7
+ {
8
+ "type": "rdbg",
9
+ "request": "launch",
10
+ "name": "Debug rspec test",
11
+ "command": "rspec",
12
+ "script": "${file}"
13
+ },
14
+ {
15
+ "type": "rdbg",
16
+ "name": "Debug current file with rdbg",
17
+ "request": "launch",
18
+ "script": "${file}",
19
+ "args": [],
20
+ "askParameters": true
21
+ }
22
+ ]
23
+ }
@@ -25,6 +25,9 @@ module Libis
25
25
  nil
26
26
  end
27
27
 
28
+ def reload
29
+ end
30
+
28
31
  def logger
29
32
  self.properties[:logger] || (job.logger rescue nil)
30
33
  end
@@ -213,21 +213,21 @@ module Libis
213
213
 
214
214
  rescue Libis::WorkflowError => e
215
215
  set_status(item, :FAILED)
216
- error 'Error processing subitem (%d/%d): %s', item, i + 1, items.size, e.message
216
+ error 'Error processing subitem (%d/%d): %s @ %s', item, i + 1, items.size, e.message, e.backtrace.first
217
217
  break if parameter(:abort_recursion_on_failure)
218
218
 
219
219
  rescue Libis::WorkflowAbort => e
220
- fatal_error 'Fatal error processing subitem (%d/%d): %s @ %s\n%s', item, i + 1, items.size, e.message, e.backtrace.first, e.backtrace.map{|t| ' -- ' + t}.join("\n")
220
+ fatal_error "Fatal error processing subitem (%d/%d): %s\n%s", item, i + 1, items.size, e.message, e.backtrace[..9].map{|t| ' -- ' + t}.join("\n")
221
221
  set_status(item, :FAILED)
222
222
  break
223
223
 
224
224
  rescue Libis::WorkflowAbortForget => e
225
- fatal_error 'Fatal error processing subitem (%d/%d): %s @ %s\n%s', item, i + 1, items.size, e.message, e.backtrace.first, e.backtrace.map{|t| ' -- ' + t}.join("\n")
225
+ fatal_error "Fatal error processing subitem (%d/%d): %s\n%s", item, i + 1, items.size, e.message, e.backtrace[..9].map{|t| ' -- ' + t}.join("\n")
226
226
  set_status(item, :FAILED)
227
227
  raise e
228
228
 
229
229
  rescue Exception => e
230
- fatal_error 'Fatal error processing subitem (%d/%d): %s @ %s\n%s', item, i + 1, items.size, e.message, e.backtrace.first, e.backtrace.map{|t| ' -- ' + t}.join("\n")
230
+ fatal_error "Fatal error processing subitem (%d/%d): %s @ %s\n%s", item, i + 1, items.size, e.message, e.backtrace[..9].map{|t| ' -- ' + t}.join("\n")
231
231
  set_status(item, :FAILED)
232
232
  raise Libis::WorkflowAbort, "#{e.message} @ #{e.backtrace.first}"
233
233
 
@@ -340,7 +340,7 @@ module Libis
340
340
  end
341
341
 
342
342
  def set_status(item, state)
343
- item.set_status(namepath, state) unless parameter(:run_always)
343
+ item.set_status(namepath, state)# unless parameter(:run_always)
344
344
  state
345
345
  end
346
346
 
@@ -43,7 +43,7 @@ module Libis
43
43
  tasks.each_with_index do |task, i|
44
44
  unless task.parameter(:run_always)
45
45
  next unless continue
46
- if item.status(task.namepath) == :DONE && item.get_run.action == :retry
46
+ if item.status(task.namepath) == :DONE && item.get_run.action == :retry
47
47
  debug 'Retry: skipping task %s because it has finished successfully.', item, task.namepath
48
48
  next
49
49
  end
@@ -1,5 +1,5 @@
1
1
  module Libis
2
2
  module Workflow
3
- VERSION = '2.1.14' unless const_defined? :VERSION # the guard is against a redefinition warning that happens on Travis
3
+ VERSION = '2.1.15' unless const_defined? :VERSION # the guard is against a redefinition warning that happens on Travis
4
4
  end
5
5
  end
@@ -27,11 +27,11 @@ Gem::Specification.new do |spec|
27
27
 
28
28
  spec.require_paths = ['lib']
29
29
 
30
- spec.add_development_dependency 'rake', '~> 10.3'
31
- spec.add_development_dependency 'rspec', '~> 3.1'
32
- spec.add_development_dependency 'simplecov', '~> 0.9'
33
- spec.add_development_dependency 'coveralls', '~> 0.7'
34
- spec.add_development_dependency 'awesome_print'
30
+ spec.add_runtime_dependency 'libis-tools', '~> 1.1'
35
31
 
36
- spec.add_runtime_dependency 'libis-tools', '~> 1.0'
32
+ spec.add_development_dependency 'rake'
33
+ spec.add_development_dependency 'rspec'
34
+ spec.add_development_dependency 'simplecov'
35
+ spec.add_development_dependency 'coveralls'
36
+ spec.add_development_dependency 'awesome_print'
37
37
  end
@@ -6,22 +6,28 @@ require 'awesome_print'
6
6
  basedir = File.absolute_path File.join(File.dirname(__FILE__))
7
7
  dirname = File.join(basedir, 'items')
8
8
 
9
- def check_output(logoutput, sample_out)
10
- sample_out = sample_out.lines.to_a.map {|x| x.strip}
11
- output = logoutput.string.lines.to_a.map {|x| x[/(?<=\] ).*/].strip}
9
+ def print_output(logoutput)
10
+ output = logoutput.string.lines.to_a.map {|x| x[/(?<=\] ).*/]&.strip}.compact
12
11
 
13
- # puts 'output:'
14
- # ap output
12
+ puts 'output:'
13
+ ap output
14
+ end
15
15
 
16
+ def check_output(logoutput, sample_out)
17
+ sample_out = sample_out.lines.to_a.map {|x| x&.strip}
18
+ output = logoutput.string.lines.to_a.map {|x| x[/(?<=\] ).*/]&.strip}.compact
16
19
  expect(output.size).to eq sample_out.size
17
20
  output.each_with_index do |o, i|
18
- expect(o).to eq sample_out[i]
21
+ expect(o).to start_with sample_out[i]
19
22
  end
20
23
  end
21
24
 
25
+ def print_status_log(status_log)
26
+ puts 'status_log:'
27
+ status_log.each { |e| ap e }
28
+ end
29
+
22
30
  def check_status_log(status_log, sample_status_log)
23
- # puts 'status_log:'
24
- # status_log.each { |e| ap e }
25
31
  expect(status_log.size).to eq sample_status_log.size
26
32
  sample_status_log.each_with_index do |h, i|
27
33
  h.keys.each {|key| expect(status_log[i][key.to_s]).to eq h[key]}
@@ -113,24 +119,26 @@ DEBUG -- CollectFiles - TestRun : Processing subitem (1/1): items
113
119
  DEBUG -- CollectFiles - items : Processing subitem (1/3): test_dir_item.rb
114
120
  DEBUG -- CollectFiles - items : Processing subitem (2/3): test_file_item.rb
115
121
  DEBUG -- CollectFiles - items : Processing subitem (3/3): test_run.rb
116
- DEBUG -- CollectFiles - items : 3 of 3 subitems passed
117
- DEBUG -- CollectFiles - TestRun : 1 of 1 subitems passed
122
+ DEBUG -- CollectFiles - items : 3 subitem(s) passed
123
+ DEBUG -- CollectFiles - TestRun : 1 subitem(s) passed
118
124
  INFO -- Run - TestRun : Running subtask (2/2): ProcessFiles
119
125
  INFO -- ProcessFiles - TestRun : Running subtask (1/2): ChecksumTester
120
126
  DEBUG -- ProcessFiles/ChecksumTester - TestRun : Processing subitem (1/1): items
121
127
  DEBUG -- ProcessFiles/ChecksumTester - items : Processing subitem (1/3): test_dir_item.rb
122
128
  DEBUG -- ProcessFiles/ChecksumTester - items : Processing subitem (2/3): test_file_item.rb
123
129
  DEBUG -- ProcessFiles/ChecksumTester - items : Processing subitem (3/3): test_run.rb
124
- DEBUG -- ProcessFiles/ChecksumTester - items : 3 of 3 subitems passed
125
- DEBUG -- ProcessFiles/ChecksumTester - TestRun : 1 of 1 subitems passed
130
+ DEBUG -- ProcessFiles/ChecksumTester - items : 3 subitem(s) passed
131
+ DEBUG -- ProcessFiles/ChecksumTester - TestRun : 1 subitem(s) passed
126
132
  INFO -- ProcessFiles - TestRun : Running subtask (2/2): CamelizeName
127
133
  DEBUG -- ProcessFiles/CamelizeName - TestRun : Processing subitem (1/1): items
128
134
  DEBUG -- ProcessFiles/CamelizeName - Items : Processing subitem (1/3): test_dir_item.rb
129
135
  DEBUG -- ProcessFiles/CamelizeName - Items : Processing subitem (2/3): test_file_item.rb
130
136
  DEBUG -- ProcessFiles/CamelizeName - Items : Processing subitem (3/3): test_run.rb
131
- DEBUG -- ProcessFiles/CamelizeName - Items : 3 of 3 subitems passed
132
- DEBUG -- ProcessFiles/CamelizeName - TestRun : 1 of 1 subitems passed
137
+ DEBUG -- ProcessFiles/CamelizeName - Items : 3 subitem(s) passed
138
+ DEBUG -- ProcessFiles/CamelizeName - TestRun : 1 subitem(s) passed
139
+ DEBUG -- ProcessFiles - TestRun : 2 subtask(s) passed
133
140
  INFO -- ProcessFiles - TestRun : Done
141
+ DEBUG -- Run - TestRun : 2 subtask(s) passed
134
142
  INFO -- Run - TestRun : Done
135
143
  STR
136
144
 
@@ -422,7 +430,7 @@ STR
422
430
  it 'should run final task' do
423
431
  run
424
432
 
425
- check_output logoutput, <<STR
433
+ check_output logoutput, <<STR
426
434
  INFO -- Run - TestRun : Ingest run started.
427
435
  INFO -- Run - TestRun : Running subtask (1/3): CollectFiles
428
436
  INFO -- Run - TestRun : Running subtask (2/3): ProcessingTask
@@ -551,10 +559,23 @@ STR
551
559
  it 'should run final task during retry' do
552
560
  run
553
561
 
554
- logoutput.truncate(0)
555
562
  run.run :retry
556
563
 
557
564
  check_output logoutput, <<STR
565
+ INFO -- Run - TestRun : Ingest run started.
566
+ INFO -- Run - TestRun : Running subtask (1/3): CollectFiles
567
+ INFO -- Run - TestRun : Running subtask (2/3): ProcessingTask
568
+ ERROR -- ProcessingTask - TestRun : Task failed with failed status
569
+ ERROR -- ProcessingTask - TestRun : Task failed with failed status
570
+ ERROR -- ProcessingTask - TestRun : Task failed with failed status
571
+ ERROR -- ProcessingTask - items : 3 subitem(s) failed
572
+ ERROR -- ProcessingTask - TestRun : 1 subitem(s) failed
573
+ INFO -- Run - TestRun : Running subtask (3/3): FinalTask
574
+ INFO -- FinalTask - TestRun : Final processing of test_dir_item.rb
575
+ INFO -- FinalTask - TestRun : Final processing of test_file_item.rb
576
+ INFO -- FinalTask - TestRun : Final processing of test_run.rb
577
+ ERROR -- Run - TestRun : 1 subtask(s) failed
578
+ INFO -- Run - TestRun : Failed
558
579
  INFO -- Run - TestRun : Ingest run started.
559
580
  INFO -- Run - TestRun : Running subtask (2/3): ProcessingTask
560
581
  ERROR -- ProcessingTask - TestRun : Task failed with failed status
metadata CHANGED
@@ -1,73 +1,73 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libis-workflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.14
4
+ version: 2.1.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kris Dekeyser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-23 00:00:00.000000000 Z
11
+ date: 2023-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rake
14
+ name: libis-tools
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '10.3'
20
- type: :development
19
+ version: '1.1'
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
- version: '10.3'
26
+ version: '1.1'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rspec
28
+ name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '3.1'
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
- version: '3.1'
40
+ version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
- name: simplecov
42
+ name: rspec
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '0.9'
47
+ version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '0.9'
54
+ version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
- name: coveralls
56
+ name: simplecov
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - "~>"
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '0.7'
61
+ version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - "~>"
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '0.7'
68
+ version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: awesome_print
70
+ name: coveralls
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
@@ -81,19 +81,19 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: libis-tools
84
+ name: awesome_print
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: '1.0'
90
- type: :runtime
89
+ version: '0'
90
+ type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - "~>"
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: '1.0'
96
+ version: '0'
97
97
  description: A simple framework to build custom task/workflow solutions.
98
98
  email: kris.dekeyser@libis.be
99
99
  executables: []
@@ -103,6 +103,7 @@ files:
103
103
  - ".coveralls.yml"
104
104
  - ".gitignore"
105
105
  - ".travis.yml"
106
+ - ".vscode/launch.json"
106
107
  - Gemfile
107
108
  - LICENSE
108
109
  - README.md
@@ -163,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
163
164
  - !ruby/object:Gem::Version
164
165
  version: '0'
165
166
  requirements: []
166
- rubygems_version: 3.3.7
167
+ rubygems_version: 3.4.10
167
168
  signing_key:
168
169
  specification_version: 4
169
170
  summary: LIBIS Workflow framework.