Class: ForemanMaintain::Concerns::ScenarioMetadata::DSL
- Inherits:
-
Metadata::DSL
- Object
- Metadata::DSL
- ForemanMaintain::Concerns::ScenarioMetadata::DSL
- Defined in:
- lib/foreman_maintain/concerns/scenario_metadata.rb
Constant Summary collapse
- VALID_STRATEGIES =
[:fail_fast, :fail_slow].freeze
Instance Attribute Summary
Attributes inherited from Metadata::DSL
Instance Method Summary collapse
-
#initialize(*args) ⇒ DSL
constructor
A new instance of DSL.
-
#run_strategy(run_strategy) ⇒ Object
Possible run strategies:.
Methods inherited from Metadata::DSL
#advanced_run, #after, #before, #confine, #description, eval_dsl, #for_feature, #label, #manual_detection, #param, #preparation_steps, #run_once, #tags
Constructor Details
#initialize(*args) ⇒ DSL
Returns a new instance of DSL.
7 8 9 10 11 |
# File 'lib/foreman_maintain/concerns/scenario_metadata.rb', line 7 def initialize(*args) super # the default strategy is to fail as soon as first step fails run_strategy :fail_fast end |
Instance Method Details
#run_strategy(run_strategy) ⇒ Object
Possible run strategies:
* +:fail_fast+ - the scenario stops as soon as the first step fails
* +:fail_slow+ - the step failure doesn't cause the scenario to stop:
it runs all the steps, for the tailures to be reported
at the end
19 20 21 22 23 24 |
# File 'lib/foreman_maintain/concerns/scenario_metadata.rb', line 19 def run_strategy(run_strategy) unless VALID_STRATEGIES.include?(run_strategy) raise "Run strategy #{run_strategy} not one of #{VALID_STRATEGIES}" end @data[:run_strategy] = run_strategy end |