From 96b217aa42f0c8098097ab9fd1d104d4dddc70c5 Mon Sep 17 00:00:00 2001
From: Vahila <70003902+Vahila@users.noreply.github.com>
Date: Wed, 15 Oct 2025 13:21:11 +0530
Subject: [PATCH 01/33] Add azure parallel startegy example
---
AzureDevOps/DistributeTests.ps1 | 39 ++++++++++++++++++
AzureDevOps/DistributeTests.sh | 35 ++++++++++++++++
AzureDevOps/ParallelStrategy.yml | 69 ++++++++++++++++++++++++++++++++
3 files changed, 143 insertions(+)
create mode 100644 AzureDevOps/DistributeTests.ps1
create mode 100644 AzureDevOps/DistributeTests.sh
create mode 100644 AzureDevOps/ParallelStrategy.yml
diff --git a/AzureDevOps/DistributeTests.ps1 b/AzureDevOps/DistributeTests.ps1
new file mode 100644
index 0000000..202fa68
--- /dev/null
+++ b/AzureDevOps/DistributeTests.ps1
@@ -0,0 +1,39 @@
+#!/usr/bin/env bash
+# Distribute tests across multiple agents for parallel execution (Bash version)
+# Produces MATLAB cell array like:
+# {'/path/to/file1.m','/path/to/file2.m'}
+
+# Find all test files (*.m) under ./tests
+mapfile -t tests < <(find ./tests -type f -name "*.m" | sort)
+
+totalAgents=${CI_TOTAL:-1}
+agentNumber=${CI_INDEX:-1}
+testCount=${#tests[@]}
+
+echo "Total agents: $totalAgents"
+echo "Agent number: $agentNumber"
+echo "Total tests: $testCount"
+
+testsToRun=()
+
+# Slice test files so each agent gets unique tests
+for (( i=agentNumber; i<=testCount; i+=totalAgents )); do
+ file="${tests[i-1]}"
+ testsToRun+=("$file")
+ echo "Added $file"
+done
+
+# Format as MATLAB cell array: {'file1','file2'}
+joined="{"
+for idx in "${!testsToRun[@]}"; do
+ if [[ $idx -gt 0 ]]; then
+ joined+=","
+ fi
+ joined+="'${testsToRun[$idx]}'"
+done
+joined+="}"
+
+echo "Final test file list (MATLAB cell array): $joined"
+
+# Set as Azure Pipelines variable
+echo "##vso[task.setvariable variable=MATLABTestFiles;]$joined"
\ No newline at end of file
diff --git a/AzureDevOps/DistributeTests.sh b/AzureDevOps/DistributeTests.sh
new file mode 100644
index 0000000..8db918e
--- /dev/null
+++ b/AzureDevOps/DistributeTests.sh
@@ -0,0 +1,35 @@
+#!/usr/bin/env bash
+# Distribute tests across multiple agents for parallel execution (Bash version)
+# Produces MATLAB cell array like:
+# {'/path/to/file1.m','/path/to/file2.m'}
+
+# Find all test files (*.m) under ./tests
+mapfile -t tests < <(find ./tests -type f -name "*.m" | sort)
+
+totalAgents=${CI_TOTAL:-1}
+agentNumber=${CI_INDEX:-1}
+testCount=${#tests[@]}
+
+testsToRun=()
+
+# Slice test files so each agent gets unique tests
+for (( i=agentNumber; i<=testCount; i+=totalAgents )); do
+ file="${tests[i-1]}"
+ testsToRun+=("$file")
+ echo "Added $file"
+done
+
+# Format as MATLAB cell array: {'file1','file2'}
+joined="{"
+for idx in "${!testsToRun[@]}"; do
+ if [[ $idx -gt 0 ]]; then
+ joined+=","
+ fi
+ joined+="'${testsToRun[$idx]}'"
+done
+joined+="}"
+
+echo "Final test file list (MATLAB cell array): $joined"
+
+# Set as Azure Pipelines variable
+echo "##vso[task.setvariable variable=MATLABTestFiles;]$joined"
\ No newline at end of file
diff --git a/AzureDevOps/ParallelStrategy.yml b/AzureDevOps/ParallelStrategy.yml
new file mode 100644
index 0000000..09a1cb3
--- /dev/null
+++ b/AzureDevOps/ParallelStrategy.yml
@@ -0,0 +1,69 @@
+jobs:
+ - job: ParallelWindows
+ # Parallel strategy to run tests in parallel
+ strategy:
+ parallel: 2
+ pool:
+ vmImage: windows-latest
+ steps:
+ # Install MATLAB and required products
+ - task: InstallMATLAB@1
+ inputs:
+ release: R2025a
+ products: MATLAB_Test Simulink_Test
+
+ - powershell: .\AzureDevOps\DistributeTests.ps1
+ displayName: 'PowerShell Script to distribute tests'
+
+ - task: RunMATLABTests@1
+ inputs:
+ selectByName: $(MATLABTestFiles)
+ sourceFolder:
+ env:
+ MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
+
+ - job: ParallelLinux
+ # Parallel strategy to run tests in parallel
+ strategy:
+ parallel: 2
+ pool:
+ vmImage: ubuntu-latest
+ steps:
+ # Install MATLAB and required products
+ - task: InstallMATLAB@1
+ inputs:
+ release: R2025a
+ products: MATLAB_Test Simulink_Test
+
+ - bash: chmod +x ./AzureDevOps/DistributeTests.sh && ./AzureDevOps/DistributeTests.sh
+ displayName: 'Bash Script to distribute tests'
+
+ - task: RunMATLABTests@1
+ inputs:
+ selectByName: $(MATLABTestFiles)
+ sourceFolder:
+ env:
+ MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
+
+ - job: ParallelMac
+ # Parallel strategy to run tests in parallel
+ strategy:
+ parallel: 2
+ pool:
+ vmImage: macOS-latest
+ steps:
+ # Install MATLAB and required products
+ - task: InstallMATLAB@1
+ inputs:
+ release: R2025a
+ products: MATLAB_Test Simulink_Test
+
+ - bash: chmod +x ./AzureDevOps/DistributeTests.sh && ./AzureDevOps/DistributeTests.sh
+ displayName: 'Bash Script to distribute tests'
+
+ - task: RunMATLABTests@1
+ inputs:
+ selectByName: $(MATLABTestFiles)
+ sourceFolder:
+ env:
+ MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
\ No newline at end of file
From d2cd614bca2a00d260e483c57f2d786170909027 Mon Sep 17 00:00:00 2001
From: Vahila <70003902+Vahila@users.noreply.github.com>
Date: Wed, 15 Oct 2025 14:50:11 +0530
Subject: [PATCH 02/33] Update file
---
AzureDevOps/DistributeTests.ps1 | 82 +++++++++++++++++---------------
AzureDevOps/ParallelStrategy.yml | 10 ++--
2 files changed, 48 insertions(+), 44 deletions(-)
diff --git a/AzureDevOps/DistributeTests.ps1 b/AzureDevOps/DistributeTests.ps1
index 202fa68..d065296 100644
--- a/AzureDevOps/DistributeTests.ps1
+++ b/AzureDevOps/DistributeTests.ps1
@@ -1,39 +1,43 @@
-#!/usr/bin/env bash
-# Distribute tests across multiple agents for parallel execution (Bash version)
-# Produces MATLAB cell array like:
-# {'/path/to/file1.m','/path/to/file2.m'}
-
-# Find all test files (*.m) under ./tests
-mapfile -t tests < <(find ./tests -type f -name "*.m" | sort)
-
-totalAgents=${CI_TOTAL:-1}
-agentNumber=${CI_INDEX:-1}
-testCount=${#tests[@]}
-
-echo "Total agents: $totalAgents"
-echo "Agent number: $agentNumber"
-echo "Total tests: $testCount"
-
-testsToRun=()
-
-# Slice test files so each agent gets unique tests
-for (( i=agentNumber; i<=testCount; i+=totalAgents )); do
- file="${tests[i-1]}"
- testsToRun+=("$file")
- echo "Added $file"
-done
-
-# Format as MATLAB cell array: {'file1','file2'}
-joined="{"
-for idx in "${!testsToRun[@]}"; do
- if [[ $idx -gt 0 ]]; then
- joined+=","
- fi
- joined+="'${testsToRun[$idx]}'"
-done
-joined+="}"
-
-echo "Final test file list (MATLAB cell array): $joined"
-
-# Set as Azure Pipelines variable
-echo "##vso[task.setvariable variable=MATLABTestFiles;]$joined"
\ No newline at end of file
+<#
+.SYNOPSIS
+ Distribute the tests in VSTS pipeline across multiple agents
+.DESCRIPTION
+ This script slices tests files across multiple agents for faster execution.
+ We search for specific type of file structure (in this example test*), and slice them according to agent number
+ If we encounter multiple files [file1..file10] and if we have 2 agents, agent1 executes tests odd number of files while agent2 executes even number of files
+ For detalied slicing info: https://docs.microsoft.com/en-us/vsts/pipelines/test/parallel-testing-any-test-runner
+ We use JUnit style test results to publish the test reports.
+#>
+
+$tests = Get-ChildItem .\ -Filter "test*" # search for test files with specific pattern.
+$totalAgents = [int]$Env:SYSTEM_TOTALJOBSINPHASE # standard VSTS variables available using parallel execution; total number of parallel jobs running
+$agentNumber = [int]$Env:SYSTEM_JOBPOSITIONINPHASE # current job position
+$testCount = $tests.Count
+
+# below conditions are used if parallel pipeline is not used. i.e. pipeline is running with single agent (no parallel configuration)
+if ($totalAgents -eq 0) {
+ $totalAgents = 1
+}
+if (!$agentNumber -or $agentNumber -eq 0) {
+ $agentNumber = 1
+}
+
+Write-Host "Total agents: $totalAgents"
+Write-Host "Agent number: $agentNumber"
+Write-Host "Total tests: $testCount"
+
+$testsToRun= @()
+
+# slice test files to make sure each agent gets unique test file to execute
+For ($i=$agentNumber; $i -le $testCount;) {
+ $file = $tests[$i-1]
+ $testsToRun = $testsToRun + $file
+ Write-Host "Added $file"
+ $i = $i + $totalAgents
+ }
+
+# join all test files seperated by space. pytest runs multiple test files in following format pytest test1.py test2.py test3.py
+$testFiles = $testsToRun -Join " "
+Write-Host "Test files $testFiles"
+# write these files into variable so that we can run them using pytest in subsequent task.
+Write-Host "##vso[task.setvariable variable=pytestfiles;]$testFiles"
\ No newline at end of file
diff --git a/AzureDevOps/ParallelStrategy.yml b/AzureDevOps/ParallelStrategy.yml
index 09a1cb3..bf845a8 100644
--- a/AzureDevOps/ParallelStrategy.yml
+++ b/AzureDevOps/ParallelStrategy.yml
@@ -12,15 +12,15 @@ jobs:
release: R2025a
products: MATLAB_Test Simulink_Test
- - powershell: .\AzureDevOps\DistributeTests.ps1
+ - powershell: .\AzureDevOps\DistributeTests.ps1
displayName: 'PowerShell Script to distribute tests'
- task: RunMATLABTests@1
inputs:
selectByName: $(MATLABTestFiles)
- sourceFolder:
+ sourceFolder: src
env:
- MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
+ MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
- job: ParallelLinux
# Parallel strategy to run tests in parallel
@@ -41,7 +41,7 @@ jobs:
- task: RunMATLABTests@1
inputs:
selectByName: $(MATLABTestFiles)
- sourceFolder:
+ sourceFolder: src
env:
MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
@@ -64,6 +64,6 @@ jobs:
- task: RunMATLABTests@1
inputs:
selectByName: $(MATLABTestFiles)
- sourceFolder:
+ sourceFolder: src
env:
MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
\ No newline at end of file
From e03c52f47eccb5e7382b9ec0a9710e618d0b7a13 Mon Sep 17 00:00:00 2001
From: Vahila <70003902+Vahila@users.noreply.github.com>
Date: Wed, 15 Oct 2025 17:48:17 +0530
Subject: [PATCH 03/33] Update file
---
AzureDevOps/DistributeTests.ps1 | 2 +-
AzureDevOps/ParallelStrategy.yml | 80 ++++++++++++++++----------------
2 files changed, 41 insertions(+), 41 deletions(-)
diff --git a/AzureDevOps/DistributeTests.ps1 b/AzureDevOps/DistributeTests.ps1
index d065296..eb98535 100644
--- a/AzureDevOps/DistributeTests.ps1
+++ b/AzureDevOps/DistributeTests.ps1
@@ -9,7 +9,7 @@
We use JUnit style test results to publish the test reports.
#>
-$tests = Get-ChildItem .\ -Filter "test*" # search for test files with specific pattern.
+$tests = Get-ChildItem .\tests\ -File # search for test files with specific pattern.
$totalAgents = [int]$Env:SYSTEM_TOTALJOBSINPHASE # standard VSTS variables available using parallel execution; total number of parallel jobs running
$agentNumber = [int]$Env:SYSTEM_JOBPOSITIONINPHASE # current job position
$testCount = $tests.Count
diff --git a/AzureDevOps/ParallelStrategy.yml b/AzureDevOps/ParallelStrategy.yml
index bf845a8..58d254d 100644
--- a/AzureDevOps/ParallelStrategy.yml
+++ b/AzureDevOps/ParallelStrategy.yml
@@ -22,48 +22,48 @@ jobs:
env:
MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
- - job: ParallelLinux
- # Parallel strategy to run tests in parallel
- strategy:
- parallel: 2
- pool:
- vmImage: ubuntu-latest
- steps:
- # Install MATLAB and required products
- - task: InstallMATLAB@1
- inputs:
- release: R2025a
- products: MATLAB_Test Simulink_Test
+ # - job: ParallelLinux
+ # # Parallel strategy to run tests in parallel
+ # strategy:
+ # parallel: 2
+ # pool:
+ # vmImage: ubuntu-latest
+ # steps:
+ # # Install MATLAB and required products
+ # - task: InstallMATLAB@1
+ # inputs:
+ # release: R2025a
+ # products: MATLAB_Test Simulink_Test
- - bash: chmod +x ./AzureDevOps/DistributeTests.sh && ./AzureDevOps/DistributeTests.sh
- displayName: 'Bash Script to distribute tests'
+ # - bash: chmod +x ./AzureDevOps/DistributeTests.sh && ./AzureDevOps/DistributeTests.sh
+ # displayName: 'Bash Script to distribute tests'
- - task: RunMATLABTests@1
- inputs:
- selectByName: $(MATLABTestFiles)
- sourceFolder: src
- env:
- MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
+ # - task: RunMATLABTests@1
+ # inputs:
+ # selectByName: $(MATLABTestFiles)
+ # sourceFolder: src
+ # env:
+ # MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
- - job: ParallelMac
- # Parallel strategy to run tests in parallel
- strategy:
- parallel: 2
- pool:
- vmImage: macOS-latest
- steps:
- # Install MATLAB and required products
- - task: InstallMATLAB@1
- inputs:
- release: R2025a
- products: MATLAB_Test Simulink_Test
+ # - job: ParallelMac
+ # # Parallel strategy to run tests in parallel
+ # strategy:
+ # parallel: 2
+ # pool:
+ # vmImage: macOS-latest
+ # steps:
+ # # Install MATLAB and required products
+ # - task: InstallMATLAB@1
+ # inputs:
+ # release: R2025a
+ # products: MATLAB_Test Simulink_Test
- - bash: chmod +x ./AzureDevOps/DistributeTests.sh && ./AzureDevOps/DistributeTests.sh
- displayName: 'Bash Script to distribute tests'
+ # - bash: chmod +x ./AzureDevOps/DistributeTests.sh && ./AzureDevOps/DistributeTests.sh
+ # displayName: 'Bash Script to distribute tests'
- - task: RunMATLABTests@1
- inputs:
- selectByName: $(MATLABTestFiles)
- sourceFolder: src
- env:
- MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
\ No newline at end of file
+ # - task: RunMATLABTests@1
+ # inputs:
+ # selectByName: $(MATLABTestFiles)
+ # sourceFolder: src
+ # env:
+ # MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
\ No newline at end of file
From 982dd65a8d7a84dada77c00b23e337b5d16b2b86 Mon Sep 17 00:00:00 2001
From: Vahila <70003902+Vahila@users.noreply.github.com>
Date: Wed, 15 Oct 2025 18:22:09 +0530
Subject: [PATCH 04/33] Update file
---
AzureDevOps/DistributeTests.sh | 35 +++++++++++++++++++---------------
1 file changed, 20 insertions(+), 15 deletions(-)
diff --git a/AzureDevOps/DistributeTests.sh b/AzureDevOps/DistributeTests.sh
index 8db918e..5a977ef 100644
--- a/AzureDevOps/DistributeTests.sh
+++ b/AzureDevOps/DistributeTests.sh
@@ -6,30 +6,35 @@
# Find all test files (*.m) under ./tests
mapfile -t tests < <(find ./tests -type f -name "*.m" | sort)
-totalAgents=${CI_TOTAL:-1}
-agentNumber=${CI_INDEX:-1}
+# Use Azure DevOps variables if available, else default to 1
+totalAgents=${SYSTEM_TOTALJOBSINPHASE:-1}
+agentNumber=${SYSTEM_JOBPOSITIONINPHASE:-1}
testCount=${#tests[@]}
+# If not set or zero, default to 1
+if [[ -z "$totalAgents" || "$totalAgents" -eq 0 ]]; then
+ totalAgents=1
+fi
+if [[ -z "$agentNumber" || "$agentNumber" -eq 0 ]]; then
+ agentNumber=1
+fi
+
+echo "Total agents: $totalAgents"
+echo "Agent number: $agentNumber"
+echo "Total tests: $testCount"
+
testsToRun=()
-# Slice test files so each agent gets unique tests
+# Slice test files so each agent gets unique files (1-based index)
for (( i=agentNumber; i<=testCount; i+=totalAgents )); do
file="${tests[i-1]}"
testsToRun+=("$file")
echo "Added $file"
done
-# Format as MATLAB cell array: {'file1','file2'}
-joined="{"
-for idx in "${!testsToRun[@]}"; do
- if [[ $idx -gt 0 ]]; then
- joined+=","
- fi
- joined+="'${testsToRun[$idx]}'"
-done
-joined+="}"
-
-echo "Final test file list (MATLAB cell array): $joined"
+# Join all test files separated by space
+testFiles="${testsToRun[*]}"
+echo "Test files $testFiles"
# Set as Azure Pipelines variable
-echo "##vso[task.setvariable variable=MATLABTestFiles;]$joined"
\ No newline at end of file
+echo "##vso[task.setvariable variable=pytestfiles;]$testFiles"
\ No newline at end of file
From 91fd6791e54134a592a692269c71a53b6a738515 Mon Sep 17 00:00:00 2001
From: Vahila <70003902+Vahila@users.noreply.github.com>
Date: Wed, 15 Oct 2025 18:22:43 +0530
Subject: [PATCH 05/33] Update file
---
AzureDevOps/ParallelStrategy.yml | 96 ++++++++++++++++----------------
1 file changed, 48 insertions(+), 48 deletions(-)
diff --git a/AzureDevOps/ParallelStrategy.yml b/AzureDevOps/ParallelStrategy.yml
index 58d254d..feb8392 100644
--- a/AzureDevOps/ParallelStrategy.yml
+++ b/AzureDevOps/ParallelStrategy.yml
@@ -1,33 +1,10 @@
jobs:
- - job: ParallelWindows
- # Parallel strategy to run tests in parallel
- strategy:
- parallel: 2
- pool:
- vmImage: windows-latest
- steps:
- # Install MATLAB and required products
- - task: InstallMATLAB@1
- inputs:
- release: R2025a
- products: MATLAB_Test Simulink_Test
-
- - powershell: .\AzureDevOps\DistributeTests.ps1
- displayName: 'PowerShell Script to distribute tests'
-
- - task: RunMATLABTests@1
- inputs:
- selectByName: $(MATLABTestFiles)
- sourceFolder: src
- env:
- MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
-
- # - job: ParallelLinux
+ # - job: ParallelWindows
# # Parallel strategy to run tests in parallel
# strategy:
# parallel: 2
# pool:
- # vmImage: ubuntu-latest
+ # vmImage: windows-latest
# steps:
# # Install MATLAB and required products
# - task: InstallMATLAB@1
@@ -35,35 +12,58 @@ jobs:
# release: R2025a
# products: MATLAB_Test Simulink_Test
- # - bash: chmod +x ./AzureDevOps/DistributeTests.sh && ./AzureDevOps/DistributeTests.sh
- # displayName: 'Bash Script to distribute tests'
+ # - powershell: .\AzureDevOps\DistributeTests.ps1
+ # displayName: 'PowerShell Script to distribute tests'
# - task: RunMATLABTests@1
# inputs:
# selectByName: $(MATLABTestFiles)
# sourceFolder: src
# env:
- # MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
+ # MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
- # - job: ParallelMac
- # # Parallel strategy to run tests in parallel
- # strategy:
- # parallel: 2
- # pool:
- # vmImage: macOS-latest
- # steps:
- # # Install MATLAB and required products
- # - task: InstallMATLAB@1
- # inputs:
- # release: R2025a
- # products: MATLAB_Test Simulink_Test
+ - job: ParallelLinux
+ # Parallel strategy to run tests in parallel
+ strategy:
+ parallel: 2
+ pool:
+ vmImage: ubuntu-latest
+ steps:
+ # Install MATLAB and required products
+ - task: InstallMATLAB@1
+ inputs:
+ release: R2025a
+ products: MATLAB_Test Simulink_Test
- # - bash: chmod +x ./AzureDevOps/DistributeTests.sh && ./AzureDevOps/DistributeTests.sh
- # displayName: 'Bash Script to distribute tests'
+ - bash: chmod +x ./AzureDevOps/DistributeTests.sh && ./AzureDevOps/DistributeTests.sh
+ displayName: 'Bash Script to distribute tests'
- # - task: RunMATLABTests@1
- # inputs:
- # selectByName: $(MATLABTestFiles)
- # sourceFolder: src
- # env:
- # MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
\ No newline at end of file
+ - task: RunMATLABTests@1
+ inputs:
+ selectByName: $(MATLABTestFiles)
+ sourceFolder: src
+ env:
+ MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
+
+ - job: ParallelMac
+ # Parallel strategy to run tests in parallel
+ strategy:
+ parallel: 2
+ pool:
+ vmImage: macOS-latest
+ steps:
+ # Install MATLAB and required products
+ - task: InstallMATLAB@1
+ inputs:
+ release: R2025a
+ products: MATLAB_Test Simulink_Test
+
+ - bash: chmod +x ./AzureDevOps/DistributeTests.sh && ./AzureDevOps/DistributeTests.sh
+ displayName: 'Bash Script to distribute tests'
+
+ - task: RunMATLABTests@1
+ inputs:
+ selectByName: $(MATLABTestFiles)
+ sourceFolder: src
+ env:
+ MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
\ No newline at end of file
From 76eeb0c8c34d0946c4e46872074e825c22b86d5b Mon Sep 17 00:00:00 2001
From: Vahila <70003902+Vahila@users.noreply.github.com>
Date: Wed, 15 Oct 2025 18:35:43 +0530
Subject: [PATCH 06/33] Update file
---
AzureDevOps/DistributeTests.sh | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/AzureDevOps/DistributeTests.sh b/AzureDevOps/DistributeTests.sh
index 5a977ef..26faa1c 100644
--- a/AzureDevOps/DistributeTests.sh
+++ b/AzureDevOps/DistributeTests.sh
@@ -4,7 +4,11 @@
# {'/path/to/file1.m','/path/to/file2.m'}
# Find all test files (*.m) under ./tests
-mapfile -t tests < <(find ./tests -type f -name "*.m" | sort)
+# mapfile -t tests < <(find ./tests -type f -name "*.m" | sort) mapfile doesnt work on macOS bash 3.2
+tests=()
+while IFS= read -r file; do
+ tests+=("$file")
+done < <(find ./tests -type f -name "*.m" | sort)
# Use Azure DevOps variables if available, else default to 1
totalAgents=${SYSTEM_TOTALJOBSINPHASE:-1}
From 92bc54fd793d2fcb9087a2f2221475ef17c99b5b Mon Sep 17 00:00:00 2001
From: Vahila <70003902+Vahila@users.noreply.github.com>
Date: Wed, 15 Oct 2025 18:36:02 +0530
Subject: [PATCH 07/33] Update file
---
AzureDevOps/ParallelStrategy.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/AzureDevOps/ParallelStrategy.yml b/AzureDevOps/ParallelStrategy.yml
index feb8392..2dcbe6d 100644
--- a/AzureDevOps/ParallelStrategy.yml
+++ b/AzureDevOps/ParallelStrategy.yml
@@ -33,7 +33,7 @@ jobs:
- task: InstallMATLAB@1
inputs:
release: R2025a
- products: MATLAB_Test Simulink_Test
+ # products: MATLAB_Test Simulink_Test
- bash: chmod +x ./AzureDevOps/DistributeTests.sh && ./AzureDevOps/DistributeTests.sh
displayName: 'Bash Script to distribute tests'
From 1f07238eebd7cd04925b64cc6b383ad6fba61a98 Mon Sep 17 00:00:00 2001
From: Vahila <70003902+Vahila@users.noreply.github.com>
Date: Thu, 23 Oct 2025 13:02:37 +0530
Subject: [PATCH 08/33] Update file
---
AzureDevOps/ParallelStrategy.yml | 40 ++++++++++++++++----------------
1 file changed, 20 insertions(+), 20 deletions(-)
diff --git a/AzureDevOps/ParallelStrategy.yml b/AzureDevOps/ParallelStrategy.yml
index 2dcbe6d..893fd9a 100644
--- a/AzureDevOps/ParallelStrategy.yml
+++ b/AzureDevOps/ParallelStrategy.yml
@@ -1,26 +1,26 @@
jobs:
- # - job: ParallelWindows
- # # Parallel strategy to run tests in parallel
- # strategy:
- # parallel: 2
- # pool:
- # vmImage: windows-latest
- # steps:
- # # Install MATLAB and required products
- # - task: InstallMATLAB@1
- # inputs:
- # release: R2025a
- # products: MATLAB_Test Simulink_Test
+ - job: ParallelWindows
+ # Parallel strategy to run tests in parallel
+ strategy:
+ parallel: 2
+ pool:
+ vmImage: windows-latest
+ steps:
+ # Install MATLAB and required products
+ - task: InstallMATLAB@1
+ inputs:
+ release: R2025a
+ products: MATLAB_Test Simulink_Test
- # - powershell: .\AzureDevOps\DistributeTests.ps1
- # displayName: 'PowerShell Script to distribute tests'
+ - powershell: .\AzureDevOps\DistributeTests.ps1
+ displayName: 'PowerShell Script to distribute tests'
- # - task: RunMATLABTests@1
- # inputs:
- # selectByName: $(MATLABTestFiles)
- # sourceFolder: src
- # env:
- # MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
+ - task: RunMATLABTests@1
+ inputs:
+ selectByName: $(MATLABTestFiles)
+ sourceFolder: src
+ env:
+ MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
- job: ParallelLinux
# Parallel strategy to run tests in parallel
From b1c0c8eb4c2be36d1e2cd436b1893165a7eb55c2 Mon Sep 17 00:00:00 2001
From: Vahila <70003902+Vahila@users.noreply.github.com>
Date: Tue, 4 Nov 2025 18:06:15 +0530
Subject: [PATCH 09/33] Update file
---
AzureDevOps/ParallelStrategy.yml | 89 +++++++++++++++++---------------
1 file changed, 48 insertions(+), 41 deletions(-)
diff --git a/AzureDevOps/ParallelStrategy.yml b/AzureDevOps/ParallelStrategy.yml
index 893fd9a..6804e8c 100644
--- a/AzureDevOps/ParallelStrategy.yml
+++ b/AzureDevOps/ParallelStrategy.yml
@@ -1,26 +1,26 @@
jobs:
- - job: ParallelWindows
- # Parallel strategy to run tests in parallel
- strategy:
- parallel: 2
- pool:
- vmImage: windows-latest
- steps:
- # Install MATLAB and required products
- - task: InstallMATLAB@1
- inputs:
- release: R2025a
- products: MATLAB_Test Simulink_Test
+ # - job: ParallelWindows
+ # # Parallel strategy to run tests in parallel
+ # strategy:
+ # parallel: 2
+ # pool:
+ # vmImage: windows-latest
+ # steps:
+ # # Install MATLAB and required products
+ # - task: InstallMATLAB@1
+ # inputs:
+ # release: R2025a
+ # products: MATLAB_Test Simulink_Test
- - powershell: .\AzureDevOps\DistributeTests.ps1
- displayName: 'PowerShell Script to distribute tests'
+ # - powershell: .\AzureDevOps\DistributeTests.ps1
+ # displayName: 'PowerShell Script to distribute tests'
- - task: RunMATLABTests@1
- inputs:
- selectByName: $(MATLABTestFiles)
- sourceFolder: src
- env:
- MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
+ # - task: RunMATLABTests@1
+ # inputs:
+ # selectByName: $(MATLABTestFiles)
+ # sourceFolder: src
+ # env:
+ # MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
- job: ParallelLinux
# Parallel strategy to run tests in parallel
@@ -33,11 +33,18 @@ jobs:
- task: InstallMATLAB@1
inputs:
release: R2025a
- # products: MATLAB_Test Simulink_Test
+ products: MATLAB_Test Simulink_Test
- bash: chmod +x ./AzureDevOps/DistributeTests.sh && ./AzureDevOps/DistributeTests.sh
displayName: 'Bash Script to distribute tests'
+ # Builds Python package from MATLAB function and verifies functionality through equivalence tests
+ - task: RunMATLABBuild@1
+ inputs:
+ tasks: equivalenceTest
+ env:
+ MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
+
- task: RunMATLABTests@1
inputs:
selectByName: $(MATLABTestFiles)
@@ -45,25 +52,25 @@ jobs:
env:
MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
- - job: ParallelMac
- # Parallel strategy to run tests in parallel
- strategy:
- parallel: 2
- pool:
- vmImage: macOS-latest
- steps:
- # Install MATLAB and required products
- - task: InstallMATLAB@1
- inputs:
- release: R2025a
- products: MATLAB_Test Simulink_Test
+ # - job: ParallelMac
+ # # Parallel strategy to run tests in parallel
+ # strategy:
+ # parallel: 2
+ # pool:
+ # vmImage: macOS-latest
+ # steps:
+ # # Install MATLAB and required products
+ # - task: InstallMATLAB@1
+ # inputs:
+ # release: R2025a
+ # products: MATLAB_Test Simulink_Test
- - bash: chmod +x ./AzureDevOps/DistributeTests.sh && ./AzureDevOps/DistributeTests.sh
- displayName: 'Bash Script to distribute tests'
+ # - bash: chmod +x ./AzureDevOps/DistributeTests.sh && ./AzureDevOps/DistributeTests.sh
+ # displayName: 'Bash Script to distribute tests'
- - task: RunMATLABTests@1
- inputs:
- selectByName: $(MATLABTestFiles)
- sourceFolder: src
- env:
- MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
\ No newline at end of file
+ # - task: RunMATLABTests@1
+ # inputs:
+ # selectByName: $(MATLABTestFiles)
+ # sourceFolder: src
+ # env:
+ # MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
\ No newline at end of file
From 02db0b30cd82d9cd6c9db1029c5f42818f8710db Mon Sep 17 00:00:00 2001
From: Vahila <70003902+Vahila@users.noreply.github.com>
Date: Tue, 4 Nov 2025 20:51:06 +0530
Subject: [PATCH 10/33] Update file
---
AzureDevOps/ParallelStrategy.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/AzureDevOps/ParallelStrategy.yml b/AzureDevOps/ParallelStrategy.yml
index 6804e8c..65bdafa 100644
--- a/AzureDevOps/ParallelStrategy.yml
+++ b/AzureDevOps/ParallelStrategy.yml
@@ -33,7 +33,7 @@ jobs:
- task: InstallMATLAB@1
inputs:
release: R2025a
- products: MATLAB_Test Simulink_Test
+ products: MATLAB_Compiler_SDK MATLAB_Test
- bash: chmod +x ./AzureDevOps/DistributeTests.sh && ./AzureDevOps/DistributeTests.sh
displayName: 'Bash Script to distribute tests'
From 12b8bec29bbceb1ad29a65db4c7a7430a5f025a0 Mon Sep 17 00:00:00 2001
From: Vahila <70003902+Vahila@users.noreply.github.com>
Date: Thu, 13 Nov 2025 09:40:42 +0530
Subject: [PATCH 11/33] Update file
---
AzureDevOps/ParallelStrategy.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/AzureDevOps/ParallelStrategy.yml b/AzureDevOps/ParallelStrategy.yml
index 65bdafa..8237c09 100644
--- a/AzureDevOps/ParallelStrategy.yml
+++ b/AzureDevOps/ParallelStrategy.yml
@@ -33,7 +33,7 @@ jobs:
- task: InstallMATLAB@1
inputs:
release: R2025a
- products: MATLAB_Compiler_SDK MATLAB_Test
+ products: MATLAB_Test
- bash: chmod +x ./AzureDevOps/DistributeTests.sh && ./AzureDevOps/DistributeTests.sh
displayName: 'Bash Script to distribute tests'
From 956ab1e965926f8a8fa9fa7fe0a2b28438dde86e Mon Sep 17 00:00:00 2001
From: Vahila <70003902+Vahila@users.noreply.github.com>
Date: Thu, 13 Nov 2025 09:53:39 +0530
Subject: [PATCH 12/33] Update file
---
AzureDevOps/ParallelStrategy.yml | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/AzureDevOps/ParallelStrategy.yml b/AzureDevOps/ParallelStrategy.yml
index 8237c09..866ded6 100644
--- a/AzureDevOps/ParallelStrategy.yml
+++ b/AzureDevOps/ParallelStrategy.yml
@@ -39,18 +39,18 @@ jobs:
displayName: 'Bash Script to distribute tests'
# Builds Python package from MATLAB function and verifies functionality through equivalence tests
- - task: RunMATLABBuild@1
- inputs:
- tasks: equivalenceTest
- env:
- MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
+ # - task: RunMATLABBuild@1
+ # inputs:
+ # tasks: equivalenceTest
+ # env:
+ # MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
- task: RunMATLABTests@1
inputs:
selectByName: $(MATLABTestFiles)
sourceFolder: src
- env:
- MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
+ # env:
+ # MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
# - job: ParallelMac
# # Parallel strategy to run tests in parallel
From 2e6d8ca67e442952e5f2a7d4b410412500f565d2 Mon Sep 17 00:00:00 2001
From: Vahila <70003902+Vahila@users.noreply.github.com>
Date: Thu, 13 Nov 2025 10:00:00 +0530
Subject: [PATCH 13/33] Update file
---
AzureDevOps/DistributeTests.ps1 | 2 +-
AzureDevOps/DistributeTests.sh | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/AzureDevOps/DistributeTests.ps1 b/AzureDevOps/DistributeTests.ps1
index eb98535..e8cf970 100644
--- a/AzureDevOps/DistributeTests.ps1
+++ b/AzureDevOps/DistributeTests.ps1
@@ -40,4 +40,4 @@ For ($i=$agentNumber; $i -le $testCount;) {
$testFiles = $testsToRun -Join " "
Write-Host "Test files $testFiles"
# write these files into variable so that we can run them using pytest in subsequent task.
-Write-Host "##vso[task.setvariable variable=pytestfiles;]$testFiles"
\ No newline at end of file
+Write-Host "##vso[task.setvariable variable=MATLABTestFiles;]$testFiles"
\ No newline at end of file
diff --git a/AzureDevOps/DistributeTests.sh b/AzureDevOps/DistributeTests.sh
index 26faa1c..dd0ed5e 100644
--- a/AzureDevOps/DistributeTests.sh
+++ b/AzureDevOps/DistributeTests.sh
@@ -41,4 +41,4 @@ testFiles="${testsToRun[*]}"
echo "Test files $testFiles"
# Set as Azure Pipelines variable
-echo "##vso[task.setvariable variable=pytestfiles;]$testFiles"
\ No newline at end of file
+echo "##vso[task.setvariable variable=MATLABTestFiles;]$testFiles"
\ No newline at end of file
From fc5d5a7078271879aef99dca782281f169a8f78e Mon Sep 17 00:00:00 2001
From: Vahila <70003902+Vahila@users.noreply.github.com>
Date: Thu, 13 Nov 2025 10:22:58 +0530
Subject: [PATCH 14/33] Update file
---
AzureDevOps/DistributeTests.sh | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/AzureDevOps/DistributeTests.sh b/AzureDevOps/DistributeTests.sh
index dd0ed5e..82d7521 100644
--- a/AzureDevOps/DistributeTests.sh
+++ b/AzureDevOps/DistributeTests.sh
@@ -32,8 +32,10 @@ testsToRun=()
# Slice test files so each agent gets unique files (1-based index)
for (( i=agentNumber; i<=testCount; i+=totalAgents )); do
file="${tests[i-1]}"
- testsToRun+=("$file")
- echo "Added $file"
+
+ fileName=$(basename "$file" .m)
+ testsToRun+=("${fileName}/*")
+ echo "Added $fileName"
done
# Join all test files separated by space
From 9385b687b8a5ed3fc67de29be58e735ace968615 Mon Sep 17 00:00:00 2001
From: Vahila <70003902+Vahila@users.noreply.github.com>
Date: Thu, 13 Nov 2025 10:30:10 +0530
Subject: [PATCH 15/33] Update file
---
AzureDevOps/ParallelStrategy.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/AzureDevOps/ParallelStrategy.yml b/AzureDevOps/ParallelStrategy.yml
index 866ded6..eba1baa 100644
--- a/AzureDevOps/ParallelStrategy.yml
+++ b/AzureDevOps/ParallelStrategy.yml
@@ -48,7 +48,7 @@ jobs:
- task: RunMATLABTests@1
inputs:
selectByName: $(MATLABTestFiles)
- sourceFolder: src
+ # sourceFolder: src
# env:
# MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
From 085e078a3972e1033f16f2728fd435dafd5dab55 Mon Sep 17 00:00:00 2001
From: Vahila <70003902+Vahila@users.noreply.github.com>
Date: Thu, 13 Nov 2025 14:02:07 +0530
Subject: [PATCH 16/33] Update file
---
AzureDevOps/ParallelStrategy.yml | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/AzureDevOps/ParallelStrategy.yml b/AzureDevOps/ParallelStrategy.yml
index eba1baa..aed3105 100644
--- a/AzureDevOps/ParallelStrategy.yml
+++ b/AzureDevOps/ParallelStrategy.yml
@@ -33,17 +33,17 @@ jobs:
- task: InstallMATLAB@1
inputs:
release: R2025a
- products: MATLAB_Test
+ products: MATLAB_Compiler_SDK MATLAB_Test
- bash: chmod +x ./AzureDevOps/DistributeTests.sh && ./AzureDevOps/DistributeTests.sh
displayName: 'Bash Script to distribute tests'
# Builds Python package from MATLAB function and verifies functionality through equivalence tests
- # - task: RunMATLABBuild@1
- # inputs:
- # tasks: equivalenceTest
- # env:
- # MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
+ - task: RunMATLABBuild@1
+ inputs:
+ tasks: equivalenceTest
+ env:
+ MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
- task: RunMATLABTests@1
inputs:
From 3097975b81a3a5a2d0d29303cb587820ac0d5cb2 Mon Sep 17 00:00:00 2001
From: Vahila <70003902+Vahila@users.noreply.github.com>
Date: Thu, 13 Nov 2025 14:55:47 +0530
Subject: [PATCH 17/33] Update file
---
AzureDevOps/ParallelStrategy.yml | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/AzureDevOps/ParallelStrategy.yml b/AzureDevOps/ParallelStrategy.yml
index aed3105..65bdafa 100644
--- a/AzureDevOps/ParallelStrategy.yml
+++ b/AzureDevOps/ParallelStrategy.yml
@@ -48,9 +48,9 @@ jobs:
- task: RunMATLABTests@1
inputs:
selectByName: $(MATLABTestFiles)
- # sourceFolder: src
- # env:
- # MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
+ sourceFolder: src
+ env:
+ MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
# - job: ParallelMac
# # Parallel strategy to run tests in parallel
From 4758771a4d296c6ed7d03287db3dbe2c52c378d6 Mon Sep 17 00:00:00 2001
From: Vahila <70003902+Vahila@users.noreply.github.com>
Date: Thu, 13 Nov 2025 15:03:32 +0530
Subject: [PATCH 18/33] Update file
---
AzureDevOps/DistributeTests.ps1 | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/AzureDevOps/DistributeTests.ps1 b/AzureDevOps/DistributeTests.ps1
index e8cf970..9d89d11 100644
--- a/AzureDevOps/DistributeTests.ps1
+++ b/AzureDevOps/DistributeTests.ps1
@@ -31,7 +31,9 @@ $testsToRun= @()
# slice test files to make sure each agent gets unique test file to execute
For ($i=$agentNumber; $i -le $testCount;) {
$file = $tests[$i-1]
- $testsToRun = $testsToRun + $file
+
+ $fileName = [System.IO.Path]::GetFileNameWithoutExtension($file.Name)
+ $testsToRun += "$base/*"
Write-Host "Added $file"
$i = $i + $totalAgents
}
From 45ef02bb85159028f7315501a1c0b0ba1e2e42b0 Mon Sep 17 00:00:00 2001
From: Vahila <70003902+Vahila@users.noreply.github.com>
Date: Thu, 13 Nov 2025 15:05:15 +0530
Subject: [PATCH 19/33] Update file
---
AzureDevOps/ParallelStrategy.yml | 91 ++++++++++++++++++--------------
1 file changed, 50 insertions(+), 41 deletions(-)
diff --git a/AzureDevOps/ParallelStrategy.yml b/AzureDevOps/ParallelStrategy.yml
index 65bdafa..e561c10 100644
--- a/AzureDevOps/ParallelStrategy.yml
+++ b/AzureDevOps/ParallelStrategy.yml
@@ -1,26 +1,31 @@
jobs:
- # - job: ParallelWindows
- # # Parallel strategy to run tests in parallel
- # strategy:
- # parallel: 2
- # pool:
- # vmImage: windows-latest
- # steps:
- # # Install MATLAB and required products
- # - task: InstallMATLAB@1
- # inputs:
- # release: R2025a
- # products: MATLAB_Test Simulink_Test
+ - job: ParallelWindows
+ # Parallel strategy to run tests in parallel
+ strategy:
+ parallel: 2
+ pool:
+ vmImage: windows-latest
+ steps:
+ # Install MATLAB and required products
+ - task: InstallMATLAB@1
+ inputs:
+ products: MATLAB_Compiler_SDK MATLAB_Test
- # - powershell: .\AzureDevOps\DistributeTests.ps1
- # displayName: 'PowerShell Script to distribute tests'
+ - powershell: .\AzureDevOps\DistributeTests.ps1
+ displayName: 'PowerShell Script to distribute tests'
- # - task: RunMATLABTests@1
- # inputs:
- # selectByName: $(MATLABTestFiles)
- # sourceFolder: src
- # env:
- # MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
+ - task: RunMATLABBuild@1
+ inputs:
+ tasks: equivalenceTest
+ env:
+ MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
+
+ - task: RunMATLABTests@1
+ inputs:
+ selectByName: $(MATLABTestFiles)
+ sourceFolder: src
+ env:
+ MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
- job: ParallelLinux
# Parallel strategy to run tests in parallel
@@ -32,7 +37,6 @@ jobs:
# Install MATLAB and required products
- task: InstallMATLAB@1
inputs:
- release: R2025a
products: MATLAB_Compiler_SDK MATLAB_Test
- bash: chmod +x ./AzureDevOps/DistributeTests.sh && ./AzureDevOps/DistributeTests.sh
@@ -52,25 +56,30 @@ jobs:
env:
MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
- # - job: ParallelMac
- # # Parallel strategy to run tests in parallel
- # strategy:
- # parallel: 2
- # pool:
- # vmImage: macOS-latest
- # steps:
- # # Install MATLAB and required products
- # - task: InstallMATLAB@1
- # inputs:
- # release: R2025a
- # products: MATLAB_Test Simulink_Test
+ - job: ParallelMac
+ # Parallel strategy to run tests in parallel
+ strategy:
+ parallel: 2
+ pool:
+ vmImage: macOS-latest
+ steps:
+ # Install MATLAB and required products
+ - task: InstallMATLAB@1
+ inputs:
+ products: MATLAB_Compiler_SDK MATLAB_Test
- # - bash: chmod +x ./AzureDevOps/DistributeTests.sh && ./AzureDevOps/DistributeTests.sh
- # displayName: 'Bash Script to distribute tests'
+ - bash: chmod +x ./AzureDevOps/DistributeTests.sh && ./AzureDevOps/DistributeTests.sh
+ displayName: 'Bash Script to distribute tests'
- # - task: RunMATLABTests@1
- # inputs:
- # selectByName: $(MATLABTestFiles)
- # sourceFolder: src
- # env:
- # MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
\ No newline at end of file
+ - task: RunMATLABBuild@1
+ inputs:
+ tasks: equivalenceTest
+ env:
+ MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
+
+ - task: RunMATLABTests@1
+ inputs:
+ selectByName: $(MATLABTestFiles)
+ sourceFolder: src
+ env:
+ MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
\ No newline at end of file
From 69d39c2669b06b11ff40e8b2e870d2955bb06346 Mon Sep 17 00:00:00 2001
From: Vahila <70003902+Vahila@users.noreply.github.com>
Date: Thu, 13 Nov 2025 15:18:32 +0530
Subject: [PATCH 20/33] Update file
---
AzureDevOps/ParallelStrategy.yml | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/AzureDevOps/ParallelStrategy.yml b/AzureDevOps/ParallelStrategy.yml
index e561c10..6ca1f9c 100644
--- a/AzureDevOps/ParallelStrategy.yml
+++ b/AzureDevOps/ParallelStrategy.yml
@@ -9,10 +9,7 @@ jobs:
# Install MATLAB and required products
- task: InstallMATLAB@1
inputs:
- products: MATLAB_Compiler_SDK MATLAB_Test
-
- - powershell: .\AzureDevOps\DistributeTests.ps1
- displayName: 'PowerShell Script to distribute tests'
+ products: MATLAB_Compiler_SDK MATLAB_Test
- task: RunMATLABBuild@1
inputs:
@@ -20,6 +17,9 @@ jobs:
env:
MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
+ - powershell: .\AzureDevOps\DistributeTests.ps1
+ displayName: 'PowerShell Script to distribute tests'
+
- task: RunMATLABTests@1
inputs:
selectByName: $(MATLABTestFiles)
@@ -39,9 +39,6 @@ jobs:
inputs:
products: MATLAB_Compiler_SDK MATLAB_Test
- - bash: chmod +x ./AzureDevOps/DistributeTests.sh && ./AzureDevOps/DistributeTests.sh
- displayName: 'Bash Script to distribute tests'
-
# Builds Python package from MATLAB function and verifies functionality through equivalence tests
- task: RunMATLABBuild@1
inputs:
@@ -49,6 +46,9 @@ jobs:
env:
MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
+ - bash: chmod +x ./AzureDevOps/DistributeTests.sh && ./AzureDevOps/DistributeTests.sh
+ displayName: 'Bash Script to distribute tests'
+
- task: RunMATLABTests@1
inputs:
selectByName: $(MATLABTestFiles)
@@ -68,15 +68,15 @@ jobs:
inputs:
products: MATLAB_Compiler_SDK MATLAB_Test
- - bash: chmod +x ./AzureDevOps/DistributeTests.sh && ./AzureDevOps/DistributeTests.sh
- displayName: 'Bash Script to distribute tests'
-
- task: RunMATLABBuild@1
inputs:
tasks: equivalenceTest
env:
MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
+ - bash: chmod +x ./AzureDevOps/DistributeTests.sh && ./AzureDevOps/DistributeTests.sh
+ displayName: 'Bash Script to distribute tests'
+
- task: RunMATLABTests@1
inputs:
selectByName: $(MATLABTestFiles)
From 8258dbcf947848a37b99295a7f7b7e6f1b2be7c6 Mon Sep 17 00:00:00 2001
From: Vahila <70003902+Vahila@users.noreply.github.com>
Date: Thu, 13 Nov 2025 15:27:32 +0530
Subject: [PATCH 21/33] Update file
---
AzureDevOps/DistributeTests.ps1 | 3 +--
AzureDevOps/DistributeTests.sh | 30 ++++++++++++++++++------------
2 files changed, 19 insertions(+), 14 deletions(-)
diff --git a/AzureDevOps/DistributeTests.ps1 b/AzureDevOps/DistributeTests.ps1
index 9d89d11..cc5977c 100644
--- a/AzureDevOps/DistributeTests.ps1
+++ b/AzureDevOps/DistributeTests.ps1
@@ -6,7 +6,6 @@
We search for specific type of file structure (in this example test*), and slice them according to agent number
If we encounter multiple files [file1..file10] and if we have 2 agents, agent1 executes tests odd number of files while agent2 executes even number of files
For detalied slicing info: https://docs.microsoft.com/en-us/vsts/pipelines/test/parallel-testing-any-test-runner
- We use JUnit style test results to publish the test reports.
#>
$tests = Get-ChildItem .\tests\ -File # search for test files with specific pattern.
@@ -38,7 +37,7 @@ For ($i=$agentNumber; $i -le $testCount;) {
$i = $i + $totalAgents
}
-# join all test files seperated by space. pytest runs multiple test files in following format pytest test1.py test2.py test3.py
+# join all test files seperated by space.
$testFiles = $testsToRun -Join " "
Write-Host "Test files $testFiles"
# write these files into variable so that we can run them using pytest in subsequent task.
diff --git a/AzureDevOps/DistributeTests.sh b/AzureDevOps/DistributeTests.sh
index 82d7521..00876ce 100644
--- a/AzureDevOps/DistributeTests.sh
+++ b/AzureDevOps/DistributeTests.sh
@@ -1,25 +1,31 @@
-#!/usr/bin/env bash
-# Distribute tests across multiple agents for parallel execution (Bash version)
-# Produces MATLAB cell array like:
-# {'/path/to/file1.m','/path/to/file2.m'}
+#!/bin/bash
+#===============================================================================
+#
+# FILE: distribute_tests.sh
+#
+# USAGE: ./distribute_tests.sh
+#
+# DESCRIPTION: This script slices tests files across multiple agents for faster execution.
+# We search for specific type of file structure (in this example test*), and slice them according to agent number
+# If we encounter multiple files [file1..file10] and if we have 2 agents, agent1 executes tests odd number of files while agent2 executes even number of files
+#
+#===============================================================================
-# Find all test files (*.m) under ./tests
-# mapfile -t tests < <(find ./tests -type f -name "*.m" | sort) mapfile doesnt work on macOS bash 3.2
tests=()
while IFS= read -r file; do
tests+=("$file")
done < <(find ./tests -type f -name "*.m" | sort)
-# Use Azure DevOps variables if available, else default to 1
-totalAgents=${SYSTEM_TOTALJOBSINPHASE:-1}
-agentNumber=${SYSTEM_JOBPOSITIONINPHASE:-1}
+# Use Azure DevOps variables
+totalAgents=${SYSTEM_TOTALJOBSINPHASE}
+agentNumber=${SYSTEM_JOBPOSITIONINPHASE}
testCount=${#tests[@]}
-# If not set or zero, default to 1
-if [[ -z "$totalAgents" || "$totalAgents" -eq 0 ]]; then
+if [ $totalAgents -eq 0 ]; then
totalAgents=1
fi
-if [[ -z "$agentNumber" || "$agentNumber" -eq 0 ]]; then
+# below conditions are used if parallel pipeline is not used. i.e. pipeline is running with single agent (no parallel configuration)
+if [ -z $agentNumber ]; then
agentNumber=1
fi
From 034ad305314adcb00d22096343b0df01356b7289 Mon Sep 17 00:00:00 2001
From: Vahila <70003902+Vahila@users.noreply.github.com>
Date: Thu, 13 Nov 2025 15:49:59 +0530
Subject: [PATCH 22/33] Update file
---
AzureDevOps/ParallelStrategy.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/AzureDevOps/ParallelStrategy.yml b/AzureDevOps/ParallelStrategy.yml
index 6ca1f9c..4b0d323 100644
--- a/AzureDevOps/ParallelStrategy.yml
+++ b/AzureDevOps/ParallelStrategy.yml
@@ -45,7 +45,7 @@ jobs:
tasks: equivalenceTest
env:
MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
-
+
- bash: chmod +x ./AzureDevOps/DistributeTests.sh && ./AzureDevOps/DistributeTests.sh
displayName: 'Bash Script to distribute tests'
From ff6eb3a030c7828c1d7e7e348c0eb27a2f4de338 Mon Sep 17 00:00:00 2001
From: Vahila <70003902+Vahila@users.noreply.github.com>
Date: Fri, 14 Nov 2025 09:41:48 +0530
Subject: [PATCH 23/33] Update file
---
AzureDevOps/DistributeTests.ps1 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/AzureDevOps/DistributeTests.ps1 b/AzureDevOps/DistributeTests.ps1
index cc5977c..1f07220 100644
--- a/AzureDevOps/DistributeTests.ps1
+++ b/AzureDevOps/DistributeTests.ps1
@@ -32,7 +32,7 @@ For ($i=$agentNumber; $i -le $testCount;) {
$file = $tests[$i-1]
$fileName = [System.IO.Path]::GetFileNameWithoutExtension($file.Name)
- $testsToRun += "$base/*"
+ $testsToRun += "$fileName/*"
Write-Host "Added $file"
$i = $i + $totalAgents
}
From 9bf7953006abebea62ae10020bd0aa104f114878 Mon Sep 17 00:00:00 2001
From: Vahila <70003902+Vahila@users.noreply.github.com>
Date: Wed, 19 Nov 2025 14:56:21 +0530
Subject: [PATCH 24/33] Address review comments
---
AzureDevOps/DistributeTests.ps1 | 28 ++++++++++++++--------------
AzureDevOps/DistributeTests.sh | 24 +++++++++++++-----------
2 files changed, 27 insertions(+), 25 deletions(-)
diff --git a/AzureDevOps/DistributeTests.ps1 b/AzureDevOps/DistributeTests.ps1
index 1f07220..dff1596 100644
--- a/AzureDevOps/DistributeTests.ps1
+++ b/AzureDevOps/DistributeTests.ps1
@@ -1,19 +1,20 @@
<#
.SYNOPSIS
- Distribute the tests in VSTS pipeline across multiple agents
+ Distribute tests across multiple agents in VSTS pipeline
.DESCRIPTION
- This script slices tests files across multiple agents for faster execution.
- We search for specific type of file structure (in this example test*), and slice them according to agent number
- If we encounter multiple files [file1..file10] and if we have 2 agents, agent1 executes tests odd number of files while agent2 executes even number of files
- For detalied slicing info: https://docs.microsoft.com/en-us/vsts/pipelines/test/parallel-testing-any-test-runner
+ This script divides test files among multiple agents for faster execution. It searches for files matching a specific pattern (for example, `test*`) and assigns them based on the agent number.
+ For example, if there are multiple files [test1..test10] and 2 agents:
+ - Agent 1 runs tests from odd-numbered files.
+ - Agent 2 runs tests from even-numbered files.
+ For detailed slicing information, see https://docs.microsoft.com/en-us/vsts/pipelines/test/parallel-testing-any-test-runner
#>
-$tests = Get-ChildItem .\tests\ -File # search for test files with specific pattern.
-$totalAgents = [int]$Env:SYSTEM_TOTALJOBSINPHASE # standard VSTS variables available using parallel execution; total number of parallel jobs running
-$agentNumber = [int]$Env:SYSTEM_JOBPOSITIONINPHASE # current job position
+$tests = Get-ChildItem .\tests\ -Filter *.m -File # Search for test files matching the specified pattern
+$totalAgents = [int]$Env:SYSTEM_TOTALJOBSINPHASE # Standard VSTS variable containing the number of parallel jobs
+$agentNumber = [int]$Env:SYSTEM_JOBPOSITIONINPHASE # Current job position
$testCount = $tests.Count
-# below conditions are used if parallel pipeline is not used. i.e. pipeline is running with single agent (no parallel configuration)
+# Handle cases where the pipeline runs without parallel configuration (single agent)
if ($totalAgents -eq 0) {
$totalAgents = 1
}
@@ -27,18 +28,17 @@ Write-Host "Total tests: $testCount"
$testsToRun= @()
-# slice test files to make sure each agent gets unique test file to execute
+# Slice test files so each agent gets a unique set of files to execute
For ($i=$agentNumber; $i -le $testCount;) {
$file = $tests[$i-1]
$fileName = [System.IO.Path]::GetFileNameWithoutExtension($file.Name)
$testsToRun += "$fileName/*"
- Write-Host "Added $file"
$i = $i + $totalAgents
}
-# join all test files seperated by space.
+# Join all test files into a space-separated string
$testFiles = $testsToRun -Join " "
-Write-Host "Test files $testFiles"
-# write these files into variable so that we can run them using pytest in subsequent task.
+Write-Host "Tests to run $testFiles"
+# Write files into a variable for execution in a subsequent task
Write-Host "##vso[task.setvariable variable=MATLABTestFiles;]$testFiles"
\ No newline at end of file
diff --git a/AzureDevOps/DistributeTests.sh b/AzureDevOps/DistributeTests.sh
index 00876ce..eed3270 100644
--- a/AzureDevOps/DistributeTests.sh
+++ b/AzureDevOps/DistributeTests.sh
@@ -5,26 +5,29 @@
#
# USAGE: ./distribute_tests.sh
#
-# DESCRIPTION: This script slices tests files across multiple agents for faster execution.
-# We search for specific type of file structure (in this example test*), and slice them according to agent number
-# If we encounter multiple files [file1..file10] and if we have 2 agents, agent1 executes tests odd number of files while agent2 executes even number of files
+# DESCRIPTION: This script divides test files among multiple agents for faster execution. It searches for files matching a specific pattern (for example, `test*`) and assigns them based on the agent number.
+# For example, if there are multiple files [test1..test10] and 2 agents:
+# - Agent 1 runs tests from odd-numbered files.
+# - Agent 2 runs tests from even-numbered files.
+# For detailed slicing information, see https://docs.microsoft.com/en-us/vsts/pipelines/test/parallel-testing-any-test-runner
#
#===============================================================================
tests=()
+# Search for test files matching the specified pattern
while IFS= read -r file; do
tests+=("$file")
done < <(find ./tests -type f -name "*.m" | sort)
# Use Azure DevOps variables
-totalAgents=${SYSTEM_TOTALJOBSINPHASE}
-agentNumber=${SYSTEM_JOBPOSITIONINPHASE}
+totalAgents=${SYSTEM_TOTALJOBSINPHASE} # Standard VSTS variable containing the number of parallel jobs
+agentNumber=${SYSTEM_JOBPOSITIONINPHASE} # Current job positioN
testCount=${#tests[@]}
+# Handle cases where the pipeline runs without parallel configuration (single agent)
if [ $totalAgents -eq 0 ]; then
totalAgents=1
fi
-# below conditions are used if parallel pipeline is not used. i.e. pipeline is running with single agent (no parallel configuration)
if [ -z $agentNumber ]; then
agentNumber=1
fi
@@ -35,18 +38,17 @@ echo "Total tests: $testCount"
testsToRun=()
-# Slice test files so each agent gets unique files (1-based index)
+# Slice test files so each agent gets a unique set of files
for (( i=agentNumber; i<=testCount; i+=totalAgents )); do
file="${tests[i-1]}"
fileName=$(basename "$file" .m)
testsToRun+=("${fileName}/*")
- echo "Added $fileName"
done
-# Join all test files separated by space
+# Join all test files into a space-separated string
testFiles="${testsToRun[*]}"
-echo "Test files $testFiles"
+echo "Tests to run $testFiles"
-# Set as Azure Pipelines variable
+# Write files into a variable for execution in a subsequent task
echo "##vso[task.setvariable variable=MATLABTestFiles;]$testFiles"
\ No newline at end of file
From 4aeabe0802ea965af8b867e92c1db029cd3a7d86 Mon Sep 17 00:00:00 2001
From: Vahila <70003902+Vahila@users.noreply.github.com>
Date: Wed, 19 Nov 2025 15:19:30 +0530
Subject: [PATCH 25/33] Address review comments
---
AzureDevOps/DistributeTests.ps1 | 1 -
AzureDevOps/DistributeTests.sh | 2 --
AzureDevOps/ParallelStrategy.yml | 13 ++++++-------
3 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/AzureDevOps/DistributeTests.ps1 b/AzureDevOps/DistributeTests.ps1
index dff1596..24d9fda 100644
--- a/AzureDevOps/DistributeTests.ps1
+++ b/AzureDevOps/DistributeTests.ps1
@@ -27,7 +27,6 @@ Write-Host "Agent number: $agentNumber"
Write-Host "Total tests: $testCount"
$testsToRun= @()
-
# Slice test files so each agent gets a unique set of files to execute
For ($i=$agentNumber; $i -le $testCount;) {
$file = $tests[$i-1]
diff --git a/AzureDevOps/DistributeTests.sh b/AzureDevOps/DistributeTests.sh
index eed3270..c405f66 100644
--- a/AzureDevOps/DistributeTests.sh
+++ b/AzureDevOps/DistributeTests.sh
@@ -19,7 +19,6 @@ while IFS= read -r file; do
tests+=("$file")
done < <(find ./tests -type f -name "*.m" | sort)
-# Use Azure DevOps variables
totalAgents=${SYSTEM_TOTALJOBSINPHASE} # Standard VSTS variable containing the number of parallel jobs
agentNumber=${SYSTEM_JOBPOSITIONINPHASE} # Current job positioN
testCount=${#tests[@]}
@@ -37,7 +36,6 @@ echo "Agent number: $agentNumber"
echo "Total tests: $testCount"
testsToRun=()
-
# Slice test files so each agent gets a unique set of files
for (( i=agentNumber; i<=testCount; i+=totalAgents )); do
file="${tests[i-1]}"
diff --git a/AzureDevOps/ParallelStrategy.yml b/AzureDevOps/ParallelStrategy.yml
index 4b0d323..6930bcf 100644
--- a/AzureDevOps/ParallelStrategy.yml
+++ b/AzureDevOps/ParallelStrategy.yml
@@ -1,6 +1,6 @@
jobs:
- job: ParallelWindows
- # Parallel strategy to run tests in parallel
+ # Specify 'parallel' strategy to run tests in parallel
strategy:
parallel: 2
pool:
@@ -18,7 +18,7 @@ jobs:
MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
- powershell: .\AzureDevOps\DistributeTests.ps1
- displayName: 'PowerShell Script to distribute tests'
+ displayName: 'PowerShell script to distribute tests'
- task: RunMATLABTests@1
inputs:
@@ -28,7 +28,7 @@ jobs:
MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
- job: ParallelLinux
- # Parallel strategy to run tests in parallel
+ # Specify 'parallel' strategy to run tests in parallel
strategy:
parallel: 2
pool:
@@ -39,7 +39,6 @@ jobs:
inputs:
products: MATLAB_Compiler_SDK MATLAB_Test
- # Builds Python package from MATLAB function and verifies functionality through equivalence tests
- task: RunMATLABBuild@1
inputs:
tasks: equivalenceTest
@@ -47,7 +46,7 @@ jobs:
MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
- bash: chmod +x ./AzureDevOps/DistributeTests.sh && ./AzureDevOps/DistributeTests.sh
- displayName: 'Bash Script to distribute tests'
+ displayName: 'Bash script to distribute tests'
- task: RunMATLABTests@1
inputs:
@@ -57,7 +56,7 @@ jobs:
MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
- job: ParallelMac
- # Parallel strategy to run tests in parallel
+ # Specify 'parallel' strategy to run tests in parallel
strategy:
parallel: 2
pool:
@@ -75,7 +74,7 @@ jobs:
MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
- bash: chmod +x ./AzureDevOps/DistributeTests.sh && ./AzureDevOps/DistributeTests.sh
- displayName: 'Bash Script to distribute tests'
+ displayName: 'Bash script to distribute tests'
- task: RunMATLABTests@1
inputs:
From 13e8cb188d21d1b728b1217a64e05710d78b23b1 Mon Sep 17 00:00:00 2001
From: Vahila <70003902+Vahila@users.noreply.github.com>
Date: Fri, 21 Nov 2025 14:59:41 +0530
Subject: [PATCH 26/33] Address review comments
---
AzureDevOps/DistributeTests.ps1 | 2 +-
AzureDevOps/DistributeTests.sh | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/AzureDevOps/DistributeTests.ps1 b/AzureDevOps/DistributeTests.ps1
index 24d9fda..c91c6ae 100644
--- a/AzureDevOps/DistributeTests.ps1
+++ b/AzureDevOps/DistributeTests.ps1
@@ -2,7 +2,7 @@
.SYNOPSIS
Distribute tests across multiple agents in VSTS pipeline
.DESCRIPTION
- This script divides test files among multiple agents for faster execution. It searches for files matching a specific pattern (for example, `test*`) and assigns them based on the agent number.
+ This script divides test files across multiple agents for faster execution. It searches for files matching a specific pattern (for example, `test*`) and assigns them based on the agent number.
For example, if there are multiple files [test1..test10] and 2 agents:
- Agent 1 runs tests from odd-numbered files.
- Agent 2 runs tests from even-numbered files.
diff --git a/AzureDevOps/DistributeTests.sh b/AzureDevOps/DistributeTests.sh
index c405f66..ab0437d 100644
--- a/AzureDevOps/DistributeTests.sh
+++ b/AzureDevOps/DistributeTests.sh
@@ -5,7 +5,7 @@
#
# USAGE: ./distribute_tests.sh
#
-# DESCRIPTION: This script divides test files among multiple agents for faster execution. It searches for files matching a specific pattern (for example, `test*`) and assigns them based on the agent number.
+# DESCRIPTION: This script divides test files across multiple agents for faster execution. It searches for files matching a specific pattern (for example, `test*`) and assigns them based on the agent number.
# For example, if there are multiple files [test1..test10] and 2 agents:
# - Agent 1 runs tests from odd-numbered files.
# - Agent 2 runs tests from even-numbered files.
@@ -20,7 +20,7 @@ while IFS= read -r file; do
done < <(find ./tests -type f -name "*.m" | sort)
totalAgents=${SYSTEM_TOTALJOBSINPHASE} # Standard VSTS variable containing the number of parallel jobs
-agentNumber=${SYSTEM_JOBPOSITIONINPHASE} # Current job positioN
+agentNumber=${SYSTEM_JOBPOSITIONINPHASE} # Current job position
testCount=${#tests[@]}
# Handle cases where the pipeline runs without parallel configuration (single agent)
From 8f89dca67dbf4f44b1bb201fa5556ead9945e04d Mon Sep 17 00:00:00 2001
From: Vahila <70003902+Vahila@users.noreply.github.com>
Date: Fri, 21 Nov 2025 15:57:42 +0530
Subject: [PATCH 27/33] Update buildtool task
---
AzureDevOps/ParallelStrategy.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/AzureDevOps/ParallelStrategy.yml b/AzureDevOps/ParallelStrategy.yml
index 6930bcf..67f1650 100644
--- a/AzureDevOps/ParallelStrategy.yml
+++ b/AzureDevOps/ParallelStrategy.yml
@@ -13,7 +13,7 @@ jobs:
- task: RunMATLABBuild@1
inputs:
- tasks: equivalenceTest
+ tasks: buildPythonPackage
env:
MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
From d81976352f3e004ebcd9a5762ae11696e9b9edfa Mon Sep 17 00:00:00 2001
From: Vahila <70003902+Vahila@users.noreply.github.com>
Date: Fri, 21 Nov 2025 16:13:24 +0530
Subject: [PATCH 28/33] Update README
---
README.md | 2 ++
1 file changed, 2 insertions(+)
diff --git a/README.md b/README.md
index 18ea2c7..c8b2c6a 100644
--- a/README.md
+++ b/README.md
@@ -36,6 +36,8 @@ The repository contains examples for packaging and distributing a toolbox, as we
| GitHub Actions| [`.github/workflows/CrossPlatformBuilder.yml`](https://github.com/mathworks/advanced-ci-configuration-examples/blob/main/.github/workflows/CrossPlatformBuilder.yml) |
| Jenkins | [`Jenkins/CrossPlatformBuilder/Jenkinsfile`](https://github.com/mathworks/advanced-ci-configuration-examples/blob/main/Jenkins/CrossPlatformBuilder/Jenkinsfile) |
+- **Run Tests across Multiple Agents**: Using parallel strategy in Azure DevOps run tests across multiple agents to speed up the testing process. [`AzureDevOps/ParallelStrategy.yml`](https://github.com/mathworks/advanced-ci-configuration-examples/blob/main/AzureDevOps/ParallelStrategy.yml) has an example of running tests on multiple agents.
+
## Get Started
From e37a14077f6524e3de1c23b864649d755a02f7da Mon Sep 17 00:00:00 2001
From: Vahila <70003902+Vahila@users.noreply.github.com>
Date: Fri, 21 Nov 2025 16:16:04 +0530
Subject: [PATCH 29/33] Update README
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index c8b2c6a..e3cac22 100644
--- a/README.md
+++ b/README.md
@@ -36,7 +36,7 @@ The repository contains examples for packaging and distributing a toolbox, as we
| GitHub Actions| [`.github/workflows/CrossPlatformBuilder.yml`](https://github.com/mathworks/advanced-ci-configuration-examples/blob/main/.github/workflows/CrossPlatformBuilder.yml) |
| Jenkins | [`Jenkins/CrossPlatformBuilder/Jenkinsfile`](https://github.com/mathworks/advanced-ci-configuration-examples/blob/main/Jenkins/CrossPlatformBuilder/Jenkinsfile) |
-- **Run Tests across Multiple Agents**: Using parallel strategy in Azure DevOps run tests across multiple agents to speed up the testing process. [`AzureDevOps/ParallelStrategy.yml`](https://github.com/mathworks/advanced-ci-configuration-examples/blob/main/AzureDevOps/ParallelStrategy.yml) has an example of running tests on multiple agents.
+- **Run Tests across Multiple Agents**: Using parallel strategy in Azure DevOps, run tests across multiple agents to speed up the testing process. [`AzureDevOps/ParallelStrategy.yml`](https://github.com/mathworks/advanced-ci-configuration-examples/blob/main/AzureDevOps/ParallelStrategy.yml) has an example of running tests on multiple agents.
From 66f03504f30da29722ca40a9b46b7a5078ccf694 Mon Sep 17 00:00:00 2001
From: Vahila <70003902+Vahila@users.noreply.github.com>
Date: Fri, 21 Nov 2025 18:16:50 +0530
Subject: [PATCH 30/33] Update file
---
AzureDevOps/ParallelStrategy.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/AzureDevOps/ParallelStrategy.yml b/AzureDevOps/ParallelStrategy.yml
index 67f1650..c61a212 100644
--- a/AzureDevOps/ParallelStrategy.yml
+++ b/AzureDevOps/ParallelStrategy.yml
@@ -13,7 +13,7 @@ jobs:
- task: RunMATLABBuild@1
inputs:
- tasks: buildPythonPackage
+ tasks: mex buildPythonPackage
env:
MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
From 04de8cfb7b743b3e80b222a54e84c9ceb83d2be0 Mon Sep 17 00:00:00 2001
From: Vahila <70003902+Vahila@users.noreply.github.com>
Date: Fri, 21 Nov 2025 18:40:50 +0530
Subject: [PATCH 31/33] Update file
---
AzureDevOps/ParallelStrategy.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/AzureDevOps/ParallelStrategy.yml b/AzureDevOps/ParallelStrategy.yml
index c61a212..ce72d0f 100644
--- a/AzureDevOps/ParallelStrategy.yml
+++ b/AzureDevOps/ParallelStrategy.yml
@@ -41,7 +41,7 @@ jobs:
- task: RunMATLABBuild@1
inputs:
- tasks: equivalenceTest
+ tasks: mex buildPythonPackage
env:
MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
@@ -69,7 +69,7 @@ jobs:
- task: RunMATLABBuild@1
inputs:
- tasks: equivalenceTest
+ tasks: mex buildPythonPackage
env:
MLM_LICENSE_TOKEN: $(MLM_LICENSE_TOKEN)
From 3cd407402720234dd25eb688c41d38a8761135cb Mon Sep 17 00:00:00 2001
From: Vahila <70003902+Vahila@users.noreply.github.com>
Date: Mon, 24 Nov 2025 09:43:00 +0530
Subject: [PATCH 32/33] Address review comments
---
AzureDevOps/DistributeTests.ps1 | 2 +-
AzureDevOps/DistributeTests.sh | 2 +-
README.md | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/AzureDevOps/DistributeTests.ps1 b/AzureDevOps/DistributeTests.ps1
index c91c6ae..c5f9672 100644
--- a/AzureDevOps/DistributeTests.ps1
+++ b/AzureDevOps/DistributeTests.ps1
@@ -6,7 +6,7 @@
For example, if there are multiple files [test1..test10] and 2 agents:
- Agent 1 runs tests from odd-numbered files.
- Agent 2 runs tests from even-numbered files.
- For detailed slicing information, see https://docs.microsoft.com/en-us/vsts/pipelines/test/parallel-testing-any-test-runner
+ For detailed slicing information, see https://learn.microsoft.com/en-us/azure/devops/pipelines/test/parallel-testing-any-test-runner?view=azure-devops
#>
$tests = Get-ChildItem .\tests\ -Filter *.m -File # Search for test files matching the specified pattern
diff --git a/AzureDevOps/DistributeTests.sh b/AzureDevOps/DistributeTests.sh
index ab0437d..f029379 100644
--- a/AzureDevOps/DistributeTests.sh
+++ b/AzureDevOps/DistributeTests.sh
@@ -9,7 +9,7 @@
# For example, if there are multiple files [test1..test10] and 2 agents:
# - Agent 1 runs tests from odd-numbered files.
# - Agent 2 runs tests from even-numbered files.
-# For detailed slicing information, see https://docs.microsoft.com/en-us/vsts/pipelines/test/parallel-testing-any-test-runner
+# For detailed slicing information, see https://learn.microsoft.com/en-us/azure/devops/pipelines/test/parallel-testing-any-test-runner?view=azure-devops
#
#===============================================================================
diff --git a/README.md b/README.md
index e3cac22..2f541ae 100644
--- a/README.md
+++ b/README.md
@@ -14,7 +14,7 @@ For starter workflows, use the [`ci-configuration-examples`](https://github.com/
# Workflows
-The repository contains examples for packaging and distributing a toolbox, as well as building and uploading Python® packages.
+The repository contains examples for packaging and distributing a toolbox, building and uploading Python® packages, and running tests across multiple build agents.
- **Package and Distribute Toolbox**: Using a matrix build across multiple platforms, compile, link, and test your C source files to produce a binary MEX file per operating system. Then, bundle the resulting binaries into a toolbox and distribute it as a GitHub release.
@@ -36,7 +36,7 @@ The repository contains examples for packaging and distributing a toolbox, as we
| GitHub Actions| [`.github/workflows/CrossPlatformBuilder.yml`](https://github.com/mathworks/advanced-ci-configuration-examples/blob/main/.github/workflows/CrossPlatformBuilder.yml) |
| Jenkins | [`Jenkins/CrossPlatformBuilder/Jenkinsfile`](https://github.com/mathworks/advanced-ci-configuration-examples/blob/main/Jenkins/CrossPlatformBuilder/Jenkinsfile) |
-- **Run Tests across Multiple Agents**: Using parallel strategy in Azure DevOps, run tests across multiple agents to speed up the testing process. [`AzureDevOps/ParallelStrategy.yml`](https://github.com/mathworks/advanced-ci-configuration-examples/blob/main/AzureDevOps/ParallelStrategy.yml) has an example of running tests on multiple agents.
+- **Run Tests Across Multiple Agents**: Use the [parallel strategy](https://learn.microsoft.com/en-us/azure/devops/pipelines/test/parallel-testing-any-test-runner?view=azure-devops) in Azure DevOps to run tests across multiple agents and speed up the testing process. For configuration details, see the example in [`AzureDevOps/ParallelStrategy.yml`](https://github.com/mathworks/advanced-ci-configuration-examples/blob/main/AzureDevOps/ParallelStrategy.yml)
From 6d6210e21375ad2dd06d79a9d180c328ae6f67a5 Mon Sep 17 00:00:00 2001
From: Vahila <70003902+Vahila@users.noreply.github.com>
Date: Tue, 25 Nov 2025 21:10:01 +0530
Subject: [PATCH 33/33] Address review comments
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index 2f541ae..6b0816d 100644
--- a/README.md
+++ b/README.md
@@ -36,7 +36,7 @@ The repository contains examples for packaging and distributing a toolbox, build
| GitHub Actions| [`.github/workflows/CrossPlatformBuilder.yml`](https://github.com/mathworks/advanced-ci-configuration-examples/blob/main/.github/workflows/CrossPlatformBuilder.yml) |
| Jenkins | [`Jenkins/CrossPlatformBuilder/Jenkinsfile`](https://github.com/mathworks/advanced-ci-configuration-examples/blob/main/Jenkins/CrossPlatformBuilder/Jenkinsfile) |
-- **Run Tests Across Multiple Agents**: Use the [parallel strategy](https://learn.microsoft.com/en-us/azure/devops/pipelines/test/parallel-testing-any-test-runner?view=azure-devops) in Azure DevOps to run tests across multiple agents and speed up the testing process. For configuration details, see the example in [`AzureDevOps/ParallelStrategy.yml`](https://github.com/mathworks/advanced-ci-configuration-examples/blob/main/AzureDevOps/ParallelStrategy.yml)
+- **Run Tests Across Multiple Agents**: Use the [parallel strategy](https://learn.microsoft.com/en-us/azure/devops/pipelines/test/parallel-testing-any-test-runner?view=azure-devops) in Azure DevOps to run tests across multiple agents and speed up the testing process. For configuration details, see the example in [`AzureDevOps/ParallelStrategy.yml`](https://github.com/mathworks/advanced-ci-configuration-examples/blob/main/AzureDevOps/ParallelStrategy.yml).