Repository navigation
Gate dotnet test --solution device selection on IsTestingPlatformApplication only - #57182
Merged
Merged
Conversation
IsTestProject is a VSTest concept and is irrelevant for MTP. VSTest projects are never deployed and are rejected later with the VSTest-unsupported error, so they must not opt into device selection. Previously, a VSTest project whose inner build imported ComputeAvailableDevices failed with "No devices are available" instead. Adds ItDoesNotSelectDevicesForVSTestProjectsInSolution. Co-authored-by: Copilot App <[email protected]> (cherry picked from commit e068010)
Evangelink
requested review from
a team,
lbussell and
mthalman
as code owners
November 17, 2026 20:50
|
Azure Pipelines: Successfully started running 2 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues for the change restricting solution-level device selection to Microsoft.Testing.Platform applications.
No open issues 🎉
What changed in this PR
This PR refines the earlier device-selection fix so dotnet test --solution selects devices only for Microsoft.Testing.Platform applications. VSTest-only projects can then reach the intended unsupported-project error rather than fail during device discovery.
Changes:
- Restricts solution device selection to
IsTestingPlatformApplicationand renames the corresponding gate. - Adds VSTest regression coverage and extracts shared test-project setup.
- Updates CLI guidance; single-project behavior and
--devicehandling remain unchanged.
| File | Description |
|---|---|
test/dotnet.Tests/CommandTests/Test/GivenDotnetTestSelectsDevice.cs |
Adds VSTest regression coverage and shares project setup. |
src/Cli/dotnet/Commands/Test/MTP/SolutionAndProjectUtility.cs |
Restricts the device-selection gate to MTP applications. |
src/Cli/dotnet/Commands/Test/MTP/MSBuildUtility.cs |
Uses the renamed gate for solution evaluation. |
src/Cli/AGENTS.md |
Documents MTP-only solution device selection. |
Review effort: Balanced
5 tasks
Evangelink
enabled auto-merge (squash)
November 18, 2026 10:56
JanKrivanek
approved these changes
Nov 18, 2026
azat-msft
approved these changes
Nov 23, 2026
YuliiaKovalova
approved these changes
Nov 24, 2026
Evangelink
disabled auto-merge
November 25, 2026 09:33
Evangelink
enabled auto-merge (squash)
November 25, 2026 09:33
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.
Follow-up to #57142 (fix for #57120), applying review feedback from the release/11.0.1xx backport #57151 (review).
Change
#57142 limited
dotnet test --solutiondevice selection to projects withIsTestProjectorIsTestingPlatformApplicationset.IsTestProjectis a VSTest concept and is irrelevant for MTP:IsTestingPlatformApplicationprojects are deployed (GetModuleFromProject→DeployAndGetRunProperties).IsTestProject-only projects are collected only so MTP mode can reject them with the VSTest-unsupported error.With the previous gate, a VSTest project whose inner build imports
ComputeAvailableDeviceswas asked for a device, so the run failed withNo devices are available for this project.instead of the VSTest-unsupported error.This PR:
IsTestingPlatformApplicationonly, and renamesrequireTestProject/RequireTestProjecttorequireTestingPlatformApplication/RequireTestingPlatformApplication.ItDoesNotSelectDevicesForVSTestProjectsInSolutionand extracts the shared project setup ofItDoesNotSelectDevicesForNonTestProjectsInSolutioninto a helper.src/Cli/AGENTS.mddevice-selection note.The single-project path and
--devicehandling are unchanged.Validation
On this branch (head
5c7fb36477a277557387618dee0fa73de829c570, based onmainat81ad515a6c8d47882a99ad85d0ad76ac5c8ae1c5) with a fullbuild.cmdredist layout:SolutionAndProjectUtility.csandMSBuildUtility.csreverted tomain,ItDoesNotSelectDevicesForVSTestProjectsInSolutionfails withNo devices are available for this project.GivenDotnetTestSelectsDevicepass.The same change was validated on
release/11.0.1xxin #57151 (commite068010513d6617b2ab8653b2438152a95febc8b): the new test fails with the previous gate, and all 40GivenDotnetTestSelectsDevicetests pass with the fix.