-
Notifications
You must be signed in to change notification settings - Fork 171
Experimental: Update to Microsoft Testing Platform v2 #1626
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
Draft
bart-vmware
wants to merge
7
commits into
main
Choose a base branch
from
update-xunit-mtp2
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aa65c8e to
1fccca9
Compare
Contributor
Summary - All Code Coverage (ubuntu-latest)
|
52252c4 to
fa40ecf
Compare
39f0e96 to
bba338e
Compare
0128dae to
d14b393
Compare
d14b393 to
855aff5
Compare
855aff5 to
fbaed29
Compare
5 tasks
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.



Description
This PR migrates existing xUnit v3 tests to run on Microsoft Testing Platform v2, instead of VSTest. This enables running tests both via
dotnet testand as direct executables (the latter hasn't been tried).This PR currently references preview packages from the https://github.com/microsoft/testfx dev-feed. At its core, everything can be made to work almost as well as VSTest. See the list of limitations below. Given that running tests is the primary quality gate for our work and that there's no advantage in switching to the not-so-polished-yet MTPv2, we're holding off on the update for now. The biggest limitation is degraded logging in CI-build: it's not easy to spot which test(s) failed and why.
What's changed
Microsoft.Testing.Extensions.CodeCoverage, because it is incompatiblexunit.runner.visualstudioandMicrosoft.NET.Test.Sdk, which are no longer neededglobal.json, which is required for MTP v2 when using the .NET 10 SDK.runsettingsreplaced bycoverage.config)Microsoft.Testing.Extensions.CodeCoveragecoverage collector only supports the formats Cobertura and Visual Studio XML (the latter doesn't contain branch coverage information)coverage.sonar.config)UseMicrosoftTestingPlatformRunnerxunit.runner.jsoninstead oftestconfig.json, because it works with multiple runnersdotnet testexists with an error (can be overruled with--minimum-expected-tests 0or catching the related exit code)Known issues
Testing.Platformis extremely disappointing microsoft/testfx#5497 /Testing.Platformshould not be a blackbox: leveraging standardHostingmodel andProgram.csfor test application setup microsoft/testfx#4198Verification
dotnet teston the command linedotnet teston the command line✋ It's only possible to debug once; a VS restart is required to debug again (tracked at VS Test Explorer never completes when debugging test in WSL2 microsoft/testfx#7043)
dotnet teston the command line✋ Works, but outputs a 160 MB text log, which makes the GitHub Actions UI completely unresponsive; tracked at Excessive output when crashdump kicks in microsoft/testfx#7045
dotnet teston the command linedotnet teston the command lineQuality checklist
If your change affects other repositories, such as Documentation, Samples and/or MainSite, add linked PRs here.