Skip to content

Conversation

@Vahila
Copy link
Member

@Vahila Vahila commented Sep 10, 2025

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.

@Vahila Vahila requested review from davidbuzinski, mcafaro and sameagen-MW and removed request for davidbuzinski, mcafaro and sameagen-MW September 10, 2025 06:41
@Vahila Vahila closed this Sep 10, 2025
@Vahila Vahila reopened this Sep 10, 2025
@mw-hrastega mw-hrastega self-assigned this Sep 24, 2025
"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."
Copy link
Member

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?

Copy link
Member

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
Copy link
Member

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."
Copy link
Member

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}'`);
Copy link
Member

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?

Copy link
Member

@mcafaro mcafaro left a 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 {
Copy link
Member

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"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
SelectByName: taskLib.getInput("SelectByName"),
SelectByName: taskLib.getInput("selectByName"),

`'CoberturaModelCoverage','${options.CoberturaModelCoverage || ""}',` +
`'SelectByTag','${options.SelectByTag || ""}',` +
`'SelectByFolder','${options.SelectByFolder || ""}',` +
`'SelectByName',${getSelectByNameAsCellArray(options.SelectByName)},` +
Copy link
Member

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}'`);
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants