libis-workflow 2.0.10 → 2.0.11
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/libis/workflow/task_group.rb +1 -1
 - data/lib/libis/workflow/tasks/analyzer.rb +14 -3
 - data/lib/libis/workflow/version.rb +1 -1
 - data/spec/workflow_spec.rb +8 -7
 - 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: db408853eaf1375de415370047728a3e4667d3f8
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: bc1996868fe1402e3a215d3b4ba3f55ff0e4886f
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 1f19b3c2e59d474dc9d89698ea008128a1bc942c70686827f8c0631d37f2858d4d1d8cd2234bb25a725a6c5a7597f50fcfb7ab342eac42e279731c28e95b4aa0
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 4673df7b1e87f8b4d79db363456f3bfb28e26142ecf7ab4a92cf7ff9b593346e47090eeee35a2860a1344ead49554bf18dee9b1d10763ecab9d19e5edbbb08e0
         
     | 
| 
         @@ -38,7 +38,7 @@ module Libis 
     | 
|
| 
       38 
38 
     | 
    
         | 
| 
       39 
39 
     | 
    
         
             
                    status = Hash.new(0)
         
     | 
| 
       40 
40 
     | 
    
         
             
                    tasks.each_with_index do |task, i|
         
     | 
| 
       41 
     | 
    
         
            -
                       
     | 
| 
      
 41 
     | 
    
         
            +
                      info 'Running subtask (%d/%d): %s', item, i+1, tasks.size, task.name
         
     | 
| 
       42 
42 
     | 
    
         
             
                      task.run item
         
     | 
| 
       43 
43 
     | 
    
         
             
                      status[item.status(task.namepath)] += 1
         
     | 
| 
       44 
44 
     | 
    
         
             
                      break if parameter(:abort_on_failure) && item.status(task.namepath) != :DONE
         
     | 
| 
         @@ -12,6 +12,16 @@ module Libis 
     | 
|
| 
       12 
12 
     | 
    
         
             
                    # @param [Libis::Workflow::Base::WorkItem] item
         
     | 
| 
       13 
13 
     | 
    
         
             
                    def run(item)
         
     | 
| 
       14 
14 
     | 
    
         | 
| 
      
 15 
     | 
    
         
            +
                      recursive_run(item)
         
     | 
| 
      
 16 
     | 
    
         
            +
                      self.workitem = item
         
     | 
| 
      
 17 
     | 
    
         
            +
                      info 'Ingest finished', item
         
     | 
| 
      
 18 
     | 
    
         
            +
             
     | 
| 
      
 19 
     | 
    
         
            +
                    end
         
     | 
| 
      
 20 
     | 
    
         
            +
             
     | 
| 
      
 21 
     | 
    
         
            +
                    private
         
     | 
| 
      
 22 
     | 
    
         
            +
             
     | 
| 
      
 23 
     | 
    
         
            +
                    def recursive_run(item)
         
     | 
| 
      
 24 
     | 
    
         
            +
             
     | 
| 
       15 
25 
     | 
    
         
             
                      item.properties['ingest_failed'] = item.check_status(:FAILED)
         
     | 
| 
       16 
26 
     | 
    
         | 
| 
       17 
27 
     | 
    
         
             
                      item.summary = {}
         
     | 
| 
         @@ -22,7 +32,7 @@ module Libis 
     | 
|
| 
       22 
32 
     | 
    
         
             
                      end
         
     | 
| 
       23 
33 
     | 
    
         | 
| 
       24 
34 
     | 
    
         
             
                      item.each do |i|
         
     | 
| 
       25 
     | 
    
         
            -
                         
     | 
| 
      
 35 
     | 
    
         
            +
                        recursive_run i
         
     | 
| 
       26 
36 
     | 
    
         
             
                        i.summary.each do |level, count|
         
     | 
| 
       27 
37 
     | 
    
         
             
                          item.summary[level] ||= 0
         
     | 
| 
       28 
38 
     | 
    
         
             
                          item.summary[level] += (count || 0)
         
     | 
| 
         @@ -31,8 +41,9 @@ module Libis 
     | 
|
| 
       31 
41 
     | 
    
         | 
| 
       32 
42 
     | 
    
         
             
                    rescue RuntimeError => ex
         
     | 
