-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Handle test parser forwarded args #27961
Handle test parser forwarded args #27961
Conversation
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
The new test output has some duplication that I can't track down the source of:
The 'additional arguments' portion seems to have resources defined, but I don't see where those resources are being accessed. |
Those are defined in the core Localized resources of System.CommandLine, so unless we remove them for all commands there's no getting around it. |
Using the unmatched tokens approach is perhaps cleaner - it doesn't pollute the help output, and it is easy to union the unmatched tokens on the total list of known arguments. The final result seems to work well:
In this example you can see both the |
@nohwnd I pinged you for review because you're familiar with everything going on here. |
3658230
to
c625ebf
Compare
@baronfel I will be leaving for paternity leave some time soon, @Evangelink will take over this for me. We would like to get it into 7.0.1xx servicing. |
@nohwnd congratulations and best of luck! I'll work with @Evangelink to get this in. A little slammed ATM with .NET Conf prep, but we'll make it happen. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will check with team tomorrow for help but I cannot run/debug tests from VS nor from command line using dotnet
although I am following the steps described in https://github.com/dotnet/sdk/blob/main/documentation/project-docs/developer-guide.md.
So I pushed only a partial change in case you have some time to push forward. Otherwise, I will resume my work tomorrow.
Co-authored-by: Jakub Jareš <me@jakubjares.com> Co-authored-by: Amaury Levé <amaury.leve@gmail.com>
Co-authored-by: Jakub Jareš <me@jakubjares.com>
eb53529
to
29c336a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@baronfel I added some nitpicks, could you please apply them?
Co-authored-by: Amaury Levé <amaury.leve@gmail.com>
Description
A tech debt PR for the CLI's command line parsing resulted in a regression where unknown tokens were no longer forwarded along in the
dotnet test
command. This is behavior we want, since commands that forward to MSBuild shouldn't have to embed the entire MSBuild CLI syntax in their own parsers. As a result of this regression, users were unable to pass MSBuild arguments directly, instead having to use workarounds like setting environment variables instead. This was reported in microsoft/vstest#4014.Regression
Yes, this worked in preview 7.
Risk
Low, this uses the same mechanism we have in other locations in the codebase to forward the tokens along
Testing
Details
Closes microsoft/vstest#4014
With the switch away from the legacy
--
handling, users of System.CommandLine have two options for handling unrecognized arguments:ParseResult.UnmatchedTokens
property to get unmatched tokens (tokens that the parser doesn't explicitly have handling for) and do something explicit with themIn this PR I've taken the
formerlatter approach because the former approach results in a help output that is too noisy.