From 4bc8e86586ef3ceee2ff40e319203a7480ea02f3 Mon Sep 17 00:00:00 2001 From: Vahila Kayithi Date: Wed, 10 Sep 2025 12:05:19 +0530 Subject: [PATCH 01/17] Add SeectByName parameter --- integ-test-promote-template.yml | 14 +++++++++++++- tasks/run-matlab-tests/v1/main.ts | 1 + tasks/run-matlab-tests/v1/scriptgen.ts | 13 +++++++++++++ tasks/run-matlab-tests/v1/task.json | 9 +++++++++ tasks/run-matlab-tests/v1/test/scriptgen.test.ts | 8 ++++++-- 5 files changed, 42 insertions(+), 3 deletions(-) diff --git a/integ-test-promote-template.yml b/integ-test-promote-template.yml index cf50b902..bb663ea7 100644 --- a/integ-test-promote-template.yml +++ b/integ-test-promote-template.yml @@ -217,10 +217,15 @@ jobs: testResultsJUnit: test-results/matlab/selectbyfolder.xml selectByFolder: tests/filteredTest - task: MathWorks.matlab-azure-devops-extension-dev.RunMATLABTests.RunMATLABTests@${{ version }} - displayName: Run MATLAB tests filter by folder + displayName: Run MATLAB tests filter by tag inputs: testResultsJUnit: test-results/matlab/selectbytag.xml selectByTag: FILTERED + - task: MathWorks.matlab-azure-devops-extension-dev.RunMATLABTests.RunMATLABTests@${{ version }} + displayName: Run MATLAB tests filter by name + inputs: + testResultsJUnit: test-results/matlab/selectbyname.xml + selectByName: "filtertest/* mytest/StartupTest" - bash: | set -e grep -q FirstTest test-results/matlab/results.xml @@ -240,6 +245,13 @@ jobs: grep -v FirstTest test-results/matlab/selectbytag.xml grep -v simpleTest test-results/matlab/selectbytag.xml displayName: Verify test filtered by tag name + # Will uncomment this once Genscript changes are released + # - bash: | + # set -e + # grep -q StartupTest test-results/matlab/selectbyname.xml + # grep -v simpleTest test-results/matlab/selectbyname.xml + # ! grep -q FirstTest test-results/matlab/selectbytag.xml + # displayName: Verify test filtered by name - bash: | echo 'diary console.log' >> startup.m displayName: Set up diary for logging diff --git a/tasks/run-matlab-tests/v1/main.ts b/tasks/run-matlab-tests/v1/main.ts index ed0bdb0f..1f155327 100644 --- a/tasks/run-matlab-tests/v1/main.ts +++ b/tasks/run-matlab-tests/v1/main.ts @@ -14,6 +14,7 @@ async function run() { SourceFolder: taskLib.getInput("sourceFolder"), SelectByFolder: taskLib.getInput("selectByFolder"), SelectByTag: taskLib.getInput("selectByTag"), + SelectByName: taskLib.getInput("SelectByName"), CoberturaModelCoverage: taskLib.getInput("modelCoverageCobertura"), SimulinkTestResults: taskLib.getInput("testResultsSimulinkTest"), PDFTestReport: taskLib.getInput("testResultsPDF"), diff --git a/tasks/run-matlab-tests/v1/scriptgen.ts b/tasks/run-matlab-tests/v1/scriptgen.ts index 68d6e3c8..e2c3d1af 100644 --- a/tasks/run-matlab-tests/v1/scriptgen.ts +++ b/tasks/run-matlab-tests/v1/scriptgen.ts @@ -11,12 +11,24 @@ export interface IRunTestsOptions { CoberturaModelCoverage?: string; SelectByTag?: string; SelectByFolder?: string; + SelectByName?: string; Strict?: boolean; UseParallel?: boolean; OutputDetail?: string; LoggingLevel?: string; } +// Function to convert space separated names to cell array of character vectors +export function getSelectByNameAsCellArray(input?: string): string { + if (!input) { + return ""; + } + // Split by whitespace, filter out empty, wrap each in single quotes + const items = input.split(/\s+/).filter(Boolean).map((s) => `'${s}'`); + // Join with commas, wrap in {} + return `{${items.join(", ")}}`; +} + export function generateCommand(options: IRunTestsOptions): string { return `addpath('${path.join(__dirname, "scriptgen")}');` + `testScript = genscript('Test',` + @@ -28,6 +40,7 @@ export function generateCommand(options: IRunTestsOptions): string { `'CoberturaModelCoverage','${options.CoberturaModelCoverage || ""}',` + `'SelectByTag','${options.SelectByTag || ""}',` + `'SelectByFolder','${options.SelectByFolder || ""}',` + + `'SelectByName','${getSelectByNameAsCellArray(options.SelectByName) || ""}',` + `'Strict',${options.Strict || false},` + `'UseParallel',${options.UseParallel || false},` + `'OutputDetail','${options.OutputDetail || ""}',` + diff --git a/tasks/run-matlab-tests/v1/task.json b/tasks/run-matlab-tests/v1/task.json index ef9cc098..8f51b809 100644 --- a/tasks/run-matlab-tests/v1/task.json +++ b/tasks/run-matlab-tests/v1/task.json @@ -57,6 +57,15 @@ "required": false, "helpMarkDown": "Test tag used to select test suite elements. To create a test suite, the task uses only the test elements with the specified tag." }, + { + "name": "selectByName", + "type": "string", + "label": "By name", + "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." + }, { "name": "strict", "type": "boolean", diff --git a/tasks/run-matlab-tests/v1/test/scriptgen.test.ts b/tasks/run-matlab-tests/v1/test/scriptgen.test.ts index d89e4921..e92e7c8b 100644 --- a/tasks/run-matlab-tests/v1/test/scriptgen.test.ts +++ b/tasks/run-matlab-tests/v1/test/scriptgen.test.ts @@ -15,6 +15,7 @@ export default function suite() { CoberturaModelCoverage: "", SelectByTag: "", SelectByFolder: "", + SelectByName: "", Strict: false, UseParallel: false, OutputDetail: "", @@ -32,6 +33,7 @@ export default function suite() { assert(actual.includes("'CoberturaModelCoverage',''")); assert(actual.includes("'SelectByTag',''")); assert(actual.includes("'SelectByFolder',''")); + assert(actual.includes("'SelectByName',''")); assert(actual.includes("'Strict',false")); assert(actual.includes("'UseParallel',false")); assert(actual.includes("'OutputDetail',''")); @@ -39,7 +41,7 @@ export default function suite() { const expected = `genscript('Test', 'JUnitTestResults','', 'CoberturaCodeCoverage','', 'SourceFolder','', 'PDFTestReport','', 'SimulinkTestResults','', - 'CoberturaModelCoverage','', 'SelectByTag','', 'SelectByFolder','', + 'CoberturaModelCoverage','', 'SelectByTag','', 'SelectByFolder','', 'SelectByName','', 'Strict',false, 'UseParallel',false, 'OutputDetail','', 'LoggingLevel','')` .replace(/\s+/g, ""); assert(actual.replace(/\s+/g, "").includes(expected)); @@ -55,6 +57,7 @@ export default function suite() { CoberturaModelCoverage: "test-results/modelcoverage.xml", SelectByTag: "FeatureA", SelectByFolder: "test/tools;test/toolbox", + SelectByName: "tTestA/* tTestB/*", Strict: true, UseParallel: true, OutputDetail: "Detailed", @@ -72,6 +75,7 @@ export default function suite() { assert(actual.includes("'CoberturaModelCoverage','test-results/modelcoverage.xml'")); assert(actual.includes("'SelectByTag','FeatureA'")); assert(actual.includes("'SelectByFolder','test/tools;test/toolbox'")); + assert(actual.includes("'SelectByName','{'tTestA/*', 'tTestB/*'}'")); assert(actual.includes("'Strict',true")); assert(actual.includes("'UseParallel',true")); assert(actual.includes("'OutputDetail','Detailed'")); @@ -81,7 +85,7 @@ export default function suite() { 'CoberturaCodeCoverage','code-coverage/coverage.xml', 'SourceFolder','source', 'PDFTestReport','test-results/pdf-results.pdf', 'SimulinkTestResults','test-results/simulinkTest.mldatx', 'CoberturaModelCoverage','test-results/modelcoverage.xml', 'SelectByTag','FeatureA', - 'SelectByFolder','test/tools;test/toolbox', 'Strict',true, 'UseParallel',true, 'OutputDetail','Detailed', + 'SelectByFolder','test/tools;test/toolbox', 'SelectByName','{'tTestA/*', 'tTestB/*'}', 'Strict',true, 'UseParallel',true, 'OutputDetail','Detailed', 'LoggingLevel','Detailed' )` .replace(/\s+/g, ""); assert(actual.replace(/\s+/g, "").includes(expected)); From 9413f22d849b16ee7af54ea83acf26fdd971a25c Mon Sep 17 00:00:00 2001 From: Vahila Kayithi Date: Wed, 10 Sep 2025 15:43:32 +0530 Subject: [PATCH 02/17] Remove comment --- integ-test-promote-template.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/integ-test-promote-template.yml b/integ-test-promote-template.yml index bb663ea7..d171b28c 100644 --- a/integ-test-promote-template.yml +++ b/integ-test-promote-template.yml @@ -245,7 +245,6 @@ jobs: grep -v FirstTest test-results/matlab/selectbytag.xml grep -v simpleTest test-results/matlab/selectbytag.xml displayName: Verify test filtered by tag name - # Will uncomment this once Genscript changes are released # - bash: | # set -e # grep -q StartupTest test-results/matlab/selectbyname.xml From f444f1d9c054a19e1dc1a50097221255c9efc515 Mon Sep 17 00:00:00 2001 From: Vahila <70003902+Vahila@users.noreply.github.com> Date: Wed, 24 Sep 2025 10:33:58 +0530 Subject: [PATCH 03/17] Update the test --- integ-test-promote-template.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/integ-test-promote-template.yml b/integ-test-promote-template.yml index d171b28c..3a5d39d4 100644 --- a/integ-test-promote-template.yml +++ b/integ-test-promote-template.yml @@ -245,12 +245,12 @@ jobs: grep -v FirstTest test-results/matlab/selectbytag.xml grep -v simpleTest test-results/matlab/selectbytag.xml displayName: Verify test filtered by tag name - # - bash: | - # set -e - # grep -q StartupTest test-results/matlab/selectbyname.xml - # grep -v simpleTest test-results/matlab/selectbyname.xml - # ! grep -q FirstTest test-results/matlab/selectbytag.xml - # displayName: Verify test filtered by name + - bash: | + set -e + grep -q StartupTest test-results/matlab/selectbyname.xml + grep -v simpleTest test-results/matlab/selectbyname.xml + ! grep -q FirstTest test-results/matlab/selectbytag.xml + displayName: Verify test filtered by name - bash: | echo 'diary console.log' >> startup.m displayName: Set up diary for logging From e4f4ac689fe7312d50277704d341e97bab514619 Mon Sep 17 00:00:00 2001 From: Vahila <70003902+Vahila@users.noreply.github.com> Date: Wed, 24 Sep 2025 10:57:57 +0530 Subject: [PATCH 04/17] Update the version --- build-test-publish.pipeline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-test-publish.pipeline.yml b/build-test-publish.pipeline.yml index a33ff971..f6cb0c23 100644 --- a/build-test-publish.pipeline.yml +++ b/build-test-publish.pipeline.yml @@ -1,4 +1,4 @@ -name: 1.13$(Rev:.r) +name: 1.14$(Rev:.r) trigger: - master From 9425747355d9bbe21fe07734ea35e77465fe5807 Mon Sep 17 00:00:00 2001 From: Vahila <70003902+Vahila@users.noreply.github.com> Date: Fri, 10 Oct 2025 20:21:26 +0530 Subject: [PATCH 05/17] Send {} when empty selectByName value --- tasks/run-matlab-tests/v1/scriptgen.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tasks/run-matlab-tests/v1/scriptgen.ts b/tasks/run-matlab-tests/v1/scriptgen.ts index e2c3d1af..107d1f64 100644 --- a/tasks/run-matlab-tests/v1/scriptgen.ts +++ b/tasks/run-matlab-tests/v1/scriptgen.ts @@ -20,12 +20,10 @@ export interface IRunTestsOptions { // Function to convert space separated names to cell array of character vectors export function getSelectByNameAsCellArray(input?: string): string { - if (!input) { - return ""; + if (!input || !input.trim()) { + return '{}'; } - // Split by whitespace, filter out empty, wrap each in single quotes const items = input.split(/\s+/).filter(Boolean).map((s) => `'${s}'`); - // Join with commas, wrap in {} return `{${items.join(", ")}}`; } @@ -40,7 +38,7 @@ export function generateCommand(options: IRunTestsOptions): string { `'CoberturaModelCoverage','${options.CoberturaModelCoverage || ""}',` + `'SelectByTag','${options.SelectByTag || ""}',` + `'SelectByFolder','${options.SelectByFolder || ""}',` + - `'SelectByName','${getSelectByNameAsCellArray(options.SelectByName) || ""}',` + + `'SelectByName','${getSelectByNameAsCellArray(options.SelectByName)}',` + `'Strict',${options.Strict || false},` + `'UseParallel',${options.UseParallel || false},` + `'OutputDetail','${options.OutputDetail || ""}',` + From 2ed76cc422632176d779334ee73ba2f3dae41a7d Mon Sep 17 00:00:00 2001 From: Vahila <70003902+Vahila@users.noreply.github.com> Date: Fri, 10 Oct 2025 20:40:12 +0530 Subject: [PATCH 06/17] Update scriptgen.ts --- tasks/run-matlab-tests/v1/scriptgen.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/run-matlab-tests/v1/scriptgen.ts b/tasks/run-matlab-tests/v1/scriptgen.ts index 107d1f64..3367996f 100644 --- a/tasks/run-matlab-tests/v1/scriptgen.ts +++ b/tasks/run-matlab-tests/v1/scriptgen.ts @@ -21,7 +21,7 @@ export interface IRunTestsOptions { // Function to convert space separated names to cell array of character vectors export function getSelectByNameAsCellArray(input?: string): string { if (!input || !input.trim()) { - return '{}'; + return "{}"; } const items = input.split(/\s+/).filter(Boolean).map((s) => `'${s}'`); return `{${items.join(", ")}}`; From 116be18998400a1be767aeeef07066f1d9d1811b Mon Sep 17 00:00:00 2001 From: Vahila <70003902+Vahila@users.noreply.github.com> Date: Fri, 10 Oct 2025 20:45:41 +0530 Subject: [PATCH 07/17] Update failing test --- tasks/run-matlab-tests/v1/test/scriptgen.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/run-matlab-tests/v1/test/scriptgen.test.ts b/tasks/run-matlab-tests/v1/test/scriptgen.test.ts index e92e7c8b..4c902373 100644 --- a/tasks/run-matlab-tests/v1/test/scriptgen.test.ts +++ b/tasks/run-matlab-tests/v1/test/scriptgen.test.ts @@ -33,7 +33,7 @@ export default function suite() { assert(actual.includes("'CoberturaModelCoverage',''")); assert(actual.includes("'SelectByTag',''")); assert(actual.includes("'SelectByFolder',''")); - assert(actual.includes("'SelectByName',''")); + assert(actual.includes("'SelectByName',{}")); assert(actual.includes("'Strict',false")); assert(actual.includes("'UseParallel',false")); assert(actual.includes("'OutputDetail',''")); @@ -41,7 +41,7 @@ export default function suite() { const expected = `genscript('Test', 'JUnitTestResults','', 'CoberturaCodeCoverage','', 'SourceFolder','', 'PDFTestReport','', 'SimulinkTestResults','', - 'CoberturaModelCoverage','', 'SelectByTag','', 'SelectByFolder','', 'SelectByName','', + 'CoberturaModelCoverage','', 'SelectByTag','', 'SelectByFolder','', 'SelectByName',{}, 'Strict',false, 'UseParallel',false, 'OutputDetail','', 'LoggingLevel','')` .replace(/\s+/g, ""); assert(actual.replace(/\s+/g, "").includes(expected)); From e16adf7721cf99cb02157451fcb968152501fd75 Mon Sep 17 00:00:00 2001 From: Vahila <70003902+Vahila@users.noreply.github.com> Date: Fri, 10 Oct 2025 20:54:59 +0530 Subject: [PATCH 08/17] Update failing test --- tasks/run-matlab-tests/v1/test/scriptgen.test.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tasks/run-matlab-tests/v1/test/scriptgen.test.ts b/tasks/run-matlab-tests/v1/test/scriptgen.test.ts index 4c902373..18c7540c 100644 --- a/tasks/run-matlab-tests/v1/test/scriptgen.test.ts +++ b/tasks/run-matlab-tests/v1/test/scriptgen.test.ts @@ -24,6 +24,8 @@ export default function suite() { const actual = scriptgen.generateCommand(options); + console.log(actual); + assert(actual.includes("genscript('Test'")); assert(actual.includes("'JUnitTestResults',''")); assert(actual.includes("'CoberturaCodeCoverage',''")); @@ -66,6 +68,8 @@ export default function suite() { const actual = scriptgen.generateCommand(options); + console.log(actual); + assert(actual.includes("genscript('Test'")); assert(actual.includes("'JUnitTestResults','test-results/results.xml'")); assert(actual.includes("'CoberturaCodeCoverage','code-coverage/coverage.xml'")); From 9ec180ef32062fbe47fcd4a01632a7243d02b121 Mon Sep 17 00:00:00 2001 From: Vahila <70003902+Vahila@users.noreply.github.com> Date: Fri, 10 Oct 2025 20:57:04 +0530 Subject: [PATCH 09/17] Update failing test --- tasks/run-matlab-tests/v1/test/scriptgen.test.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/tasks/run-matlab-tests/v1/test/scriptgen.test.ts b/tasks/run-matlab-tests/v1/test/scriptgen.test.ts index 18c7540c..c10cc258 100644 --- a/tasks/run-matlab-tests/v1/test/scriptgen.test.ts +++ b/tasks/run-matlab-tests/v1/test/scriptgen.test.ts @@ -25,7 +25,6 @@ export default function suite() { const actual = scriptgen.generateCommand(options); console.log(actual); - assert(actual.includes("genscript('Test'")); assert(actual.includes("'JUnitTestResults',''")); assert(actual.includes("'CoberturaCodeCoverage',''")); @@ -69,7 +68,6 @@ export default function suite() { const actual = scriptgen.generateCommand(options); console.log(actual); - assert(actual.includes("genscript('Test'")); assert(actual.includes("'JUnitTestResults','test-results/results.xml'")); assert(actual.includes("'CoberturaCodeCoverage','code-coverage/coverage.xml'")); From 2ae052ab4b5c3027f5d02ae6072542bdddc8ce0d Mon Sep 17 00:00:00 2001 From: Vahila <70003902+Vahila@users.noreply.github.com> Date: Fri, 10 Oct 2025 21:09:41 +0530 Subject: [PATCH 10/17] test fix --- tasks/run-matlab-tests/v1/scriptgen.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/run-matlab-tests/v1/scriptgen.ts b/tasks/run-matlab-tests/v1/scriptgen.ts index 3367996f..6a578deb 100644 --- a/tasks/run-matlab-tests/v1/scriptgen.ts +++ b/tasks/run-matlab-tests/v1/scriptgen.ts @@ -38,7 +38,7 @@ export function generateCommand(options: IRunTestsOptions): string { `'CoberturaModelCoverage','${options.CoberturaModelCoverage || ""}',` + `'SelectByTag','${options.SelectByTag || ""}',` + `'SelectByFolder','${options.SelectByFolder || ""}',` + - `'SelectByName','${getSelectByNameAsCellArray(options.SelectByName)}',` + + `'SelectByName',${getSelectByNameAsCellArray(options.SelectByName)},` + `'Strict',${options.Strict || false},` + `'UseParallel',${options.UseParallel || false},` + `'OutputDetail','${options.OutputDetail || ""}',` + From 37a6828968060611f2c245b282ec2921ab020236 Mon Sep 17 00:00:00 2001 From: Vahila <70003902+Vahila@users.noreply.github.com> Date: Fri, 10 Oct 2025 21:14:01 +0530 Subject: [PATCH 11/17] Update test --- tasks/run-matlab-tests/v1/test/scriptgen.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/run-matlab-tests/v1/test/scriptgen.test.ts b/tasks/run-matlab-tests/v1/test/scriptgen.test.ts index c10cc258..86bf15b3 100644 --- a/tasks/run-matlab-tests/v1/test/scriptgen.test.ts +++ b/tasks/run-matlab-tests/v1/test/scriptgen.test.ts @@ -77,7 +77,7 @@ export default function suite() { assert(actual.includes("'CoberturaModelCoverage','test-results/modelcoverage.xml'")); assert(actual.includes("'SelectByTag','FeatureA'")); assert(actual.includes("'SelectByFolder','test/tools;test/toolbox'")); - assert(actual.includes("'SelectByName','{'tTestA/*', 'tTestB/*'}'")); + assert(actual.includes("'SelectByName',{'tTestA/*', 'tTestB/*'}")); assert(actual.includes("'Strict',true")); assert(actual.includes("'UseParallel',true")); assert(actual.includes("'OutputDetail','Detailed'")); From 24c8e78a050e075d70c1e6e9977a1509afe40a4e Mon Sep 17 00:00:00 2001 From: Vahila <70003902+Vahila@users.noreply.github.com> Date: Fri, 10 Oct 2025 21:17:40 +0530 Subject: [PATCH 12/17] Update test --- tasks/run-matlab-tests/v1/test/scriptgen.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/run-matlab-tests/v1/test/scriptgen.test.ts b/tasks/run-matlab-tests/v1/test/scriptgen.test.ts index 86bf15b3..882e15a7 100644 --- a/tasks/run-matlab-tests/v1/test/scriptgen.test.ts +++ b/tasks/run-matlab-tests/v1/test/scriptgen.test.ts @@ -87,7 +87,7 @@ export default function suite() { 'CoberturaCodeCoverage','code-coverage/coverage.xml', 'SourceFolder','source', 'PDFTestReport','test-results/pdf-results.pdf', 'SimulinkTestResults','test-results/simulinkTest.mldatx', 'CoberturaModelCoverage','test-results/modelcoverage.xml', 'SelectByTag','FeatureA', - 'SelectByFolder','test/tools;test/toolbox', 'SelectByName','{'tTestA/*', 'tTestB/*'}', 'Strict',true, 'UseParallel',true, 'OutputDetail','Detailed', + 'SelectByFolder','test/tools;test/toolbox', 'SelectByName',{'tTestA/*', 'tTestB/*'}, 'Strict',true, 'UseParallel',true, 'OutputDetail','Detailed', 'LoggingLevel','Detailed' )` .replace(/\s+/g, ""); assert(actual.replace(/\s+/g, "").includes(expected)); From f32317ef8210cbb2438191adc70f419490223cd7 Mon Sep 17 00:00:00 2001 From: Vahila <70003902+Vahila@users.noreply.github.com> Date: Fri, 10 Oct 2025 21:50:53 +0530 Subject: [PATCH 13/17] Update file --- integ-test-promote-template.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/integ-test-promote-template.yml b/integ-test-promote-template.yml index 3a5d39d4..221d589d 100644 --- a/integ-test-promote-template.yml +++ b/integ-test-promote-template.yml @@ -226,6 +226,7 @@ jobs: inputs: testResultsJUnit: test-results/matlab/selectbyname.xml selectByName: "filtertest/* mytest/StartupTest" + sourceFolder: src - bash: | set -e grep -q FirstTest test-results/matlab/results.xml @@ -247,6 +248,7 @@ jobs: displayName: Verify test filtered by tag name - bash: | set -e + cat test-results/matlab/selectbyname.xml grep -q StartupTest test-results/matlab/selectbyname.xml grep -v simpleTest test-results/matlab/selectbyname.xml ! grep -q FirstTest test-results/matlab/selectbytag.xml From 4c322bf771d37aeafe94db8fafac6b5af767fb8e Mon Sep 17 00:00:00 2001 From: Vahila <70003902+Vahila@users.noreply.github.com> Date: Fri, 10 Oct 2025 22:28:48 +0530 Subject: [PATCH 14/17] Update file --- integ-test-promote-template.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integ-test-promote-template.yml b/integ-test-promote-template.yml index 221d589d..4ca78e90 100644 --- a/integ-test-promote-template.yml +++ b/integ-test-promote-template.yml @@ -251,7 +251,7 @@ jobs: cat test-results/matlab/selectbyname.xml grep -q StartupTest test-results/matlab/selectbyname.xml grep -v simpleTest test-results/matlab/selectbyname.xml - ! grep -q FirstTest test-results/matlab/selectbytag.xml + ! grep -q FirstTest test-results/matlab/selectbyname.xml displayName: Verify test filtered by name - bash: | echo 'diary console.log' >> startup.m From 35dae19fd513be8a271e3a39b4dd29a111b296de Mon Sep 17 00:00:00 2001 From: Vahila <70003902+Vahila@users.noreply.github.com> Date: Sat, 11 Oct 2025 00:08:13 +0530 Subject: [PATCH 15/17] Update file --- integ-test-promote-template.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/integ-test-promote-template.yml b/integ-test-promote-template.yml index 4ca78e90..bfd9108e 100644 --- a/integ-test-promote-template.yml +++ b/integ-test-promote-template.yml @@ -248,10 +248,8 @@ jobs: displayName: Verify test filtered by tag name - bash: | set -e - cat test-results/matlab/selectbyname.xml grep -q StartupTest test-results/matlab/selectbyname.xml grep -v simpleTest test-results/matlab/selectbyname.xml - ! grep -q FirstTest test-results/matlab/selectbyname.xml displayName: Verify test filtered by name - bash: | echo 'diary console.log' >> startup.m From cc27322b9832098be5dca6216e7cbd1960a6d3a2 Mon Sep 17 00:00:00 2001 From: Vahila <70003902+Vahila@users.noreply.github.com> Date: Sat, 11 Oct 2025 00:45:03 +0530 Subject: [PATCH 16/17] Update file --- tasks/run-matlab-tests/v1/test/scriptgen.test.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/tasks/run-matlab-tests/v1/test/scriptgen.test.ts b/tasks/run-matlab-tests/v1/test/scriptgen.test.ts index 882e15a7..da98e949 100644 --- a/tasks/run-matlab-tests/v1/test/scriptgen.test.ts +++ b/tasks/run-matlab-tests/v1/test/scriptgen.test.ts @@ -24,7 +24,6 @@ export default function suite() { const actual = scriptgen.generateCommand(options); - console.log(actual); assert(actual.includes("genscript('Test'")); assert(actual.includes("'JUnitTestResults',''")); assert(actual.includes("'CoberturaCodeCoverage',''")); @@ -67,7 +66,6 @@ export default function suite() { const actual = scriptgen.generateCommand(options); - console.log(actual); assert(actual.includes("genscript('Test'")); assert(actual.includes("'JUnitTestResults','test-results/results.xml'")); assert(actual.includes("'CoberturaCodeCoverage','code-coverage/coverage.xml'")); From 735107d7d7c6c0529c0a80e4a11abbac68760a0b Mon Sep 17 00:00:00 2001 From: mw-hrastega <48831250+mw-hrastega@users.noreply.github.com> Date: Mon, 13 Oct 2025 11:35:17 -0400 Subject: [PATCH 17/17] Document the `selectByName` input --- overview.md | 1 + 1 file changed, 1 insertion(+) diff --git a/overview.md b/overview.md index 44ea4f32..c98f9955 100644 --- a/overview.md +++ b/overview.md @@ -228,6 +228,7 @@ Input | Description ------------------------- | --------------- `sourceFolder` |

