Skip to content

test: add coverage for find_usages, find_dependencies, and serializer roundtrip (6 new tests)#61

Draft
github-actions[bot] wants to merge 1 commit intomainfrom
test/coverage-graph-find-usages-and-serializer-roundtrip-8114cf4682af9b54
Draft

test: add coverage for find_usages, find_dependencies, and serializer roundtrip (6 new tests)#61
github-actions[bot] wants to merge 1 commit intomainfrom
test/coverage-graph-find-usages-and-serializer-roundtrip-8114cf4682af9b54

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

What gap was identified

Two distinct areas had zero test coverage:

  1. find_usages and find_dependenciessrc/graph/queries.rs exports these two general graph-traversal methods on RefGraph, but they had no tests. The existing query tests only covered the type-filtered variants (find_incoming_transitions, find_outgoing_transitions, find_action_invokers, etc.), leaving the foundational find_usages / find_dependencies methods completely unexercised.

  2. Serializer roundtrip for start_agent and system blockstests/test_serializer_roundtrip.rs covered config, topic, variables, connection, language, and before/after-reasoning, but had no roundtrip test for the start_agent block (name, description, reasoning, reasoning actions) or for the system: block's messages: sub-block (welcome / error strings).

Files modified

File Change
src/graph/queries.rs +3 unit tests
tests/test_serializer_roundtrip.rs +3 roundtrip tests

New tests

src/graph/queries.rs

  • test_find_usages_of_transition_target_topictopic_a has a TransitionsTo edge to topic_b; find_usages(topic_b_idx) must return topic_a as a source because find_usages returns all incoming-edge sources regardless of edge type.

  • test_find_usages_of_topic_routed_from_start_agentstart_agent has a Routes edge to topic_a; find_usages(topic_a_idx) must include the start_agent node as a source.

  • test_find_dependencies_of_start_agent_returns_routed_topicstart_agent routes to topic_a via a Routes edge; find_dependencies(start_agent_idx) must include topic_a because find_dependencies returns all outgoing-edge targets.

tests/test_serializer_roundtrip.rs

  • test_roundtrip_start_agent_basic — a start_agent block with a name, description, and reasoning instructions serializes and re-parses with the name and reasoning preserved.

  • test_roundtrip_start_agent_with_reasoning_actions — two reasoning actions inside start_agent survive a full roundtrip without being dropped or duplicated.

  • test_roundtrip_system_block_with_messages — the system: block's messages: sub-block (welcome + error strings) survives parse → serialize → parse with the welcome message content intact.

Generated by Test Coverage Improver

Generated by Test Coverage Improver

… roundtrip (6 new tests)

Gap: find_usages and find_dependencies in src/graph/queries.rs had no tests
despite being public API on RefGraph. The serializer roundtrip test suite
also had no coverage for the start_agent block or the system block messages.

New tests in src/graph/queries.rs:
- test_find_usages_of_transition_target_topic
- test_find_usages_of_topic_routed_from_start_agent
- test_find_dependencies_of_start_agent_returns_routed_topic

New tests in tests/test_serializer_roundtrip.rs:
- test_roundtrip_start_agent_basic
- test_roundtrip_start_agent_with_reasoning_actions
- test_roundtrip_system_block_with_messages

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added the test label Mar 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants