Revision 5ce4fbc6
Added by Ivan Necas almost 7 years ago
lib/foreman_maintain/runner.rb | ||
---|---|---|
next if scenario.steps.empty?
|
||
run_scenario(scenario)
|
||
@last_scenario = scenario
|
||
break if @quit
|
||
end
|
||
end
|
||
|
||
# rubocop:disable Metrics/MethodLength, Metrics/AbcSize
|
||
def run_scenario(scenario)
|
||
@steps_to_run = ForemanMaintain::DependencyGraph.sort(@steps_to_run)
|
||
return unless confirm_scenario(scenario)
|
||
confirm_scenario(scenario)
|
||
while !@quit && !@steps_to_run.empty?
|
||
step = @steps_to_run.shift
|
||
@reporter.puts('Rerunning the check after fix procedure') if rerun_check?(step)
|
||
... | ... | |
when :yes
|
||
true
|
||
when :quit, :no
|
||
ask_to_quit
|
||
false
|
||
else
|
||
raise "Unexpected decision #{decision}"
|
test/lib/runner_test.rb | ||
---|---|---|
end
|
||
|
||
it 'does not continue when the reporter does not confirm the scenario' do
|
||
runner = Runner.new(reporter, [success_scenario])
|
||
runner = Runner.new(reporter, [success_scenario, success_scenario])
|
||
reporter.confirm_scenario = :no
|
||
runner.run
|
||
assert_equal([
|
||
['before_scenario_starts', 'Scenarios::Dummy::Success']
|
||
['before_scenario_starts', 'Scenarios::Dummy::Success'],
|
||
['after_scenario_finishes', 'Scenarios::Dummy::Success']
|
||
], reporter.log, 'unexpected execution')
|
||
end
|
||
end
|
Also available in: Unified diff
Don't continue with scenarios when last is not finished