9753b31c7e
CI / quality (push) Successful in 36s
CI / lint (push) Successful in 38s
CI / typecheck (push) Successful in 49s
CI / security (push) Successful in 51s
CI / integration_tests (push) Successful in 55s
CI / unit_tests (push) Successful in 3m35s
CI / build (push) Successful in 33s
CI / coverage (push) Successful in 3m36s
CI / status-check (push) Successful in 3s
Add 13 BDD scenarios covering previously uncovered code paths: - SAFE_BUILTINS validation (sandbox.py: 0% → 100%) - ConfigurationError re-raise path (config.py: 99.3% → 100%) - CLI hello/main functions (cli.py: 72.7% → 90.9%) - GraphState message truncation (state.py: 98.7% → 100%) - ProgressBarManager update/context rendering (progress.py: 0% → 87.7%) - MessageRouter regex/exact/contains routing (message_router.py: 0% → 59.4%) - RoutingAdapter parse_routing_command (routing_adapter.py) - DynamicRouterNode pattern-based routing (dynamic_router.py) - EnhancedTemplateRegistry unknown template type (enhanced_registry.py: 99.2%) - CompositeAgent null-graph error path (composite.py: 97.8% → 98.6%) Cover routing_adapter.py (17% → 100%): all GOTO/ROUTE patterns, create_routing_node, create_conditional_router, dynamic config conversion. Cover dynamic_router.py (21% → 87%): execute with empty/dict/string messages, extract_message with colon parsing, config creation, graph extension with edge generation. Cover message_router.py (59% → 78%): regex, exact, contains, prefix, suffix match types, invalid regex handling, non-string message, set_state. Exercise Node._prepare_conversation_history with invalid configs, _runtime error paths, _execute_message_router with rules, _execute_agent with current_message and metadata propagation, _execute_function with dynamic_router, and _execute_conditional with content_contains/content_not_contains/content_starts_with and custom condition types. Improves nodes.py from 71.3% to 72.5%. Exercise PureGraphConfig, PureLangGraph init with dict/config, RxPyLangGraphBridge registration/connection/lookup, ReactiveStreamRouter operator creation and condition functions, ReactiveConfigParser config/route/graph parsing, ToolAgent tool execution with JSON, space-separated, single, file_read, progress_bar invocations, and ReactiveCleverAgentsApp init/dispose/visualization.
72 lines
3.7 KiB
Gherkin
72 lines
3.7 KiB
Gherkin
Feature: Bridge Executor and Connector Event Loop and Task Exception Handling
|
|
As a developer
|
|
I want bridge executors, node operators, and connectors to handle closed loops, task exceptions, and sync cancellation correctly
|
|
So that all bridge async/sync execution paths are exercised and verified
|
|
|
|
Background:
|
|
Given a fresh bridge remaining coverage test context (brc)
|
|
|
|
Scenario: Graph executor creates new loop when existing loop closed
|
|
Given a bridge for graph executor testing (brc)
|
|
When I create a graph executor task future when event loop is closed (brc)
|
|
Then a new event loop should be used by the graph executor (brc)
|
|
|
|
Scenario: Graph executor sync path sets exception on future
|
|
Given a bridge with failing graph for sync path (brc)
|
|
When I invoke the graph executor synchronously and execution fails (brc)
|
|
Then the exception should be captured on the future (brc)
|
|
|
|
Scenario: Graph executor task handler handles CancelledError
|
|
Given a bridge for graph executor testing (brc)
|
|
When a graph executor task receives CancelledError (brc)
|
|
Then the task should be discarded with cancelled debug log (brc)
|
|
|
|
Scenario: Graph executor task handler handles generic exception
|
|
Given a bridge for graph executor testing (brc)
|
|
When a graph executor task raises generic exception (brc)
|
|
Then the task should be removed with exception debug log (brc)
|
|
|
|
Scenario: Node operator creates new loop when existing loop closed
|
|
Given a bridge with a node for operator testing (brc)
|
|
When I create a node operator task future when event loop is closed (brc)
|
|
Then a new event loop should be used by the node operator (brc)
|
|
|
|
Scenario: Node operator sync path sets exception on future
|
|
Given a bridge with failing node for sync path (brc)
|
|
When I invoke the node operator synchronously and node execution fails (brc)
|
|
Then the node exception should be captured on the future (brc)
|
|
|
|
Scenario: Node operator task handler handles CancelledError
|
|
Given a bridge with a node for operator testing (brc)
|
|
When a node operator task receives CancelledError (brc)
|
|
Then the node task should be discarded with cancelled debug log (brc)
|
|
|
|
Scenario: Node operator task handler handles generic exception
|
|
Given a bridge with a node for operator testing (brc)
|
|
When a node operator task raises generic exception (brc)
|
|
Then the node task should be removed with exception debug log (brc)
|
|
|
|
Scenario: Connector creates new loop when existing loop closed
|
|
Given a bridge with stream for connector testing (brc)
|
|
When I create a connector task future when event loop is closed (brc)
|
|
Then a new event loop should be used by the connector (brc)
|
|
|
|
Scenario: Connector task handler handles CancelledError
|
|
Given a bridge with stream for connector testing (brc)
|
|
When a connector task receives CancelledError (brc)
|
|
Then the connector task should be discarded with cancelled debug log (brc)
|
|
|
|
Scenario: Connector task handler handles generic exception
|
|
Given a bridge with stream for connector testing (brc)
|
|
When a connector task raises generic exception (brc)
|
|
Then the connector task should be removed with exception debug log (brc)
|
|
|
|
Scenario: Conditional router returns __output__ for unknown route
|
|
Given a bridge for conditional router testing (brc)
|
|
When no route condition matches and default route is not a string (brc)
|
|
Then the message should be routed to __output__ (brc)
|
|
|
|
Scenario: Cleanup inside running loop cancels tasks without blocking
|
|
Given a bridge with active tasks where event loop is running (brc)
|
|
When cleanup is called while loop is running (brc)
|
|
Then tasks should be cancelled without await (brc) |