Skip to content
Open
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
bbe4f04
build
taguptamw Sep 11, 2025
23fb6fe
remove comment
taguptamw Sep 11, 2025
37f012d
html code coverage
taguptamw Sep 11, 2025
ee47882
html model coverage and html test report
taguptamw Sep 11, 2025
d4d42ef
update task.json
taguptamw Sep 12, 2025
96a460f
test code coverage html in template.yml
taguptamw Sep 12, 2025
cbd10d1
test commit
taguptamw Sep 12, 2025
49e3d35
add folder for code cov html
taguptamw Sep 12, 2025
be5c5f1
fix cod cov html
taguptamw Sep 12, 2025
85404b2
fix code coverage html
taguptamw Sep 12, 2025
e2f32c6
update code coverage html
taguptamw Sep 12, 2025
0bc1740
comment added
taguptamw Oct 7, 2025
a833549
remove comment
taguptamw Oct 7, 2025
7496fec
test results html
taguptamw Oct 7, 2025
ca6b302
skip version 0
taguptamw Oct 7, 2025
43164de
fix test results html
taguptamw Oct 7, 2025
ea297fd
remove TestRunner.withTextOutput
taguptamw Oct 7, 2025
3a34844
model coverage HTML
taguptamw Oct 7, 2025
e37654c
add condition in model coverage HTML
taguptamw Oct 7, 2025
4801d62
upload artifacts
taguptamw Oct 7, 2025
5d74df5
verify html file creation and remove upload artifact
taguptamw Oct 7, 2025
22417b6
remove file verification in model coverage and upload artifacts
taguptamw Oct 8, 2025
c419f4d
fix upload results
taguptamw Oct 8, 2025
86ebb68
fix artifacts
taguptamw Oct 8, 2025
8c818ae
artifacts
taguptamw Oct 8, 2025
1cb230d
model coverage html verification
taguptamw Oct 8, 2025
6e5af4c
final fix model coverage
taguptamw Oct 8, 2025
c5c33c8
remove model coverage file verification
taguptamw Oct 8, 2025
bd4374a
ls the files
taguptamw Oct 8, 2025
ebb919a
add model cov verif
taguptamw Oct 9, 2025
0b92f14
remove ls
taguptamw Oct 9, 2025
f83bccd
refactoring
taguptamw Oct 9, 2025
67b8685
change report to results
taguptamw Oct 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build-test-publish.pipeline.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 1.13$(Rev:.r)
name: 1.14$(Rev:.r)

trigger:
- master
Expand Down
26 changes: 23 additions & 3 deletions integ-test-promote-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,9 @@ jobs:
displayName: Run MATLAB tests producing artifacts
inputs:
testResultsJUnit: test-results/matlab/results.xml
testResultsHTML: test-results/matlab/resultsHTML
Copy link
Member

Choose a reason for hiding this comment

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

Same as GHA, this is just the folder-based HTML?

