-
Notifications
You must be signed in to change notification settings - Fork 325
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
Test run parameter added as part of CLI runsettings args #2251
Conversation
...Platform.Common.UnitTests/ExtensionFramework/Utilities/RunSettingsProviderExtensionsTests.cs
Outdated
Show resolved
Hide resolved
Resources files need to be added |
Update the docs, probably add a one pager on the vstest-docs |
test/vstest.console.UnitTests/Processors/CLIRunSettingsArgumentProcessorTests.cs
Outdated
Show resolved
Hide resolved
test/vstest.console.UnitTests/Processors/CLIRunSettingsArgumentProcessorTests.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.TestPlatform.Common/Utilities/RunSettingsProviderExtensions.cs
Outdated
Show resolved
Hide resolved
src/Microsoft.TestPlatform.Common/Utilities/RunSettingsProviderExtensions.cs
Outdated
Show resolved
Hide resolved
test/vstest.console.UnitTests/Processors/CLIRunSettingsArgumentProcessorTests.cs
Outdated
Show resolved
Hide resolved
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.
With suggestions
@mayankbansal018 Are you fine with the changes ? Just wanted to get a second opinion regarding the format expected from the user |
var attrName = $"(?<{AttributeNameString}>\\w+)"; | ||
var attrValue = $"(?<{AttributeValueString}>.+)"; | ||
Regex regex = new Regex($"{Constants.TestRunParametersName}.{ParameterString}\\(name\\s*=\\s*\"{attrName}\"\\s*,\\s*value\\s*=\\s*\"{attrValue}\"\\)"); | ||
Match match = regex.Match(node); |
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.
this can throw exception, either catch here, or in the caller.
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.
There are four argument exceptions possible
1.ArgumentOutOfRangeException : This comes if options is not a valid bitwise combination, but we have not given options in match
2.ArgumentNullException : This commes if input or pattern is null, but input is always not null and pattern is not null.
3.RegexMatchTimeoutException :This commes if timout occured,but as Pattern is fixed and we have not set timeout in match. We won't get this exceptions
4.ArgumentException : This comes if regular expression is not syntactically correct,This too not valid in our case..
so catching an exception is not that reasonable
|
||
var match = runSettingsProvider.GetTestRunParameterNodeMatch(node); | ||
|
||
if (string.Compare(match.Value, node) == 0) |
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.
Compare [](start = 23, length = 7)
is this case insensitive?
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.
No, it is case sensitive.
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.
🕐
Can we add acceptance tests for this? |
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.
Are there doc updates to describe how to use this new capability? Or screenshots for this PR? |
@hvinett : would you be able to point folks to docs for this in the main issue(#862) and close it out please? |
The following error is shown when TestRunParameter Argument is invalid.