Test | Expose internal types to ManualTests#3239
Conversation
| <TargetFrameworkMonikerAssemblyAttributesPath>$([System.IO.Path]::Combine('$(IntermediateOutputPath)','$(TargetFramework)','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)'))</TargetFrameworkMonikerAssemblyAttributesPath> | ||
| </PropertyGroup> | ||
| <ItemGroup> | ||
| <InternalsVisibleTo Include="ManualTests" /> |
There was a problem hiding this comment.
This syntax is only available in SDK style projects that use .NET 5+. Our only option for netfx was direct assembly tags.
| <TargetFrameworkMonikerAssemblyAttributesPath>$([System.IO.Path]::Combine('$(IntermediateOutputPath)','$(TargetFramework)','$(TargetFrameworkMoniker).AssemblyAttributes$(DefaultLanguageSourceExtension)'))</TargetFrameworkMonikerAssemblyAttributesPath> | ||
| </PropertyGroup> | ||
| <ItemGroup> | ||
| <InternalsVisibleTo Include="ManualTests" /> |
There was a problem hiding this comment.
I love it, but do we need to restrict via strong names and public keys?
As-is, I think this would let anyone pair their assembly named "ManualTests" with our MDS package, and easily access internals. Maybe that isn't a concern though, since they can bypass the whole visibility system via reflection anyway. Thoughts?
benrr101
left a comment
There was a problem hiding this comment.
Love the idea - we've needed it for a long time - but need to see it pass before I can approve :)
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3239 +/- ##
==========================================
- Coverage 72.76% 72.72% -0.05%
==========================================
Files 303 300 -3
Lines 59527 59616 +89
==========================================
+ Hits 43317 43356 +39
- Misses 16210 16260 +50
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
benrr101
left a comment
There was a problem hiding this comment.
Let's gooooooooooooooooooooooooooooooooooooo 🚢 🚢 🚢 🚀
Internal types are not accessible outside of their home project. However, they still need to be tested. This PR exposes internal types to the
ManualTestsandFunctionalTestsprojects so that they can be used directly instead of via reflection.This PR does not update any tests that currently use reflection. Those can be addressed separately as tests are updated or as code health PRs.