Files
cleveragents-core/features/bridge_coverage.feature
freemo c9abb45adf test(coverage): add Behave BDD scenarios for 9 under-covered modules
Added 246 new BDD scenarios across 9 feature files to improve unit test
coverage for modules that were either entirely untested or had significant
coverage gaps:

- lock_service_coverage.feature (27 scenarios): validation branches,
  TTL boundaries, re-entrant acquisition, rollback on exceptions
- plan_apply_service_coverage.feature (54 scenarios): operation labels,
  diff rendering (plain/rich/json), artifact building, validation gate,
  changeset resolution and cleanup
- plan_executor_coverage.feature (51 scenarios): step parsing, execute
  actor integration, strategize/execute guards, stub retry/recovery,
  decision tree construction
- skill_cli_coverage_r3.feature (22 scenarios): tools refresh, list/show
  JSON fallback, capability summary errors, remove confirmation
- changeset_repository_coverage.feature (39 scenarios): entry/tool repos
  validation, database error wrapping, domain conversion, SQLite store
  CRUD operations
- repositories_coverage.feature (20 scenarios): get_by_name/namespace
  errors, list_available filters, delete with ActionInUseError, plan
  update with invariants/processing_state/error_details
- sandbox_copy_on_write_coverage.feature (12 scenarios): create OSError
  wrapping, get_path state transitions, commit edge cases, rollback
  errors, cleanup with missing paths
- bridge_coverage.feature (8 scenarios): __del__ suppression, async task
  cancellation, execute_graph message type handling, stream config,
  state checkpointer
- plan_cli_coverage.feature (13 scenarios): legacy apply/list/cd paths,
  use-action with estimation/invariant actors, lifecycle-apply guards,
  status errors, error recovery display

All 246 scenarios (1105 steps) pass. Step definitions use unique prefixes
to prevent ambiguous step conflicts with existing tests.

ISSUES CLOSED: #467
2026-02-27 13:47:42 -05:00

49 lines
2.4 KiB
Gherkin

Feature: RxPyLangGraphBridge uncovered lines and branches
As a developer
I want targeted tests for missed lines and branches in bridge.py
So that line-rate and branch-rate approach 1.0
# Targets: lines 68, 201-204 and branches 3938, 6768, 182184, 260258
Scenario: __del__ suppresses AttributeError when cleanup_tasks is unavailable
Given a bridge with its cleanup_tasks method removed
When __del__ is invoked on the crippled bridge
Then no exception should propagate from __del__
Scenario: cleanup_tasks_async cancels tasks that are still running
Given a bridge with a long-running async task
When I run cleanup_tasks_async on the bridge
Then the running task should be cancelled
And the bridge active tasks set should be empty
Scenario: Graph executor processes a string message through execute_graph
Given a bridge with a mock graph that returns messages
When I run the graph executor with a string content message
Then the executor result should contain the graph output
And the result metadata should include graph execution history
Scenario: Graph executor processes a dict message through execute_graph
Given a bridge with a mock graph that returns messages
When I run the graph executor with a dict content message
Then the executor result should contain the graph output
Scenario: Graph executor processes a non-str non-dict message through execute_graph
Given a bridge with a mock graph that returns messages
When I run the graph executor with a numeric content message
Then the executor result should contain the graph output
Scenario: Graph executor falls back to state dict when messages list is empty
Given a bridge with a mock graph that returns empty messages
When I run the graph executor with a string content message
Then the executor result should be the full state dict
Scenario: create_graph_stream returns StreamConfig for a known graph
Given a bridge that owns a registered graph named "demo"
When I call create_graph_stream with "demo"
Then the returned StreamConfig name should be "graph_demo"
Scenario: _create_state_checkpointer succeeds for a valid graph name
Given a bridge that owns a registered graph named "ckpt_graph"
When I build a state checkpointer for "ckpt_graph"
Then the checkpointer operator should be returned without error