(Optional) Location of the folder containing source code, specified as a path relative to the project root folder. The specified folder and its subfolders are added to the top of the MATLAB search path. If you specify `sourceFolder` and then generate a coverage report, the task uses only the source code in the specified folder and its subfolders to generate the report. You can specify multiple folders using a colon-separated or semicolon-separated list.

**Example:** `sourceFolder: source`
**Example:** `sourceFolder: source/folderA; source/folderB`

`selectByFolder` |

(Optional) Location of the folder used to select test suite elements, specified as a path relative to the project root folder. To create a test suite, the task uses only the tests in the specified folder and its subfolders. You can specify multiple folders using a colon-separated or semicolon-separated list.

**Example:** `selectByFolder: test`
**Example:** `selectByFolder: test/folderA; test/folderB`

+`selectBynName` |

(Optional) Names of the tests to run, specified as a list of test names separated by spaces. If you specify this input, the task runs only the tests with the specified names. You can use the wildcard character (`*`) to match any number of characters and the question mark character (`?`) to match a single character. For example, specify `selectByName: ExampleTest/*` to select all the tests whose name starts with `ExampleTest/`.

For a given test file, the name of a test uniquely identifies the smallest runnable portion of the test content. The test name includes the namespace name, filename (excluding the extension), procedure name, and information about parameterization.

**Example:** `selectByName: ExampleTest/testA`
**Example:** `selectByName: ExampleTest/testA ExampleTest/testB(array=3x3_double)`

`selectByTag` |

(Optional) Test tag used to select test suite elements. To create a test suite, the task uses only the test elements with the specified tag.

**Example:** `selectByTag: Unit`

`strict` |

(Optional) Option to apply strict checks when running tests, specified as `false` or `true`. By default, the value is `false`. If you specify a value of `true`, the task generates a qualification failure whenever a test issues a warning.

**Example:** `strict: true`

`useParallel` |

(Optional) Option to run tests in parallel, specified as `false` or `true`. By default, the value is `false` and tests run in serial. If the test runner configuration is suited for parallelization, you can specify a value of `true` to run tests in parallel. This input requires a Parallel Computing Toolbox license.

**Example:** `useParallel: true`