Files
cleveractors-core/robot/email_graph_negative_tests.robot
CoreRasurae 38fe40553d test(robot): add end-to-end integration tests for email categorization actor graph
Adds 104 Robot Framework integration tests exercising the full
6-agent email categorization actor graph across five configuration
strategies: local, remote, mixed, component-decomposed (merge_configs),
and namespaced (local: refs via ReferenceResolver + LocalPackageStore).

- 7 new email graph YAML fixtures under tests/fixtures/email_graph/
- 7 namespaced component YAMLs with local namespace identifiers
- 9 robot test suite files (email_categorization_graph, per-agent,
  negative tests, merge_configs validation, components, namespaced)
- EmailGraphLib.py keyword library (executor, graph, merge, components)
- CleverActorsLib.py refactored into per-module libs:
  robot/lib/config_lib.py, app_lib.py, registry_lib.py
- email_testdata.resource with 12 realistic email scenarios
- All 104 integration tests pass, all 23 existing tests preserved

Closes #30
2026-06-15 23:13:35 +01:00

53 lines
2.7 KiB
Plaintext

*** Settings ***
Documentation Negative integration tests for the email categorization actor graph.
... Tests error handling: invalid configs, missing agents, empty
... inputs, and corrupt data.
Library EmailGraphLib.py
Resource resources/email_testdata.resource
*** Test Cases ***
Graph Without Routes Key Fails At Execution
[Documentation] Config missing 'routes' key: executor construction succeeds,
... but execution fails because multi_actor type cannot dispatch.
Create Executor From Config Dict {"actors": {}}
Execution Should Raise test Error
Graph With Missing Agent Reference Fails At Execution
[Documentation] A node referencing an agent not in actors/agents must fail.
Create Executor From Config Dict {"routes": {"main": {"entry_point": "start", "nodes": {"n1": {"id": "start", "agent": "nonexistent"}}, "edges": []}}, "actors": {"echo": {"type": "tool", "config": {"tools": [{"name": "t", "code": "result = 'ok'"}]}}}}
Execution Should Raise test Error
Invalid Edge Definition Fails At Execution
[Documentation] An edge missing the required 'source' key fails validation.
Create Executor From Config Dict {"routes": {"main": {"entry_point": "n1", "nodes": {"n1": {"id": "n1", "type": "function"}, "n2": {"id": "n2", "type": "function"}}, "edges": [{"target": "n2"}]}}, "actors": {}}
Execution Should Raise test Error
Merge Configs Rejects Non Dict Argument
[Documentation] merge_configs() with a non-dict arg raises TypeError.
Run Keyword And Expect Error TypeError*
... Merge Email Graph Configs Invalid local_graph
Non Dict Config Raises ConfigurationError
[Documentation] Passing a non-dict value to create_executor raises ConfigurationError.
Executor Non Dict Should Fail not-a-dict
Invalid Json Input Does Not Crash Graph
[Documentation] Non-JSON input should be handled gracefully without crashing.
... Tool errors are logged but graph execution completes.
Create Executor For Email Graph local_graph
Execute Email Graph ${INVALID_JSON_INPUT}
Result Is Valid Actor Result
Result Has Nodes
Empty Email Input Does Not Crash
[Documentation] Empty email input should be handled gracefully.
Create Executor For Email Graph local_graph
Execute Email Graph ${EMPTY_EMAIL}
Result Is Valid Actor Result
Result Has Nodes
Agent Factory Rejects Nonexistent Agent
[Documentation] Requesting metadata for a nonexistent agent should raise.
Run Keyword And Expect Error AgentCreationError*
... Factory Agent Has Metadata Key local_graph nonexistent_agent name