-
Notifications
You must be signed in to change notification settings - Fork 4
Add SelectByName parameter #148
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
base: master
Are you sure you want to change the base?
Conversation
| "defaultValue": "", | ||
| "groupName": "filterTests", | ||
| "required": false, | ||
| "helpMarkDown": "Test name used to select test suite elements. To create a test suite, the task uses only the test elements with the specified name." |
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.
Thanks for adding this text, Vahila.
@davidbuzinski: Where would such text show up? In the UI?
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.
It shows up if you try to edit the yaml in the pipeline editor at dev.azure.com. There is a list of all the input fields, and each field has a info icon that you can hover over to see this help text.
| set -e | ||
| grep -q StartupTest test-results/matlab/selectbyname.xml | ||
| grep -q simpleTest test-results/matlab/selectbyname.xml | ||
| ! grep -q FirstTest test-results/matlab/selectbytag.xml |
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.
Should this be ! grep -q FirstTest test-results/matlab/selectbytag.xml?
| "defaultValue": "", | ||
| "groupName": "filterTests", | ||
| "required": false, | ||
| "helpMarkDown": "Test name used to select test suite elements. To create a test suite, the task uses only the test elements with the specified name." |
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.
It shows up if you try to edit the yaml in the pipeline editor at dev.azure.com. There is a list of all the input fields, and each field has a info icon that you can hover over to see this help text.
| if (!input || !input.trim()) { | ||
| return "{}"; | ||
| } | ||
| const items = input.split(/\s+/).filter(Boolean).map((s) => `'${s}'`); |
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.
The .filter(Boolean) took me a second. It looks like this is to remove extra spaces (ex: myTest myTest2). We could consider a test that includes extra spaces in the input.
Also, is it possible for test names to have spaces in them? How would a user specify such a test?
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.
Fix it, then ship it! We should really fix scriptgen though so that we do not have to do the error prone space-separated list to cell array conversion in each integration.
| } | ||
|
|
||
| // Function to convert space separated names to cell array of character vectors | ||
| export function getSelectByNameAsCellArray(input?: string): string { |
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.
Hopefully this is just temporary until scriptgen gets updated to properly accept SelectByName as a space separated string?
While unlikely, single-quotes in the strings need to be escaped or it may result in a malformed cell array.
| SourceFolder: taskLib.getInput("sourceFolder"), | ||
| SelectByFolder: taskLib.getInput("selectByFolder"), | ||
| SelectByTag: taskLib.getInput("selectByTag"), | ||
| SelectByName: taskLib.getInput("SelectByName"), |
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.
| SelectByName: taskLib.getInput("SelectByName"), | |
| SelectByName: taskLib.getInput("selectByName"), |
| `'CoberturaModelCoverage','${options.CoberturaModelCoverage || ""}',` + | ||
| `'SelectByTag','${options.SelectByTag || ""}',` + | ||
| `'SelectByFolder','${options.SelectByFolder || ""}',` + | ||
| `'SelectByName',${getSelectByNameAsCellArray(options.SelectByName)},` + |
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.
Is there a plan to go back and fix scriptgen so this can be:
'SelectByName','${options.SelectByName || ""}', ?
| if (!input || !input.trim()) { | ||
| return "{}"; | ||
| } | ||
| const items = input.split(/\s+/).filter(Boolean).map((s) => `'${s}'`); |
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.
Single quotes and curly braces need to be escaped
Added new 'SelectByName' parameter. This would help in supporting Parallel Strategy in Azure.
Note: Genscript changes to support SelectByName needs to be available before these can be merged.