test(crew): align flow-context assertions with execution_id (COR-48)

Two Crew flow-context tests still asserted that `Crew._flow_id`
    and `Crew._request_id` equal `flow.flow_id`. After COR-48
    switched the `current_flow_id` / `current_flow_request_id`
    ContextVars to seed from `execution_id`, `FlowTrackable`
    children now capture the execution tracking key rather than
    `state.id`, so the old assertions fail whenever the two UUIDs
    diverge.

    Updates `test_sets_flow_context_when_using_crewbase_pattern_inside_flow`
    and `test_sets_flow_context_when_inside_flow` to compare against
    `flow.execution_id`, matching the new correlation contract.
This commit is contained in:
Tiago Freire
2026-04-23 10:51:58 -03:00
parent 77d170f9cb
commit 44a66eb7d3

View File

@@ -4519,8 +4519,8 @@ def test_sets_flow_context_when_using_crewbase_pattern_inside_flow():
flow.kickoff()
assert captured_crew is not None
assert captured_crew._flow_id == flow.flow_id # type: ignore[attr-defined]
assert captured_crew._request_id == flow.flow_id # type: ignore[attr-defined]
assert captured_crew._flow_id == flow.execution_id # type: ignore[attr-defined]
assert captured_crew._request_id == flow.execution_id # type: ignore[attr-defined]
def test_sets_flow_context_when_outside_flow(researcher, writer):
@@ -4554,8 +4554,8 @@ def test_sets_flow_context_when_inside_flow(researcher, writer):
flow = MyFlow()
result = flow.kickoff()
assert result._flow_id == flow.flow_id # type: ignore[attr-defined]
assert result._request_id == flow.flow_id # type: ignore[attr-defined]
assert result._flow_id == flow.execution_id # type: ignore[attr-defined]
assert result._request_id == flow.execution_id # type: ignore[attr-defined]
def test_reset_knowledge_with_no_crew_knowledge(researcher, writer):