-
Notifications
You must be signed in to change notification settings - Fork 526
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
Update xUnit.net testing template to support xUnit.net v3 #7225
Comments
Another factor to consider is xUnit.net v3 supports the new Microsoft Test Platform but it's optional. Should this be an option presented in the template? What should the default be? |
That is currently the plan, yes. I anticipate 2.9.3 is the final v2 release. It's hard to say for sure, but at this point the bar for show-stopper bug is incredibly high.
I like option 1.
Something to consider, combining this with option 1, is that the option for M.T.P on/off is only valid if you're using v3. There is no plan to support M.T.P for v2 outside of an issue whose implementation is owned by the VSTest team, which they've gone silent on and I presume is actually dead at this point. I'm honestly not even sure it's doable the way they're hoping to do it. I assume if you flip the M.T.P option, it would turn on both I don't really have a gut feeling for how many people want this option to be on, because I have no telemetry. I have gotten a couple issues from people who turned it on and then didn't understand that VSTest-specific options (like trying to specify a VSTest-style filter via |
FYI there is an open issue regarding |
Thanks for your input @bradwilson. As well as option 1 RE the xUnit.net version, I'm leaning to adding an option to allow the user to select the testing platform but defaulting it to the traditional/xUnit option, so users have to opt-in to using Microsoft Test Platform. As you point out, that would only be applicable if xUnit v3 was selected. Do you think this should be a simple on/off option named something like "Use Microsoft Test Platform"? Or should it be a select with choices for "Microsoft Test Platform" and.... whatever we call not using that 😄? |
You could simplify the choices by collapsing them into a tri-mode on the version, something like:
|
FWIW, our templates just unfold into native mode with commented out stuff. I haven't considered whether I would want to add additional switches or not (first up would be <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<OutputType>Exe</OutputType>
<RootNamespace>TestProject</RootNamespace>
<TargetFramework>net8.0</TargetFramework>
<!--
To enable the Microsoft Testing Platform 'dotnet test' experience, add property:
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
To enable the Microsoft Testing Platform native command line experience, add property:
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
For more information on Microsoft Testing Platform support in xUnit.net, please visit:
https://xunit.net/docs/getting-started/v3/microsoft-testing-platform
-->
</PropertyGroup>
<ItemGroup>
<Content Include="xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>
<ItemGroup>
<Using Include="Xunit" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="MICROSOFT_NET_TEST_SDK_VERSION" />
<PackageReference Include="xunit.v3" Version="PACKAGE_VERSION" />
<PackageReference Include="xunit.runner.visualstudio" Version="XUNIT_VISUAL_STUDIO_RUNNER_VERSION" />
</ItemGroup>
</Project> |
xUnit.net released their long-awaited v3. We need to decide how to support it in our Aspire xUnit.net testing project template. Some options:
My thought is we go with option 1 and add a new option that allows the selection of the xUnit.net version to use. We can consider removing the v2 option at some time in the future.
@bradwilson interested in your thoughts. Seems there are going to be no bug fixes for v2 but as you point out some folks might still have valid reasons for using it until the ecosystem has reacted to the v3 release.
The text was updated successfully, but these errors were encountered: