Fix source generated proxy suitability testing#1336
Merged
Conversation
This enables a bunch of tests that were previously not running when the interceptor is suppressed. Once we run them in that context, many of them were failing. I fix those bugs here.
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the testing of source-generated proxy suitability by correcting preprocessor directive placement and improving the logic for validating that proxies implement the correct set of interfaces.
- Reorganized preprocessor directives in test file to properly exclude source-generated tests when interceptors are not available
- Fixed interface validation logic to deduplicate required interfaces and properly check for assignability
- Removed trailing period from error message for consistency
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| test/StreamJsonRpc.Tests/JsonRpcProxyGenerationTests.cs | Corrected #if directive placement to properly scope the SourceGenerated test class when interceptors are unavailable |
| src/StreamJsonRpc/Reflection/ProxyInputs.cs | Removed trailing period from Requirements property string |
| src/StreamJsonRpc/Reflection/ProxyBase.cs | Enhanced proxy interface validation by deduplicating required interfaces and fixing the assignability check logic |
matteo-prosperi
approved these changes
Oct 25, 2025
This was referenced Jan 22, 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.
Fix issues that only show up when the interceptor is not used
This enables a bunch of tests that were previously not running when the interceptor is suppressed. Once we run them in that context, many of them were failing. I fix those bugs here.