Files
cleveragents-core/features/bridge_coverage_boost.feature

42 lines
2.2 KiB
Gherkin

Feature: Bridge coverage boost for uncovered lines in bridge.py
As a developer
I want thorough tests for remaining uncovered lines in bridge.py
So that code coverage reaches its maximum
# Targets uncovered lines:
# Line 64: early return from cleanup_tasks_async when no tasks exist
# Lines 79-83: pending tasks that do not complete within timeout
# Lines 89-93: late tasks added to _active_tasks during cleanup await
# Line 149: MESSAGE_ROUTER node with "rules" in create_graph_from_config
# Lines 282-290: execute_node inner coroutine in _create_node_operator
Scenario: cleanup_tasks_async returns immediately when no tasks are active
Given a bridge with an empty active tasks set
When I call cleanup_tasks_async on the idle bridge
Then the async cleanup should complete without error
And the bridge active task set should remain empty
Scenario: cleanup_tasks_async logs pending tasks that exceed timeout
Given a bridge with a task that ignores cancellation
When I call cleanup_tasks_async with a very short timeout
Then pending tasks should be re-cancelled after the timeout
And the bridge active task set should be cleared after timeout cleanup
Scenario: cleanup_tasks_async cancels late tasks added during await
Given a bridge with a task whose done-callback spawns a late task
When I call cleanup_tasks_async allowing callback to fire
Then the late task should be cancelled during cleanup
And the bridge active task set should be cleared after late-task cleanup
Scenario: create_graph_from_config sets rules metadata for MESSAGE_ROUTER nodes
Given a bridge ready to create graphs from config
When I create a graph with a MESSAGE_ROUTER node containing rules
Then the node config metadata should contain the routing rules
Scenario: Node operator executes the inner coroutine and updates state
Given a bridge with a graph containing a mock executable node
When I pipe a message through the node operator and await the result
Then the node execute method should have been called
And the state manager should have been updated with the node result
And the returned message metadata should contain the node and graph names