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

Commit cdcf6d3

Browse files
authored
Merge pull request #84 from mathworks/matlab-jenkins-documentation
Matlab jenkins documentation
2 parents 30a2d59 + 94c0e26 commit cdcf6d3

File tree

3 files changed

+16
-8
lines changed

3 files changed

+16
-8
lines changed

CONFIGDOC.md

Lines changed: 14 additions & 6 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,15 +16,23 @@ 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

@@ -37,7 +45,7 @@ The **Run MATLAB Command** build step enables you to specify MATLAB commands tai
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

0 commit comments

Comments
 (0)