Skip to main content

resolve_scenario_includes

Function resolve_scenario_includes 

Source
pub fn resolve_scenario_includes(
    scenarios: &mut HashMap<String, Vec<ScenarioNode>>,
) -> Result<(), String>
Expand description

Resolve every IncludedScenario { name, children: [] } node produced by [parse_scenario_nodes] into one whose children hold a clone of the referenced scenario’s resolved nodes.

Two failure modes are surfaced as parse errors:

  1. Unknown scenario name — scenario: foo where no scenarios.foo exists.
  2. Cycle — A includes B which (transitively) includes A. The error names the full cycle path so the operator can fix the offending edge.

Resolution is depth-first with memoization so each scenario is resolved at most once regardless of how many places reference it. After this pass the workload model carries no unresolved IncludedScenario nodes; downstream consumers (scope tree, executor, runner) can treat the variant as a fully-formed wrapper scope.