fix(test): align behave BDD scenarios with updated lifecycle-apply behavior
Updated automation_levels.feature to expect "applied" processing state instead of "queued" after completing execute on a full_automation plan, matching the new auto_progress() behavior that drives Apply to terminal state. Updated plan_cli_coverage_boost_steps.py to properly mock the full apply lifecycle (get_plan → apply_plan → start_apply → complete_apply) instead of returning a single plan from apply_plan, matching the updated lifecycle_apply_plan command handler that now drives plans through to the terminal applied state. Refs: #753
This commit is contained in:
@@ -46,7 +46,7 @@ Feature: Automation Levels
|
||||
Given I have a plan with automation level "full_automation" in execute phase with processing state
|
||||
When I complete execute on the automated plan
|
||||
Then the automated plan phase should be "apply"
|
||||
And the automated plan processing state should be "queued"
|
||||
And the automated plan processing state should be "applied"
|
||||
|
||||
# Plan-Level Override Tests
|
||||
|
||||
|
||||
@@ -293,13 +293,32 @@ def step_service_has_strategize_plan(context) -> None:
|
||||
|
||||
@given("the service has a complete execute plan for apply")
|
||||
def step_service_has_execute_plan(context) -> None:
|
||||
plan = _make_plan(
|
||||
pre_plan = _make_plan(
|
||||
plan_id=_ULIDS[1],
|
||||
name="local/apply-plan",
|
||||
phase=PlanPhase.EXECUTE,
|
||||
processing_state=ProcessingState.COMPLETE,
|
||||
)
|
||||
context.mock_lifecycle_service.apply_plan.return_value = plan
|
||||
apply_queued_plan = _make_plan(
|
||||
plan_id=_ULIDS[1],
|
||||
name="local/apply-plan",
|
||||
phase=PlanPhase.APPLY,
|
||||
processing_state=ProcessingState.QUEUED,
|
||||
)
|
||||
applied_plan = _make_plan(
|
||||
plan_id=_ULIDS[1],
|
||||
name="local/apply-plan",
|
||||
phase=PlanPhase.APPLY,
|
||||
processing_state=ProcessingState.APPLIED,
|
||||
)
|
||||
# lifecycle_apply_plan calls get_plan twice: first to check read_only
|
||||
# and phase, then again after apply_plan to drive _complete_apply_if_queued.
|
||||
context.mock_lifecycle_service.get_plan.side_effect = [
|
||||
pre_plan,
|
||||
apply_queued_plan,
|
||||
]
|
||||
context.mock_lifecycle_service.apply_plan.return_value = apply_queued_plan
|
||||
context.mock_lifecycle_service._complete_apply_if_queued.return_value = applied_plan
|
||||
context._apply_plan_id = _ULIDS[1]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user