Skip to content

Commit dfe51b8

Browse files
committed
Proper exception raising from serialized execution too
1 parent c832eff commit dfe51b8

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

lib/octocatalog-diff/util/parallel.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ def self.run_tasks_serial(result, task_array, logger)
152152
task_array.each_with_index do |ele, task_counter|
153153
result[task_counter] = execute_task(ele, logger)
154154
break unless result[task_counter].status
155+
raise result[task_counter].exception
155156
end
156157
end
157158

@@ -166,7 +167,7 @@ def self.execute_task(task, logger)
166167
result = Result.new(output: output, status: true, args: task.args)
167168
rescue => exc
168169
logger.debug("Failed #{task.description}: #{exc.class} #{exc.message}")
169-
return Result.new(exception: exc, status: false, args: task.args)
170+
result = Result.new(exception: exc, status: false, args: task.args)
170171
end
171172

172173
begin

spec/octocatalog-diff/integration/reference_validation_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ def self.catalog_contains_resource(result, type, title)
327327
end
328328

329329
it 'should not succeed' do
330-
expect(@result.exitcode).to eq(-1), OctocatalogDiff::Integration.format_exception(@result)
330+
expect(@result.exitcode).to eq(-1), @result.logs
331331
end
332332

333333
it 'should raise ReferenceValidationError' do

0 commit comments

Comments
 (0)