Repository navigation
Conversation
- Add DotNetTestMtp, the dotnet test options of Microsoft.Testing.Platform (MTP) mode and of its main extensions. DotNetTestSettings stays the VSTest wrapper. - Add a forwarded flag to the tool generator. Forwarded options go to the program the tool runs, last and after a single "--". - Add DotNetTasks.GetTestRunner, which reads test.runner from the nearest global.json, and DOTNET_TEST_RUNNER on the .NET 11 SDK and later. - ITest.UseTestingPlatform now follows that runner. The MTP path runs DotNetTestMtp with TestDegreeOfParallelism and the new TestMtpSettings and TestMtpProjectSettings hooks. It passes the TRX, CI report and coverage options only for the extensions each project registers, found through its TestingPlatformBuilderHook items. - Accept any test host in FalloutBuild.GetBuildAssemblyFile. An MTP test project is its own entry assembly, so the old name check threw. - Fix the DotNetTest docs example, which called a SetLogger method that doesn't exist. Part of Fallout-build#674.
lahma
force-pushed
the
feature/mtp-dotnet-test
branch
from
November 18, 2026 18:45
6c2647e to
f891f7a
Compare
This branch has not been deployed
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
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.
Run tests on Microsoft.Testing.Platform (MTP) with a typed
dotnet testwrapper, and letITestpick the runner fromglobal.json.MTP is the test runner that replaces VSTest. When
global.jsonselects it,dotnet testtakes a different command line. xunit v3 and other frameworks need it on the .NET 10 SDK. This builds on 8ff4c62 (the opt-inITest.UseTestingPlatformthat built the command line as a string).What changed
DotNetTestMtp: a typed task with the MTP options ofdotnet test, plus the options of the main extensions (TRX, Microsoft code coverage, coverlet.MTP, crash and hang dumps, retry, GitHub and Azure DevOps reports).DotNetTestSettingsstays the VSTest wrapper.forwardedin the tool generator: an option markedforwardedgoes to the program the tool runs. All of them come last, after a single--. That is how MTP separates test-application options fromdotnet testoptions.ProcessAdditionalArgumentsstays in front of the--.DotNetTasks.GetTestRunner: readstest.runnerfrom the nearestglobal.json, andDOTNET_TEST_RUNNERon the .NET 11 SDK and later.ITest:UseTestingPlatformnow followsGetTestRunnerinstead offalse. A build that uses MTP needs no override, so this repo'sbuild/Build.csloses its override.DotNetTestMtplike the VSTest path runsDotNetTest. That meansTestDegreeOfParallelismand the new hooksTestMtpSettingsandTestMtpProjectSettings.ITestpasses an option only when the project has the extension. It finds the extensions from theTestingPlatformBuilderHookitems of the project's MSBuild evaluation, which also covers test SDK profiles and transitive packages. If a project can't write a TRX report or collect coverage,ITestlogs a warning.--report-xunit-trx.ITestimports the TRX files.FalloutBuild.GetBuildAssemblyFile: no longer asserts that the test host istesthostorReSharperTestRunner. An MTP test project is its own entry assembly, so a test that touched aFalloutBuildstatic threwTypeInitializationException.DotNetTestexample in the CLI tools docs calledSetLogger, which doesn't exist. It now callsAddLoggers.Notes
[Experimental]. It mirrors thedotnet testcommand line like every other tool wrapper, andUseTestingPlatformalready shipped as stable ondevelop.ITestevaluates each test project once to find its extensions. On CI the VSTest path already does this for the GitHub Actions logger.dotnet test#674 point 4 (reject a glob inAzurePipelines.PublishCodeCoverage). It isn't MTP-specific.Verification
./build.ps1 Test ReportCoverageon this repo, twice:ITestpicked MTP fromglobal.jsonwithout an override and ran all 14 spec projects. It wrote<Project>.trxand one coverlet Cobertura file per project, and ReportCoverage built the report. The second run left no coverage files from the first.Fallout.Tooling.Specs),DotNetTestMtparguments andglobal.jsonreading (Fallout.Common.Specs), extension detection and per-project options (Fallout.Components.Specs), the test-host check (Fallout.Build.Specs).--report-xunit-trxand--coverage-outputwriteA.Specs.trxandA.Specs.cobertura.xmlto the results directory../build.ps1 GenerateToolschanges onlyDotNet.Generated.cs.Part of #674 (first-class MTP support for
dotnet test).