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
Conversation
… 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What gap was identified
Two distinct areas had zero test coverage:
find_usagesandfind_dependencies—src/graph/queries.rsexports these two general graph-traversal methods onRefGraph, 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 foundationalfind_usages/find_dependenciesmethods completely unexercised.Serializer roundtrip for
start_agentandsystemblocks —tests/test_serializer_roundtrip.rscovered config, topic, variables, connection, language, and before/after-reasoning, but had no roundtrip test for thestart_agentblock (name, description, reasoning, reasoning actions) or for thesystem:block'smessages:sub-block (welcome / error strings).Files modified
src/graph/queries.rstests/test_serializer_roundtrip.rsNew tests
src/graph/queries.rstest_find_usages_of_transition_target_topic—topic_ahas aTransitionsToedge totopic_b;find_usages(topic_b_idx)must returntopic_aas a source becausefind_usagesreturns all incoming-edge sources regardless of edge type.test_find_usages_of_topic_routed_from_start_agent—start_agenthas aRoutesedge totopic_a;find_usages(topic_a_idx)must include thestart_agentnode as a source.test_find_dependencies_of_start_agent_returns_routed_topic—start_agentroutes totopic_avia aRoutesedge;find_dependencies(start_agent_idx)must includetopic_abecausefind_dependenciesreturns all outgoing-edge targets.tests/test_serializer_roundtrip.rstest_roundtrip_start_agent_basic— astart_agentblock 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 insidestart_agentsurvive a full roundtrip without being dropped or duplicated.test_roundtrip_system_block_with_messages— thesystem:block'smessages:sub-block (welcome + error strings) survives parse → serialize → parse with the welcome message content intact.