Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Commit bef8d55

Browse files
authored
Merge pull request #49 from mathworks/pdfReport-issue
Removed PDF test report option from plugin UI
2 parents 536bc87 + f2020f3 commit bef8d55

File tree

5 files changed

+10
-29
lines changed

5 files changed

+10
-29
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Jenkins MATLAB Plugin
22

3-
The Jenkins plugin for MATLAB® enables you to easily run your MATLAB and Simulink® tests and generate artifacts such as *PDF* test report, *JUnit* and *TAP* test results, and *Cobertura* code or model coverage reports. You can also export your Simulink Test™ Manager results. This guide shows you examples of how to configure the plugin for different objectives, considering a Microsoft® Windows® platform.
3+
The Jenkins plugin for MATLAB® enables you to easily run your MATLAB and Simulink® tests and generate artifacts such as *JUnit* and *TAP* test results, and *Cobertura* code or model coverage reports. You can also export your Simulink Test™ Manager results. This guide shows you examples of how to configure the plugin for different objectives, considering a Microsoft® Windows® platform.
44

55
## Configure Plugin for Freestyle Project
66
To configure the plugin for a freestyle project, select **Run MATLAB Tests** from the **Add build step** list. Then, enter the value returned by the **matlabroot** function in the **MATLAB root** field.
77

