Enhance event handling for Crew, Task, and Event classes

- Add crew name to failed event types (CrewKickoffFailedEvent, CrewTrainFailedEvent, CrewTestFailedEvent)
- Update Task events to remove redundant task and context attributes
- Refactor EventListener to use Logger for consistent event logging
- Add new event types for Crew train and test events
- Improve event bus event tracking in test cases
This commit is contained in:
Lorenze Jay
2025-02-13 12:01:18 -08:00
parent 62a20426a5
commit 00a98cd5c9
9 changed files with 184 additions and 32 deletions

View File

@@ -388,12 +388,16 @@ def test_flow_emits_method_execution_started_event():
flow = TestFlow()
flow.kickoff()
assert len(received_events) == 1
assert len(received_events) == 2
assert received_events[0].method_name == "second_method"
assert received_events[0].method_name == "begin"
assert received_events[0].flow_name == "TestFlow"
assert received_events[0].type == "method_execution_started"
assert received_events[1].method_name == "second_method"
assert received_events[1].flow_name == "TestFlow"
assert received_events[1].type == "method_execution_started"
@pytest.mark.vcr(filter_headers=["authorization"])
def test_register_handler_adds_new_handler():