| 
       33 
43 
     | 
    
         | 
| 
       34 
     | 
    
         
            -
                       
     | 
| 
       35 
     | 
    
         
            -
                       
     | 
| 
      
 44 
     | 
    
         
            +
                      self.workitem = item
         
     | 
| 
      
 45 
     | 
    
         
            +
                      error 'Failed to analyze item: %s - %s', item, item.class, item.name
         
     | 
| 
      
 46 
     | 
    
         
            +
                      error 'Exception: %s', item, ex.message
         
     | 
| 
       36 
47 
     | 
    
         | 
| 
       37 
48 
     | 
    
         
             
                    ensure
         
     | 
| 
       38 
49 
     | 
    
         | 
| 
         @@ -1,5 +1,5 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            module Libis
         
     | 
| 
       2 
2 
     | 
    
         
             
              module Workflow
         
     | 
| 
       3 
     | 
    
         
            -
                VERSION = '2.0. 
     | 
| 
      
 3 
     | 
    
         
            +
                VERSION = '2.0.11' unless const_defined? :VERSION # the guard is against a redefinition warning that happens on Travis
         
     | 
| 
       4 
4 
     | 
    
         
             
              end
         
     | 
| 
       5 
5 
     | 
    
         
             
            end
         
     | 
    
        data/spec/workflow_spec.rb
    CHANGED
    
    | 
         @@ -89,20 +89,21 @@ DEBUG -- CollectFiles - items : Processing subitem (2/3): test_file_item.rb 
     | 
|
| 
       89 
89 
     | 
    
         
             
            DEBUG -- CollectFiles - items : Processing subitem (3/3): test_run.rb
         
     | 
| 
       90 
90 
     | 
    
         
             
            DEBUG -- CollectFiles - items : 3 of 3 subitems passed
         
     | 
| 
       91 
91 
     | 
    
         
             
            DEBUG -- CollectFiles - TestRun : 1 of 1 subitems passed
         
     | 
| 
       92 
     | 
    
         
            -
             
     | 
| 
      
 92 
     | 
    
         
            +
             INFO -- ProcessFiles - TestRun : Running subtask (1/2): ChecksumTester
         
     | 
| 
       93 
93 
     | 
    
         
             
            DEBUG -- ProcessFiles/ChecksumTester - TestRun : Processing subitem (1/1): items
         
     | 
| 
       94 
94 
     | 
    
         
             
            DEBUG -- ProcessFiles/ChecksumTester - items : Processing subitem (1/3): test_dir_item.rb
         
     | 
| 
       95 
95 
     | 
    
         
             
            DEBUG -- ProcessFiles/ChecksumTester - items : Processing subitem (2/3): test_file_item.rb
         
     | 
| 
       96 
96 
     | 
    
         
             
            DEBUG -- ProcessFiles/ChecksumTester - items : Processing subitem (3/3): test_run.rb
         
     | 
| 
       97 
97 
     | 
    
         
             
            DEBUG -- ProcessFiles/ChecksumTester - items : 3 of 3 subitems passed
         
     | 
| 
       98 
98 
     | 
    
         
             
            DEBUG -- ProcessFiles/ChecksumTester - TestRun : 1 of 1 subitems passed
         
     | 
| 
       99 
     | 
    
         
            -
             
     | 
| 
      
 99 
     | 
    
         
            +
             INFO -- ProcessFiles - TestRun : Running subtask (2/2): CamelizeName
         
     | 
| 
       100 
100 
     | 
    
         
             
            DEBUG -- ProcessFiles/CamelizeName - TestRun : Processing subitem (1/1): items
         
     | 
| 
       101 
101 
     | 
    
         
             
            DEBUG -- ProcessFiles/CamelizeName - Items : Processing subitem (1/3): test_dir_item.rb
         
     | 
| 
       102 
102 
     | 
    
         
             
            DEBUG -- ProcessFiles/CamelizeName - Items : Processing subitem (2/3): test_file_item.rb
         
     | 
| 
       103 
103 
     | 
    
         
             
            DEBUG -- ProcessFiles/CamelizeName - Items : Processing subitem (3/3): test_run.rb
         
     | 
| 
       104 
