Files
cleveragents-core/features/route_bridge_uncovered_lines.feature

80 lines
3.4 KiB
Gherkin

Feature: Additional route bridge uncovered lines coverage
As a developer
I want to exercise uncovered branches in route bridge
So that coverage gaps are closed
Background:
Given I have a clean test environment for route bridge
Scenario: Bridge falls back to empty agents on registry failure
Given I have a failing agent registry for route bridge
When I create the route bridge instance
Then the route bridge should be initialized correctly
And the route bridge agents should be empty
Scenario: Upgrade conditions not met when below message_count threshold
Given I have a RouteBridge instance
And I have a stream route config with message_count upgrade condition
And I have a pending message count below threshold
And I have a stream message
When I check upgrade conditions
Then the route bridge upgrade result should be False
Scenario: Complexity threshold too high prevents upgrade
Given I have a RouteBridge instance
And I have a simple stream route config with high complexity threshold
And I have a stream message
When I check upgrade conditions
Then the route bridge upgrade result should be False
Scenario: Callable custom predicate triggers upgrade
Given I have a RouteBridge instance
And I have a stream route config with callable custom_predicate
And I have a stream message
When I check upgrade conditions synchronously
Then the route bridge upgrade result should be True
Scenario: Upgrade applies state extractor and preserves subscriptions loop
Given I have a RouteBridge instance
And I have a stream route config with state extractor and subscriptions
And I have a stream message
When I upgrade the stream route to graph
Then the graph initial state should include extracted data
Scenario: Downgrade uses flattener and checkpointing
Given I have a RouteBridge instance
And I have a graph route config with flattener and checkpointing
And I have a LangGraph instance with checkpointing
When I downgrade the graph with flattener
Then the state flattener should run
And the checkpoint should be saved
Scenario: _create_graph_from_stream uses function node when no agent
Given I have a clean test environment for route bridge
Given I have a RouteBridge instance
When I create a graph config from a stream without agents
Then the resulting graph should use function nodes
Scenario: _get_message_count falls back to update_count attribute
Given I have a clean test environment for route bridge
Given I have a RouteBridge instance
And I seed a fallback update_count conversion
When I get message count for a route
Then the route bridge fallback message count should be returned
Scenario: Downgrade conditions not met when idle time short
Given I have a clean test environment for route bridge
Given I have a RouteBridge instance
And I have a graph route config with idle_time not exceeded
And I have a graph state
When I check downgrade conditions
Then the downgrade result should be False
Scenario: Downgrade conditions not met when state size large
Given I have a clean test environment for route bridge
Given I have a RouteBridge instance
And I have a graph route config with large state size
And I have a graph state with multiple messages
When I check downgrade conditions
Then the downgrade result should be False