-
Notifications
You must be signed in to change notification settings - Fork 5.3k
WIP: using Jeremy's Roslyn generator to prototype the test migration process #61224
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
…nt Main method that runs all static parameterless [Fact] attributes in sequence, wrapped in a simple try-catch.
…_4 test suite to use the generator.
… basic cases of OS and runtime-specific filtering.
…ames for tests like the TypeGenerator suite). Add support for theories to handle the RunOnly tests that aren't failure cases and don't require out-of-proc execution.
Co-authored-by: Alexander Köplinger <[email protected]>
Co-authored-by: Jan Kotas <[email protected]>
…encies for package restoration
This change is based on Jeremy's POC PR; I have modified the build scripts to minimize the changes to the individual test build scripts. In the simplest case the conversion requires just replacing the Main method with a [Fact]-marked test entrypoint and removing the OutputType property from the project file. Empty OutputType property gets automatically replaced with the Library default in the SDK scripts; this is not a huge deal but I had to remove the pre-existing hack of OutputType=Library + CLRTestKind="" implying SharedLibrary. According to my search most Library projects already have the SharedLibrary CLRTestKind set, for the rest I plan to set it using a bulk project modification; I think I should be able to adapt the ILTransform analyzer for this purpose. Thanks Tomas
|
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
| <!-- Inject the XUnit wrapper generator into test build for [Fact]-style tests --> | ||
| <ItemGroup Condition="$(IsFactStyleTest)"> | ||
| <ProjectReference Include="$(MSBuildThisFileDirectory)/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" /> | ||
| </ItemGroup> | ||
|
|
||
| <Import Project="Common/XUnitWrapperGenerator/XUnitWrapperGenerator.props" Condition="$(IsFactStyleTest)" /> | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can reference the generator and import the MSBuild file for all tests. The generator should be a no-op for non-Fact-style tests. If it isn't, I can make changes to the generator to fix that.
|
Closing as Jeremy is currently code reviewing the real change. My contribution here is very minor, involving just the subtle tweaks to |
…line discussion.
This change is based on Jeremy's POC PR; I have modified the build
scripts to minimize the changes to the individual test build scripts.
In the simplest case the conversion requires just replacing the Main
method with a [Fact]-marked test entrypoint and removing the
OutputType property from the project file. I have demonstrated the
transformation on the project DecimalTest.
Empty OutputType property gets automatically replaced with the Library
default in the SDK scripts; this is not a huge deal but I had to
remove the pre-existing hack of OutputType=Library + CLRTestKind=""
implying SharedLibrary. According to my search most Library projects
already have the SharedLibrary CLRTestKind set, for the rest I plan
to set it using a bulk project modification; I think I should be able
to adapt the ILTransform analyzer for this purpose.
Thanks
Tomas
Contributes to: #54512