test(execute): fill unit test gaps in Stage 2 execution logic#11
Merged
jamesadevine merged 2 commits intomainfrom Mar 6, 2026
Merged
test(execute): fill unit test gaps in Stage 2 execution logic#11jamesadevine merged 2 commits intomainfrom
jamesadevine merged 2 commits intomainfrom
Conversation
Co-authored-by: jamesadevine <4742697+jamesadevine@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add unit tests for Stage 2 execution logic in execute.rs
test(execute): fill unit test gaps in Stage 2 execution logic
Mar 6, 2026
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.
execute.rshad zero unit tests covering several distinct code paths inexecute_safe_outputandexecute_safe_outputs, leaving silent failures and untested dispatch branches.Added tests
Ok(vec![])— the file-exists-but-empty early-return path was not exercisedmissing-datapassthrough →success: true— the only one of the three informational passthroughs (noop,missing-tool,missing-data) without a testcreate-work-itempayload →Err— entry missing requiredtitle/descriptionfields; existing test only validated missing ADO context, not deserialization failurebail!path to verify the offending tool name appears in the error message, not just the generic prefixOriginal prompt
This section details on the original issue you should resolve
<issue_title>🧪 Test gap analysis — 0 unit tests for Stage 2 execution logic in
execute.rs</issue_title><issue_description>## Test Gap Analysis
Test suite snapshot: 205 unit tests, 21 integration tests (7 compiler + 5 mcp_firewall + 9 proxy), 226 total — all passing.
Priority Gap
execute.rsexecute_safe_output— missingnamefieldnamefield returnsErrexecute.rsexecute_safe_output— unknown tool typebail!path is entirely untestedname: "evil-tool"returns error containing tool nameexecute.rsexecute_safe_output—noop/missing-tool/missing-datapassthroughsuccesswith no side effects — should be trivially testableExecutionResultwithsuccess: trueexecute.rsexecute_safe_outputs— empty NDJSON fileOk(vec![])early — no test exercises this pathexecute.rsexecute_safe_outputs— no file presentOk(vec![])early — no test exercises this pathexecute.rsexecute_safe_output— malformedcreate-work-itemJSONserde_json::from_valuefailure path returnsErr— untestedname: "create-work-item"but missing required fieldsSuggested Test Cases
1. No safe outputs file → empty result
2. Empty NDJSON file → empty result
3. Missing
namefield →Err4. Unknown tool type →
Errwith tool name in message5. Informational tool passthroughs → success
6. Malformed
create-work-itempayload →ErrCoverage Summary
execute.rsexecute.rs#10✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.