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

Commit 669a97d

Browse files
author
Nikhil Bhoski
committed
Merge branch 'artifact_input_change' into pipeline_dsl
2 parents 494608a + b8a1c1a commit 669a97d

File tree

9 files changed

+175
-206
lines changed

9 files changed

+175
-206
lines changed

CONFIGDOC.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
You can use the Jenkins™ plugin for MATLAB® in freestyle and multi-configuration projects. This guide demonstrates how to run MATLAB code on Jenkins, considering a Microsoft® Windows® platform.
1+
You can use the Jenkins™ plugin for MATLAB® in freestyle and multi-configuration projects. This guide demonstrates how to run your MATLAB code or Simulink® model on Jenkins.
22

33
- [Use MATLAB for Build](#use-matlab-for-build)
44
- [Specify Build Steps](#specify-build-steps)
@@ -16,28 +16,36 @@ Select the **Use MATLAB version** checkbox to specify the full path to the MATLA
1616

1717
If the build agent already has your desired MATLAB on the path, then you are not required to select the **Use MATLAB version** checkbox. When the checkbox is clear, the plugin uses the first MATLAB instance it encounters on the path. The build fails if the operating system cannot find MATLAB on the path.
1818

19+
**Note:** The [matlabroot](https://www.mathworks.com/help/matlab/ref/matlabroot.html) function returns the full path to the MATLAB root folder, which depends on the platform, MATLAB version, and installation location. This table shows examples of the root folder path on different platforms.
20+
21+
| Platform | Path to MATLAB Root Folder |
22+
|--------------|---------------------------------|
23+
| Windows® | C:\Program Files\MATLAB\R2019a |
24+
| Linux® | /usr/local/MATLAB/R2019a |
25+
| Mac | /Applications/MATLAB_R2019a.app |
26+
1927
## Specify Build Steps
2028
When you set up the **Build** section of the project configuration window, the plugin provides you with the **Run MATLAB Tests** and **Run MATLAB Command** build steps.
2129

2230
### Run MATLAB Tests
23-
This build step uses a default setting to run tests authored using the MATLAB Unit Testing Framework and/or Simulink® Test™. If your source code is organized as files and folders within a MATLAB project, then the plugin includes any test files in the project that have been labeled as **Test**. If your code does not leverage a MATLAB project or uses a MATLAB release before R2019a, then the plugin includes all tests in the current Jenkins workspace including its subfolders.
31+
This build step uses a default setting to run tests authored using the MATLAB Unit Testing Framework or Simulink Test™. If your source code is organized into files and folders within a MATLAB project, then the plugin includes any test files in the project that have been labeled as **Test**. If your code does not leverage a MATLAB project or uses a MATLAB release before R2019a, then the plugin includes all tests in the current Jenkins workspace, including its subfolders.
2432

2533
If you use a source code management (SCM) system such as Git™, then your project must include the appropriate SCM configuration to check out the code before it can invoke the MATLAB plugin. If you do not use any SCM systems to manage your code, then an additional build step is required to ensure that the code is available in the Jenkins workspace before the build starts.
2634

27-
The **Run MATLAB Tests** build step enables you to easily generate different types of test artifacts. To publish the test results, you can use these artifacts with other Jenkins plugins. The selected artifacts are saved in the **matlabTestArtifacts** folder of the Jenkins workspace. If you do not select any of the test artifact check boxes, the folder is not created. However, the tests still run and test failures fail the build.
35+
The **Run MATLAB Tests** build step enables you to easily generate different types of test artifacts. To publish the test results, you can use these artifacts with other Jenkins plugins. The selected artifacts are saved in the **matlabTestArtifacts** folder of the Jenkins workspace. If you do not select any of the test artifact check boxes, the folder is not created. However, the tests still run, and test failures fail the build.
2836

2937
![run_matlab_tests](https://user-images.githubusercontent.com/48831250/76800820-d2629a00-67aa-11ea-9fa7-c466e8c17f27.png)
3038

3139
The **Run MATLAB Tests** build step produces a MATLAB script file named **runMatlabTests.m** in the Jenkins workspace. The plugin uses this file to run the tests and generate the test artifacts. You can review the contents of the script to understand the testing workflow.
3240

33-
**Note:** Producing a PDF test report is not currently supported on MacOS platforms.
41+
**Note:** Producing a PDF test report is not currently supported on Mac platforms.
3442

3543
### Run MATLAB Command
3644
The **Run MATLAB Command** build step enables you to specify MATLAB commands tailored to your specific needs. For example, you can use this build step to customize your test run or add a different build step to your pipeline.
3745

3846
If you specify more than one MATLAB command, use a comma or semicolon to separate the commands. The build fails if the execution of any command results in an error.
3947

40-
![run_matlab_commands](https://user-images.githubusercontent.com/48831250/76801842-d2fc3000-67ac-11ea-9174-0a6485595714.png)
48+
![run-matlab-command](https://user-images.githubusercontent.com/48831250/79279466-1d400200-7e7c-11ea-9ef5-0d006f100eea.png)
4149

4250
If you need to specify several MATLAB commands, consider writing a MATLAB script or function as part of your repository and executing this script or function instead.
4351

@@ -46,7 +54,7 @@ Test artifacts are not autogenerated if you choose to run tests using this build
4654
## Set Up Freestyle Project
4755
To configure the plugin for a freestyle project, specify the location where MATLAB is installed as well as the required build steps.
4856

49-
1) In the **Build Environment** section of the project configuration window, select **Use MATLAB version**. Then, enter the value returned by the **matlabroot** function in the **MATLAB root** box. (You can skip this step if MATLAB has already been added to the path on the build agent.)
57+
1) In the **Build Environment** section of the project configuration window, select **Use MATLAB version**. Then, enter the full path to the MATLAB root folder in the **MATLAB root** box. (You can skip this step if MATLAB has already been added to the path on the build agent.)
5058

5159
![build_environment](https://user-images.githubusercontent.com/48831250/76798534-23bc5a80-67a6-11ea-9a48-861cbbc7b0ba.png)
5260

@@ -80,7 +88,7 @@ You can define several axes in the **Configuration Matrix** section. For example
8088
![run_matlab_command_matrix](https://user-images.githubusercontent.com/48831250/76883848-21fca080-6853-11ea-8ad3-89f85b997608.png)
8189

8290
**Note:**
83-
* For a user-defined axis named **VAR**, **$VAR** and **${VAR}** are both valid formats for accessing the values.
91+
* Both **$VAR** and **${VAR}** are valid formats for accessing the values of the user-defined axis **VAR**. On Mac platforms, the **${VAR}** format is recommended.
8492

8593
* A multi-configuration project creates a separate workspace for each user-defined axis value. If you specify the full paths to where MATLAB is installed as axis values, Jenkins fails to create separate workspaces and fails the build.
8694

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ To learn how to use the plugin in testing workflows, see [Examples](/examples/).
1515
## Contact Us
1616
If you have any questions or suggestions, please contact MathWorks.
1717

18-
support@mathworks.com
18+
continuous-integration@mathworks.com
1919

2020
## License
2121
MIT © 2019 The MathWorks, Inc.

examples/Run-MATLAB-Tests.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Create a new project and configure it by following these steps:
4343

4444
![build_environment](https://user-images.githubusercontent.com/48831250/76796506-f53c8080-67a1-11ea-860f-0cca3748c723.png)
4545

46-
6. In the **Build** section of Jenkins, click **Add build step > Run MATLAB Tests**. Then, select your desired test artifacts to be generated in the project workspace. The plugin in this example is configured to generate Cobertura code coverage and JUnit test result reports. For more information on how to configure the Jenkins plugin for MATLAB, see [Plugin Configuration Guide](../CONFIGDOC.md).
46+
6. In the **Build** section of Jenkins, select **Add build step > Run MATLAB Tests**. Then, select your desired test artifacts to be generated in the project workspace. The plugin in this example is configured to generate Cobertura code coverage and JUnit test result reports. For more information on how to configure the Jenkins plugin for MATLAB, see [Plugin Configuration Guide](../CONFIGDOC.md).
4747

4848
![build_step](https://user-images.githubusercontent.com/48831250/76796528-02f20600-67a2-11ea-9e40-9f10239db1f9.png)
4949

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,7 @@ public class MatlabBuilderConstants {
2424
static final String STM_RESULTS = "'SimulinkTestResults'";
2525
static final String COBERTURA_CODE_COVERAGE = "'CoberturaCodeCoverage'";
2626
static final String COBERTURA_MODEL_COVERAGE = "'CoberturaModelCoverage'";
27-
static final String PDF_REPORT_PATH = "'PDFReportPath'";
28-
static final String TAP_RESULTS_PATH ="'TAPResultsPath'";
29-
static final String JUNIT_RESULTS_PATH = "'JUnitResultsPath'";
30-
static final String STM_RESULTS_PATH = "'SimulinkTestResultsPath'";
31-
static final String COBERTURA_CODE_COVERAGE_PATH = "'CoberturaCodeCoveragePath'";
32-
static final String COBERTURA_MODEL_COVERAGE_PATH = "'CoberturaModelCoveragePath'";
33-
27+
3428
// Matlab Runner files
3529
static final String BAT_RUNNER_SCRIPT = "run_matlab_command.bat";
3630
static final String SHELL_RUNNER_SCRIPT = "run_matlab_command.sh";

0 commit comments

Comments
 (0)