88
![new_add_build_step](https://user-images.githubusercontent.com/47204011/55624172-be54a100-57c2-11e9-9596-52d3a60ee467.png)
99

10-
![new_enter_matlabroot](https://user-images.githubusercontent.com/51316279/67834674-085df500-fb0e-11e9-927b-c4da6bff0ed6.png)
10+
![new_enter_matlabroot](https://user-images.githubusercontent.com/51316279/70772996-28830400-1d9c-11ea-92d1-db9f054c304c.png)
1111

1212
### Option 1: Freestyle Project with Automatic Test Mode
1313
With the Jenkins plugin for MATLAB, you have the option to run your tests in either *automatic* or *custom* mode. The automatic test mode employs a default setting to run tests written using the MATLAB Unit Testing Framework and/or Simulink Test. If your source code is organized as files and folders within a project, the plugin will consider any test files in the project that have been tagged as **Test**. If your code does not leverage a project or uses a MATLAB version prior to R2019a, the plugin will consider all tests in the current Jenkins workspace including the subfolders.
@@ -18,17 +18,17 @@ The automatic test execution feature of the plugin enables you to generate diffe
1818

1919
1) From the **Test mode** drop-down list, select the **Automatic** option (**Automatic** is the default testing mode).
2020

21-
![new_select_automatic_option](https://user-images.githubusercontent.com/51316279/67842305-e7060480-fb1f-11e9-8f20-d2299636be02.png)
21+
![new_select_automatic_option](https://user-images.githubusercontent.com/51316279/70773784-6719be00-1d9e-11ea-9a6c-7b277d63e10a.png)
2222

2323
2) Select your desired test artifacts.
2424

25-
![new_select_all_test_artifacts](https://user-images.githubusercontent.com/51316279/67841415-056b0080-fb1e-11e9-928f-8285b7f2fc71.png)
25+
![new_select_all_test_artifacts](https://user-images.githubusercontent.com/51316279/70773293-0dfd5a80-1d9d-11ea-8d24-28407e67c8a5.png)
2626

2727
The selected artifacts will be saved in the **matlabTestArtifacts** folder of the Jenkins workspace.
2828

2929
![Workspace01](https://user-images.githubusercontent.com/47204011/55470859-1e621080-5626-11e9-98f2-044144272643.JPG)
3030

31-
![Test_artifacts](https://user-images.githubusercontent.com/51316279/67843000-33057900-fb21-11e9-9ce2-870ecf5ffdd0.png)
31+
![Test_artifacts](https://user-images.githubusercontent.com/51316279/70776181-5bc89180-1da2-11ea-92e6-4c71deab7199.png)
3232

3333
If you do not select any of the test artifact check boxes, the **matlabTestArtifacts** folder will not be created in the workspace. However, tests will still run and potential test failures will fail the build.
3434

@@ -41,7 +41,7 @@ This option enables you to develop your custom MATLAB commands for running tests
4141

4242
1) From the **Test mode** drop-down list, select the **Custom** option.
4343

44-
![new_select_custom](https://user-images.githubusercontent.com/51316279/67842071-79f26f00-fb1f-11e9-8d46-274ffa941cfd.png)
44+
![new_select_custom](https://user-images.githubusercontent.com/51316279/70775386-42731580-1da1-11ea-9523-41c83443ee5b.png)
4545

4646
2) Enter your commands in the **MATLAB command** field. If you specify more than one MATLAB command, use a comma or semicolon to separate the commands. The build will fail if the execution of any command results in an error.
4747

@@ -68,7 +68,7 @@ To configure the plugin for a matrix build where tests run automatically in mult
6868

6969
2) In the **Run MATLAB Tests** section of the project, include the user-defined axis name in the **MATLAB root** field to specify the locations where MATLAB is installed. In this example, **$VERSION** will be replaced by one axis value per build step.
7070

71-
![image](https://user-images.githubusercontent.com/51316279/67841685-a659bb80-fb1e-11e9-802a-3b357933f9c7.png)
71+
![image](https://user-images.githubusercontent.com/51316279/70773424-72b8b500-1d9d-11ea-97ca-807ecd6c4e47.png)
7272

7373
You can select the test artifact check boxes when tests run automatically. Once you have made your selections, save your settings and run the build.
7474

@@ -86,7 +86,7 @@ To configure the matrix build where you can customize the MATLAB test execution,
8686

8787
3) In the **Run MATLAB Tests** section of the project, use the **VERSION** axis to specify the locations where MATLAB is installed.
8888

89-
![image](https://user-images.githubusercontent.com/51316279/67841685-a659bb80-fb1e-11e9-802a-3b357933f9c7.png)
89+
![image](https://user-images.githubusercontent.com/51316279/70773424-72b8b500-1d9d-11ea-97ca-807ecd6c4e47.png)
9090

9191
4) From the **Test mode** drop-down list, select the **Custom** option. Use the second user-defined axis to create your commands and enter them in the **MATLAB command** field. Then, save your settings and run the build.
9292

src/main/java/com/mathworks/ci/MatlabBuilder.java

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,6 @@ public static class RunTestsAutomaticallyOption extends TestRunTypeList {
343343
private boolean tatapChkBx;
344344
private boolean taJunitChkBx;
345345
private boolean taCoberturaChkBx;
346-
private boolean taPDFReportChkBx;
347346
private boolean taSTMResultsChkBx;
348347
private boolean taModelCoverageChkBx;
349348

@@ -367,11 +366,6 @@ public void setTaCoberturaChkBx(boolean taCoberturaChkBx) {
367366
this.taCoberturaChkBx = taCoberturaChkBx;
368367
}
369368

370-
@DataBoundSetter
371-
public void setTaPDFReportChkBx(boolean taPDFReportChkBx) {
372-
this.taPDFReportChkBx = taPDFReportChkBx;
373-
}
374-
375369
@DataBoundSetter
376370
public void setTaSTMResultsChkBx(boolean taSTMResultsChkBx) {
377371
this.taSTMResultsChkBx = taSTMResultsChkBx;
@@ -393,10 +387,6 @@ public boolean getTaJunitChkBx() {
393387
public boolean getTaCoberturaChkBx() {
394388
return taCoberturaChkBx;
395389
}
396-
397-
public boolean getTaPDFReportChkBx() {
398-
return taPDFReportChkBx;
399-
}
400390

401391
public boolean getTaSTMResultsChkBx() {
402392
return taSTMResultsChkBx;
@@ -423,8 +413,6 @@ public boolean getBooleanByName(String memberName) {
423413
return this.getTaJunitChkBx();
424414
case "taCoberturaChkBx":
425415
return this.getTaCoberturaChkBx();
426-
case "taPDFReportChkBx":
427-
return this.getTaPDFReportChkBx();
428416
case "taSTMResultsChkBx":
429417
return this.getTaSTMResultsChkBx();
430418
case "taModelCoverageChkBx":
@@ -617,14 +605,13 @@ private String getNodeSpecificFileSeperator(Launcher launcher) {
617605

618606
// Concatenate the input arguments
619607
private String getInputArguments() {
620-
String pdfReport = MatlabBuilderConstants.PDF_REPORT + "," + getTestRunTypeList().getBooleanByName("taPDFReportChkBx");
621608
String tapResults = MatlabBuilderConstants.TAP_RESULTS + "," + getTestRunTypeList().getBooleanByName("tatapChkBx");
622609
String junitResults = MatlabBuilderConstants.JUNIT_RESULTS + "," + getTestRunTypeList().getBooleanByName("taJunitChkBx");
623610
String stmResults = MatlabBuilderConstants.STM_RESULTS + "," + getTestRunTypeList().getBooleanByName("taSTMResultsChkBx");
624611
String coberturaCodeCoverage = MatlabBuilderConstants.COBERTURA_CODE_COVERAGE + "," + getTestRunTypeList().getBooleanByName("taCoberturaChkBx");
625612
String coberturaModelCoverage = MatlabBuilderConstants.COBERTURA_MODEL_COVERAGE + "," + getTestRunTypeList().getBooleanByName("taModelCoverageChkBx");
626613

627-
String inputArgsToMatlabFcn = pdfReport + "," + tapResults + "," + junitResults + ","
614+
String inputArgsToMatlabFcn = tapResults + "," + junitResults + ","
628615
+ stmResults + "," + coberturaCodeCoverage + "," + coberturaModelCoverage;
629616

630617
return inputArgsToMatlabFcn;

src/main/java/com/mathworks/ci/MatlabBuilderConstants.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ public class MatlabBuilderConstants {
1515
static final String AUTOMATIC_OPTION = "RunTestsAutomaticallyOption";
1616

1717
// Input parameter names (Passed to runMatlabTests.m as name-value pair arguments)
18-
static final String PDF_REPORT = "'PDFReport'";
1918
static final String TAP_RESULTS = "'TAPResults'";
2019
static final String JUNIT_RESULTS = "'JUnitResults'";
2120
static final String STM_RESULTS = "'SimulinkTestResults'";

src/main/resources/com/mathworks/ci/MatlabBuilder/RunTestsAutomaticallyOption/config.jelly

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define" xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form">
33

44
<f:section title="Generate Test Artifacts">
5-
<f:entry field="taPDFReportChkBx">
6-
<f:checkbox title="PDF test report " name="taPDFReportChkBx" checked="${instance.taPDFReportChkBx}"/>
7-
</f:entry>
8-
95
<f:entry field="tatapChkBx">
106
<f:checkbox title="TAP test results" name="tatapChkBx" checked="${instance.tatapChkBx}"/>
117
</f:entry>

src/test/java/com/mathworks/ci/MatlabBuilderTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ public void verifyRunTestAutomaticallyIsDefault() throws Exception {
300300
this.matlabBuilder.setMatlabRoot(getMatlabroot("R2018b"));
301301
FreeStyleBuild build = getBuildforRunTestAutomatically();
302302
jenkins.assertLogContains("-batch", build);
303-
jenkins.assertLogContains("\'PDFReport\',true,\'TAPResults\',true," +
303+
jenkins.assertLogContains("\'TAPResults\',true," +
304304
"\'JUnitResults\',true,\'SimulinkTestResults\',true," +
305305
"\'CoberturaCodeCoverage\',true,\'CoberturaModelCoverage\',true", build);
306306
}
@@ -547,7 +547,6 @@ private FreeStyleBuild getBuildforRunTestAutomatically() throws InterruptedExcep
547547
runOption.setTaJunitChkBx(true);
548548
runOption.setTatapChkBx(true);
549549
runOption.setTaModelCoverageChkBx(true);
550-
runOption.setTaPDFReportChkBx(true);
551550
runOption.setTaSTMResultsChkBx(true);
552551
this.matlabBuilder.setTestRunTypeList(runOption);
553552
project.getBuildersList().add(this.matlabBuilder);

0 commit comments

Comments
 (0)