Support --use-current-runtime / --ucr on dotnet test (MTP)#53515
Support --use-current-runtime / --ucr on dotnet test (MTP)#53515Copilot wants to merge 5 commits intorelease/10.0.3xxfrom
--use-current-runtime / --ucr on dotnet test (MTP)#53515Conversation
Co-authored-by: Youssef1313 <31348972+Youssef1313@users.noreply.github.com>
--use-current-runtime / --ucr on dotnet test
|
@copilot Do not change anything for VSTest. For MTP, use |
…evert VSTest changes Co-authored-by: Youssef1313 <31348972+Youssef1313@users.noreply.github.com>
Done in 9176c9f. VSTest changes are reverted. For MTP, replaced the standalone |
--use-current-runtime / --ucr on dotnet test--use-current-runtime / --ucr on dotnet test (MTP)
...tnet.Tests/CommandTests/Test/snapshots/MTPHelpSnapshotTests.VerifyMTPHelpOutput.verified.txt
Outdated
Show resolved
Hide resolved
…tion to preserve original option ordering Co-authored-by: Youssef1313 <31348972+Youssef1313@users.noreply.github.com>
… line Co-authored-by: Youssef1313 <31348972+Youssef1313@users.noreply.github.com>
Done — no VSTest changes. For MTP, |
| public readonly Option<IReadOnlyDictionary<string, string>> EnvOption = CommonOptions.CreateEnvOption(); | ||
|
|
||
| public readonly Option<ReadOnlyDictionary<string, string>?> PropertiesOption = CommonOptions.CreatePropertyOption(); | ||
| public readonly ImplicitRestoreOptions ImplicitRestoreOptions = new(showHelp: false, useShortOptions: false); |
There was a problem hiding this comment.
Revisiting this again, many options are marked as hidden (because showHelp is false).
I don't have the context on why this was introduced. Are these some options that are kept only for backcompat but we are no longer interested in? So should I avoid using them for MTP dotnet test?
@baronfel Can you please advise here?
There was a problem hiding this comment.
Pull request overview
Adds --use-current-runtime (--ucr) support to the Microsoft Testing Platform (MTP) code path for dotnet test, aligning it with other CLI commands that already forward this switch to MSBuild.
Changes:
- Replaced the standalone
PropertiesOptionin the MTPdotnet testcommand definition withImplicitRestoreOptions(matchingdotnet build), which introduces--ucr/--use-current-runtimeforwarding. - Updated the MTP help snapshot to include the new option in
dotnet testhelp output.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/Cli/Microsoft.DotNet.Cli.Definitions/Commands/Test/TestCommandDefinition.MicrosoftTestingPlatform.cs |
Uses ImplicitRestoreOptions so MTP dotnet test includes --ucr/--use-current-runtime and other restore passthrough options. |
test/dotnet.Tests/CommandTests/Test/snapshots/MTPHelpSnapshotTests.VerifyMTPHelpOutput.verified.txt |
Updates the verified help output snapshot to reflect the newly visible --ucr option. |
You can also share your feedback on Copilot code review. Take the survey.
| TargetPlatformOptions.AddTo(Options); | ||
| Options.Add(VerbosityOption); | ||
| Options.Add(NoRestoreOption); | ||
| Options.Add(NoBuildOption); | ||
| Options.Add(ArtifactsPathOption); | ||
| ImplicitRestoreOptions.AddTo(Options); | ||
| Options.Add(NoAnsiOption); |
nohwnd
left a comment
There was a problem hiding this comment.
read the suggestion from copilot backwards, probably good idea to block also --ucr when using --test-modules, because that deals with already built artifacts.
dotnet testlacked--use-current-runtime(--ucr) support despite it being available ondotnet build,publish,restore, andstore. This change adds support for the MTP code path.Changes
TestCommandDefinition.MicrosoftTestingPlatform— replaced standalonePropertiesOptionwithImplicitRestoreOptions = new(showHelp: false, useShortOptions: false), callingImplicitRestoreOptions.AddTo(Options)exactly asBuildCommandDefinitiondoes. This provides--ucr/--use-current-runtime(visible in help) along with the other hidden restore pass-through options.MTPHelpSnapshotTests.VerifyMTPHelpOutput.verified.txt) — updated to reflect the new option in MTP help output.Original prompt
--use-current-runtimeondotnet testcommands #50369📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.