diff --git a/features/plan_persistence.feature b/features/plan_persistence.feature index 75cc9d67..5b638072 100644 --- a/features/plan_persistence.feature +++ b/features/plan_persistence.feature @@ -12,7 +12,7 @@ Feature: Plan persistence via LifecyclePlanRepository Given a new lifecycle plan with ID "01HV000000000000000000PP01" When I persist the plan via the plan repository Then I can retrieve the plan by ID "01HV000000000000000000PP01" - And the retrieved plan description should be "Persistence test plan" + And the persisted plan description should be "Persistence test plan" Scenario: Create a plan preserves all identity fields Given a new lifecycle plan with parent tree ID "01HV000000000000000000PP02" parent "01HV000000000000000000PP01" root "01HV000000000000000000PP01" @@ -92,12 +92,12 @@ Feature: Plan persistence via LifecyclePlanRepository And the child plan should reference root "01HV0000000000000000TREE01" Scenario: Plan tree preserves three-level hierarchy - Given a root plan with ID "01HV0000000000000000ROOT01" - And a mid plan with ID "01HV0000000000000000MID001" under root "01HV0000000000000000ROOT01" - And a leaf plan with ID "01HV0000000000000000LEAF01" under parent "01HV0000000000000000MID001" and root "01HV0000000000000000ROOT01" - When I retrieve the leaf plan "01HV0000000000000000LEAF01" - Then the leaf plan parent should be "01HV0000000000000000MID001" - And the leaf plan root should be "01HV0000000000000000ROOT01" + Given a root plan with ID "01HV0000000000000000R00T01" + And a mid plan with ID "01HV0000000000000000M0D001" under root "01HV0000000000000000R00T01" + And a leaf plan with ID "01HV0000000000000000KEAF01" under parent "01HV0000000000000000M0D001" and root "01HV0000000000000000R00T01" + When I retrieve the leaf plan "01HV0000000000000000KEAF01" + Then the leaf plan parent should be "01HV0000000000000000M0D001" + And the leaf plan root should be "01HV0000000000000000R00T01" # Cross-restart scenarios Scenario: Plan status persists across database reconnection diff --git a/features/steps/plan_persistence_steps.py b/features/steps/plan_persistence_steps.py index 6e2cec51..7134f48b 100644 --- a/features/steps/plan_persistence_steps.py +++ b/features/steps/plan_persistence_steps.py @@ -205,7 +205,7 @@ def step_retrieve_plan_by_id(context: Context, plan_id: str) -> None: context._pp_retrieved = plan -@then('the retrieved plan description should be "{description}"') +@then('the persisted plan description should be "{description}"') def step_plan_description(context: Context, description: str) -> None: """Verify the plan's description.""" assert context._pp_retrieved.description == description diff --git a/features/steps/resource_repository_steps.py b/features/steps/resource_repository_steps.py index f3cc5745..b608db2b 100644 --- a/features/steps/resource_repository_steps.py +++ b/features/steps/resource_repository_steps.py @@ -652,6 +652,7 @@ def step_parent_child_linked(context: Context, type_name: str) -> None: ) session.add(edge) session.flush() + session.commit() @when("the parent resource is deleted")