104 
     | 
    
         
             
            DEBUG -- ProcessFiles/CamelizeName - Items : 3 of 3 subitems passed
         
     | 
| 
       105 
105 
     | 
    
         
             
            DEBUG -- ProcessFiles/CamelizeName - TestRun : 1 of 1 subitems passed
         
     | 
| 
      
 106 
     | 
    
         
            +
             INFO -- Analyzer - TestRun : Ingest finished
         
     | 
| 
       106 
107 
     | 
    
         
             
            STR
         
     | 
| 
       107 
108 
     | 
    
         
             
                sample_out = sample_out.lines.to_a
         
     | 
| 
       108 
109 
     | 
    
         | 
| 
         @@ -113,11 +114,11 @@ STR 
     | 
|
| 
       113 
114 
     | 
    
         | 
| 
       114 
115 
     | 
    
         
             
                expect(output.size).to eq sample_out.size
         
     | 
| 
       115 
116 
     | 
    
         
             
                output.each_with_index do |o, i|
         
     | 
| 
       116 
     | 
    
         
            -
                  expect(o[/(?<=\] ).*/]).to eq sample_out[i].strip
         
     | 
| 
      
 117 
     | 
    
         
            +
                  expect(o[/(?<=\] ).*/].strip).to eq sample_out[i].strip
         
     | 
| 
       117 
118 
     | 
    
         
             
                end
         
     | 
| 
       118 
119 
     | 
    
         | 
| 
       119 
     | 
    
         
            -
                expect(run.summary['DEBUG']).to eq  
     | 
| 
       120 
     | 
    
         
            -
                expect(run.log_history.size).to eq  
     | 
| 
      
 120 
     | 
    
         
            +
                expect(run.summary['DEBUG']).to eq 18
         
     | 
| 
      
 121 
     | 
    
         
            +
                expect(run.log_history.size).to eq 9
         
     | 
| 
       121 
122 
     | 
    
         
             
                expect(run.status_log.size).to eq 8
         
     | 
| 
       122 
123 
     | 
    
         
             
                expect(run.items.first.log_history.size).to eq 12
         
     | 
| 
       123 
124 
     | 
    
         
             
                expect(run.items.first.status_log.size).to eq 6
         
     | 
| 
         @@ -160,10 +161,10 @@ STR 
     | 
|
| 
       160 
161 
     | 
    
         
             
                [
         
     | 
| 
       161 
162 
     | 
    
         
             
                    {severity: 'DEBUG', task: 'CollectFiles', message: 'Processing subitem (1/1): items'},
         
     | 
| 
       162 
163 
     | 
    
         
             
                    {severity: 'DEBUG', task: 'CollectFiles', message: '1 of 1 subitems passed'},
         
     | 
| 
       163 
     | 
    
         
            -
                    {severity: ' 
     | 
| 
      
 164 
     | 
    
         
            +
                    {severity: 'INFO', task: 'ProcessFiles', message: 'Running subtask (1/2): ChecksumTester'},
         
     | 
| 
       164 
165 
     | 
    
         
             
                    {severity: 'DEBUG', task: 'ProcessFiles/ChecksumTester', message: 'Processing subitem (1/1): items'},
         
     | 
| 
       165 
166 
     | 
    
         
             
                    {severity: 'DEBUG', task: 'ProcessFiles/ChecksumTester', message: '1 of 1 subitems passed'},
         
     | 
| 
       166 
     | 
    
         
            -
                    {severity: ' 
     | 
| 
      
 167 
     | 
    
         
            +
                    {severity: 'INFO', task: 'ProcessFiles', message: 'Running subtask (2/2): CamelizeName'},
         
     | 
| 
       167 
168 
     | 
    
         
             
                    {severity: 'DEBUG', task: 'ProcessFiles/CamelizeName', message: 'Processing subitem (1/1): items'},
         
     | 
| 
       168 
169 
     | 
    
         
             
                    {severity: 'DEBUG', task: 'ProcessFiles/CamelizeName', message: '1 of 1 subitems passed'},
         
     | 
| 
       169 
170 
     | 
    
         
             
                ].each_with_index do |h, i|
         
     | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: libis-workflow
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 2.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 2.0.11
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Kris Dekeyser
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2016- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2016-04-06 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: bundler
         
     |