-
-
Notifications
You must be signed in to change notification settings - Fork 111
fix: Nested class test filtering in VS and Test Explorer #4696
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…tors Nested class tests were invisible to VS Test Explorer "Run Tests" and appeared as flat siblings because tree node paths used only the innermost class name. Now paths use the full Outer+Inner hierarchy (e.g., OuterClass+InnerClass), ClassMetadata.Parent is recursively populated, and filter matching handles both full and partial nested name patterns. Closes #4144 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Code ReviewI found one issue that needs to be addressed: Missing Snapshot Test for Nested Class TestFile: According to CLAUDE.md Rule #2, changes to source generator output require running snapshot tests and committing Since this PR adds a new test file with nested classes AND modifies the source generator to handle nested classes differently (recursive parent generation, Required files missing:
Why this matters:
These changes should be captured in a snapshot test to prevent regressions. Reference pattern: Otherwise: The implementation looks solid. The dual-mode support (source-gen + reflection) is properly maintained, the recursive parent chain logic is correct, and the nested class naming convention using |
Summary
OuterClass+InnerClasshierarchy instead of justInnerClassClassMetadata.Parentis now recursively populated in both source-gen and reflection modesCouldDescriptorMatch,CouldTypeMatch) handles both full nested paths and partial namesCloses #4144
Test plan
NestedClassFilteringTestsengine tests verify:/*/*/NestedTestClassTests+NestedClass/*finds 1 nested test/*/*/NestedTestClassTests+NestedClass/Innerfinds specific nested test/*/*/NestedTestClassTests/Outerstill finds outer class testExpectedStateTestspass (comprehensive pass/fail validation across all modes)UidFilterMatchingTestspass (28 tests, updated to use new nested format)OverlappingClassNameFilterTestspass (no regression in substring matching fix)🤖 Generated with Claude Code