Migrate repo from VSTest to Microsoft.Testing.Platform#1141
Migrate repo from VSTest to Microsoft.Testing.Platform#1141Youssef1313 wants to merge 1 commit intoCommunityToolkit:mainfrom
Conversation
|
Blocked on dotnet/sdk#51398 |
Sergio0694
left a comment
There was a problem hiding this comment.
Can you also pls rebase on main to remove the .NET SDK changes? 🙂
| <RunSettings> | ||
| <MSTest> | ||
| <MaxCpuCount>0</MaxCpuCount> | ||
| <Parallelize> |
There was a problem hiding this comment.
Do we still need this?
dotnet/build/Community.Toolkit.Common.targets
Lines 19 to 22 in eb25f10
Or can we remove it in this PR if it's redundant now?
There was a problem hiding this comment.
Interesting. Only one of these are needed, assuming Community.Toolkit.Common.targets is imported for all test projects in the repo.
I would prefer the one in targets and delete the runsettings. Having the assembly attribute provides:
- More consistent experience.
- Hint to MSTest analyzer MSTEST0001 that parallelization is enabled, which will otherwise show a by-design false positive.
| <RepositoryDirectory>$(MSBuildThisFileDirectory)</RepositoryDirectory> | ||
| <BuildToolsDirectory>$(RepositoryDirectory)build\</BuildToolsDirectory> | ||
|
|
||
| <EnableMSTestRunner>true</EnableMSTestRunner> |
There was a problem hiding this comment.
Can you add a comment to explain what this is and what it does? Or a link to docs if there's any.
There was a problem hiding this comment.
Introducing the MSTest Runner - .NET Blog
a new lightweight runner for MSTest tests
the runner does integrate with dotnet test, vstest.console, Visual Studio Test Explorer and Visual Studio Code Test Explorer to provide you with the same experience you are used to
Run tests with MSTest - Microsoft Learn
When you use MSTest SDK, by default you're opted in to using Microsoft.Testing.Platform. Alternatively, you can enable MSTest runner by adding the EnableMSTestRunner property and setting OutputType to Exe in your project file.
It seems to be another option for developers to run tests. According to the blog post, it shouldn't interfere with other methods of running tests.
Assuming this is something that we want, we should also set OutputType to Exe as described in the blog post and documentation.
|
|
||
| # Run tests | ||
| - name: Test solution | ||
| run: dotnet test --no-build -c ${{matrix.configuration}} -l "console;verbosity=detailed" |
There was a problem hiding this comment.
Is this because the verbosity is now detailed by default, or something else?
There was a problem hiding this comment.
The whole UX for MTP is different, and there is no -l (logger). I'm not sure what piece of info was originally intended to be looked at with detailed verbosity, maybe @nohwnd might know what VSTest exactly does under each verbosity, but anyways, I guess if there is something you don't like with the new output, we would love to know to add more customizations and/or having better defaults.
There was a problem hiding this comment.
If detailed shows passed tests, then --output detailed would be kinda the equivalent here.
Closes #<ISSUE_NUMBER>
This PR migrates from VSTest to the newer modern platform, Microsoft.Testing.Platform.
EnableMSTestRunneris how you opt-in to MTP in MSTest.dotnet testinvocations to use the new .NET test command.PR Checklist
Other information