Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/dynflow/execution_plan/steps/finalize_step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ def phase
end

def mark_to_skip
return if state == :skipped

self.state = :skipped
self.save
end
Expand Down
19 changes: 19 additions & 0 deletions test/rescue_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,25 @@ def execute(*args)
end
end

describe 'when skipping a run step fails' do
let :execution_plan do
execute(Example::ActionWithSkip, 1, :error_on_skip)
end

it 'allows retrying the skip' do
2.times do
plan = world.persistence.load_execution_plan(execution_plan.id)
plan.skip(plan.failed_steps.first)
world.execute(plan.id).value
end

plan = world.persistence.load_execution_plan(execution_plan.id)
_(plan.state).must_equal :paused
_(plan.run_steps.first.state).must_equal :error
_(plan.finalize_steps.first.state).must_equal :skipped
end
end

describe 'of simple skippable action in finalize phase' do
let :execution_plan do
execute(Example::ActionWithSkip, 1, :error_on_finalize)
Expand Down
Loading