codeCoverageCobertura: code-coverage/coverage.xml
codeCoverageHTML: code-coverage/coverageHTML
sourceFolder: src
- task: MathWorks.matlab-azure-devops-extension-dev.RunMATLABTests.RunMATLABTests@${{ version }}
displayName: Run MATLAB tests filter by folder
Expand All @@ -225,10 +227,22 @@ jobs:
set -e
grep -q FirstTest test-results/matlab/results.xml
displayName: Verify test results file was created
- bash: |
set -e
test -d test-results/matlab/resultsHTML
test -f test-results/matlab/resultsHTML/*.html
displayName: Verify HTML test results folder and HTML file was created
condition: not(eq(${{ version }}, '0'))
- bash: |
set -e
grep -q add code-coverage/coverage.xml
displayName: Verify code coverage file was created
- bash: |
set -e
test -d code-coverage/coverageHTML
test -f code-coverage/coverageHTML/*.html
displayName: Verify HTML code coverage folder and HTML file was created
condition: not(eq(${{ version }}, '0'))
- bash: |
set -e
grep -q simpleTest test-results/matlab/selectbyfolder.xml
Expand Down Expand Up @@ -273,7 +287,7 @@ jobs:
sourceFolder: src
- bash: |
set -e
grep -q "TestRunner.withTextOutput('OutputDetail', 3)" console.log
grep -q "('OutputDetail', 3)" console.log
Comment on lines -276 to +290
Copy link
Member

Choose a reason for hiding this comment

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

Is this due to a change to genscript?

rm console.log
displayName: Verify tests ran with detailed display level for event details
- task: MathWorks.matlab-azure-devops-extension-dev.RunMATLABTests.RunMATLABTests@${{ version }}
Expand All @@ -283,7 +297,7 @@ jobs:
sourceFolder: src
- bash: |
set -e
grep -q "TestRunner.withTextOutput('LoggingLevel', 3)" console.log
grep -q "('LoggingLevel', 3)" console.log
rm console.log
displayName: Verify tests ran with detailed verbosity level for logged diagnostics
- bash: |
Expand Down Expand Up @@ -346,6 +360,7 @@ jobs:
inputs:
selectByFolder: "simtests"
modelCoverageCobertura: test-results/matlab/modelcoverage.xml
modelCoverageHTML: test-results/matlab/modelcoverageHTML
testResultsSimulinkTest: test-results/matlab/stmResult.mldatx
testResultsPDF: test-results/matlab/results.pdf
condition: eq(variables['Agent.OS'], 'Linux')
Expand All @@ -354,6 +369,12 @@ jobs:
grep -q new_temp_model test-results/matlab/modelcoverage.xml
displayName: Verify Model coverage was created
condition: eq(variables['Agent.OS'], 'Linux')
- bash: |
set -e
test -d test-results/matlab/modelcoverageHTML
test -f test-results/matlab/modelcoverageHTML/*.html
displayName: Verify HTML Model coverage folder and HTML file was created
condition: not(eq(${{ version }}, '0'))
- bash: |
set -e
test -f test-results/matlab/stmResult.mldatx
Expand All @@ -364,7 +385,6 @@ jobs:
test -f test-results/matlab/results.pdf
displayName: Verify PDF report was created
condition: eq(variables['Agent.OS'], 'Linux')

- job: test_run_build_v${{ version }}
strategy:
matrix:
Expand Down
3 changes: 3 additions & 0 deletions tasks/run-matlab-tests/v1/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@ async function run() {
const options: scriptgen.IRunTestsOptions = {
JUnitTestResults: taskLib.getInput("testResultsJUnit"),
CoberturaCodeCoverage: taskLib.getInput("codeCoverageCobertura"),
HTMLCodeCoverage: taskLib.getInput("codeCoverageHTML"),
SourceFolder: taskLib.getInput("sourceFolder"),
SelectByFolder: taskLib.getInput("selectByFolder"),
SelectByTag: taskLib.getInput("selectByTag"),
CoberturaModelCoverage: taskLib.getInput("modelCoverageCobertura"),
HTMLModelCoverage: taskLib.getInput("modelCoverageHTML"),
SimulinkTestResults: taskLib.getInput("testResultsSimulinkTest"),
PDFTestReport: taskLib.getInput("testResultsPDF"),
HTMLTestReport: taskLib.getInput("testResultsHTML"),
Strict: taskLib.getBoolInput("strict"),
UseParallel: taskLib.getBoolInput("useParallel"),
OutputDetail: taskLib.getInput("outputDetail"),
Expand Down
6 changes: 6 additions & 0 deletions tasks/run-matlab-tests/v1/scriptgen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ import * as path from "path";
export interface IRunTestsOptions {
JUnitTestResults?: string;
CoberturaCodeCoverage?: string;
HTMLCodeCoverage?: string;
SourceFolder?: string;
PDFTestReport?: string;
HTMLTestReport?: string;
SimulinkTestResults?: string;
CoberturaModelCoverage?: string;
HTMLModelCoverage?: string;
SelectByTag?: string;
SelectByFolder?: string;
Strict?: boolean;
Expand All @@ -22,10 +25,13 @@ export function generateCommand(options: IRunTestsOptions): string {
`testScript = genscript('Test',` +
`'JUnitTestResults','${options.JUnitTestResults || ""}',` +
`'CoberturaCodeCoverage','${options.CoberturaCodeCoverage || ""}',` +
`'HTMLCodeCoverage','${options.HTMLCodeCoverage || ""}',` +
`'SourceFolder','${options.SourceFolder || ""}',` +
`'PDFTestReport','${options.PDFTestReport || ""}',` +
`'HTMLTestReport','${options.HTMLTestReport || ""}',` +
`'SimulinkTestResults','${options.SimulinkTestResults || ""}',` +
`'CoberturaModelCoverage','${options.CoberturaModelCoverage || ""}',` +
`'HTMLModelCoverage','${options.HTMLModelCoverage || ""}',` +
`'SelectByTag','${options.SelectByTag || ""}',` +
`'SelectByFolder','${options.SelectByFolder || ""}',` +
`'Strict',${options.Strict || false},` +
Expand Down
27 changes: 27 additions & 0 deletions tasks/run-matlab-tests/v1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,15 @@
"required": false,
"helpMarkDown": "Path to write the test results in PDF format (requires MATLAB R2020b or later on macOS platforms)."
},
{
"name": "testResultsHTML",
"type": "string",
"label": "HTML test report ",
Copy link
Member

Choose a reason for hiding this comment

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

This seems potentially misleading if this is the folder-based html report, since when I see report I'd probably expect a file rather than a directory.

"defaultValue": "",
"groupName": "testArtifacts",
"required": false,
"helpMarkDown": "Path to write the test results in HTML format."
},
{
"name": "testResultsJUnit",
"type": "string",
Expand Down Expand Up @@ -129,6 +138,15 @@
"groupName": "coverageArtifacts",
"helpMarkDown": "Path to write the code coverage results in Cobertura XML format."
},
{
"name": "codeCoverageHTML",
"type": "string",
"label": "HTML code coverage",
"defaultValue": "",
"required": false,
"groupName": "coverageArtifacts",
"helpMarkDown": "Path to write the code coverage results in HTML format."
},
{
"name": "modelCoverageCobertura",
"type": "string",
Expand All @@ -138,6 +156,15 @@
"required": false,
"helpMarkDown": "Path to write the model coverage report in Cobertura XML format (requires Simulink Coverage and is supported in MATLAB R2018b or later)."
},
{
"name": "modelCoverageHTML",
"type": "string",
"label": "HTML model coverage",
"defaultValue": "",
"groupName": "coverageArtifacts",
"required": false,
"helpMarkDown": "Path to write the model coverage report in HTML format (requires Simulink Coverage and is supported in MATLAB R2018b or later)."
},
{
"name": "startupOptions",
"type": "string",
Expand Down
24 changes: 18 additions & 6 deletions tasks/run-matlab-tests/v1/test/scriptgen.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,13 @@ export default function suite() {
const options: scriptgen.IRunTestsOptions = {
JUnitTestResults: "",
CoberturaCodeCoverage: "",
HTMLCodeCoverage: "",
SourceFolder: "",
PDFTestReport: "",
HTMLTestReport: "",
SimulinkTestResults: "",
CoberturaModelCoverage: "",
HTMLModelCoverage: "",
SelectByTag: "",
SelectByFolder: "",
Strict: false,
Expand All @@ -26,20 +29,23 @@ export default function suite() {
assert(actual.includes("genscript('Test'"));
assert(actual.includes("'JUnitTestResults',''"));
assert(actual.includes("'CoberturaCodeCoverage',''"));
assert(actual.includes("'HTMLCodeCoverage',''"));
assert(actual.includes("'SourceFolder',''"));
assert(actual.includes("'PDFTestReport',''"));
assert(actual.includes("'HTMLTestReport',''"));
assert(actual.includes("'SimulinkTestResults',''"));
assert(actual.includes("'CoberturaModelCoverage',''"));
assert(actual.includes("'HTMLModelCoverage',''"));
assert(actual.includes("'SelectByTag',''"));
assert(actual.includes("'SelectByFolder',''"));
assert(actual.includes("'Strict',false"));
assert(actual.includes("'UseParallel',false"));
assert(actual.includes("'OutputDetail',''"));
assert(actual.includes("'LoggingLevel',''"));

const expected = `genscript('Test', 'JUnitTestResults','', 'CoberturaCodeCoverage','',
'SourceFolder','', 'PDFTestReport','', 'SimulinkTestResults','',
'CoberturaModelCoverage','', 'SelectByTag','', 'SelectByFolder','',
const expected = `genscript('Test', 'JUnitTestResults','', 'CoberturaCodeCoverage','','HTMLCodeCoverage','',
'SourceFolder','', 'PDFTestReport','', 'HTMLTestReport','', 'SimulinkTestResults','',
'CoberturaModelCoverage','', 'HTMLModelCoverage','', 'SelectByTag','', 'SelectByFolder','',
'Strict',false, 'UseParallel',false, 'OutputDetail','', 'LoggingLevel','')`
.replace(/\s+/g, "");
assert(actual.replace(/\s+/g, "").includes(expected));
Expand All @@ -49,10 +55,13 @@ export default function suite() {
const options: scriptgen.IRunTestsOptions = {
JUnitTestResults: "test-results/results.xml",
CoberturaCodeCoverage: "code-coverage/coverage.xml",
HTMLCodeCoverage: "code-coverage/coverage.html",
SourceFolder: "source",
PDFTestReport: "test-results/pdf-results.pdf",
HTMLTestReport: "test-results/html-results.html",
SimulinkTestResults: "test-results/simulinkTest.mldatx",
CoberturaModelCoverage: "test-results/modelcoverage.xml",
HTMLModelCoverage: "test-results/modelcoverage.html",
SelectByTag: "FeatureA",
SelectByFolder: "test/tools;test/toolbox",
Strict: true,
Expand All @@ -66,10 +75,13 @@ export default function suite() {
assert(actual.includes("genscript('Test'"));
assert(actual.includes("'JUnitTestResults','test-results/results.xml'"));
assert(actual.includes("'CoberturaCodeCoverage','code-coverage/coverage.xml'"));
assert(actual.includes("'HTMLCodeCoverage','code-coverage/coverage.html'"));
assert(actual.includes("'SourceFolder','source'"));
assert(actual.includes("'PDFTestReport','test-results/pdf-results.pdf'"));
assert(actual.includes("'HTMLTestReport','test-results/html-results.html'"));
assert(actual.includes("'SimulinkTestResults','test-results/simulinkTest.mldatx'"));
assert(actual.includes("'CoberturaModelCoverage','test-results/modelcoverage.xml'"));
assert(actual.includes("'HTMLModelCoverage','test-results/modelcoverage.html'"));
assert(actual.includes("'SelectByTag','FeatureA'"));
assert(actual.includes("'SelectByFolder','test/tools;test/toolbox'"));
assert(actual.includes("'Strict',true"));
Expand All @@ -78,9 +90,9 @@ export default function suite() {
assert(actual.includes("'LoggingLevel','Detailed'"));

const expected = `genscript('Test', 'JUnitTestResults','test-results/results.xml',
'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',
'CoberturaCodeCoverage','code-coverage/coverage.xml','HTMLCodeCoverage','code-coverage/coverage.html', 'SourceFolder','source',
'PDFTestReport','test-results/pdf-results.pdf', 'HTMLTestReport','test-results/html-results.html', 'SimulinkTestResults','test-results/simulinkTest.mldatx',
'CoberturaModelCoverage','test-results/modelcoverage.xml', 'HTMLModelCoverage','test-results/modelcoverage.html', 'SelectByTag','FeatureA',
'SelectByFolder','test/tools;test/toolbox', 'Strict',true, 'UseParallel',true, 'OutputDetail','Detailed',
'LoggingLevel','Detailed' )`
.replace(/\s+/g, "");
Expand Down