mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-05-06 17:52:35 +00:00
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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user