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:
Luis Mendes
2026-03-17 18:32:56 +00:00
parent 59be111e1d
commit 01efa2922c
2 changed files with 22 additions and 3 deletions
+1 -1
View File
@@ -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]