Write true integration test for MCP stdio wire output validation#3621
Merged
Aniruddh25 merged 2 commits intoMay 20, 2026
Merged
Conversation
- Rewrote McpStdioServerContentBlockTests to capture actual stdio wire output - Test now injects McpStdoutWriter backed by StringWriter into McpStdioServer - Validates the actual JSON-RPC response emitted by WriteResult - Verifies annotations and _meta are omitted from wire output, not serialized as null - Test correctly fails when WhenWritingNull serialization policy is removed - This is now a true regression test that validates the fix at the wire protocol level Agent-Logs-Url: https://github.com/Azure/data-api-builder/sessions/4b68bfc6-9893-4f2e-9772-122e26b21ef1 Co-authored-by: Aniruddh25 <3513779+Aniruddh25@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix code based on review comment with integration test
Write true integration test for MCP stdio wire output validation
May 20, 2026
Aniruddh25
approved these changes
May 20, 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.
Why make this change?
Addresses review comment from PR #3616: The existing test serialized content blocks with locally-defined
JsonSerializerOptions, so it would pass even ifMcpStdioServer.WriteResultemitted"annotations": nulland"_meta": nullin the actual wire output. Not a true regression test.What is this change?
Rewrote
McpStdioServerContentBlockTeststo capture actual stdio JSON-RPC wire output:McpStdoutWriterbacked byStringWriterintoMcpStdioServerWriteResultvia reflection with simulatedCallToolResultcontainingTextContentBlockannotationsand_metaare omitted (not present as null keys)Test correctly fails when
WhenWritingNullserialization policy is removed fromWriteResult, confirming regression detection.How was this tested?
Sample Request(s)
N/A - Test-only change