forked from cleveragents/cleveragents-core
fix(test): resolve AmbiguousStep collision, invalid ULIDs, and edge commit
Three issues prevented the behave suite from running:
1. plan_persistence_steps.py and plan_repository_steps.py both defined
@then('the retrieved plan description should be "..."'), causing an
AmbiguousStep error that broke all ~50 feature files. Renamed the
persistence step to "the persisted plan description should be".
2. The three-level hierarchy scenario used plan IDs containing O, I,
and L which are excluded from the ULID charset. Replaced with valid
characters (O->0, I->0, L->K).
3. resource_repository_steps.py flushed but never committed the edge
row, so the delete method's separate session could not see it.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user