Developer Zone

MATLAB的高级软件开发

用詹金斯插入

现在,我们已经有了MATLAB项目自描述如何进行测试,让我得到我的暗示last post。In particular, how easy it is to get the project set up and ready to roll with your automated CI build. We have discussed在这个博客上很多次how to get squared away with your MATLAB and Simulink code on Jenkins, but we have never discussed how we are working to make it easier for you. This needs to be rectified!

Turns out, we've been up to some stuff. In particular, one of the "stuffs" we've been up to is providing a Jenkins plugin to reduce the time and effort it takes you to get up and running with your MATLAB and Simulink builds.

结合MATLAB中现在提供的测试感知项目,可以实现真正的按钮Jenkins体验(对于那些偏爱那些而不是按钮的人来说,这也是一种配置与编码体验)。让我们看看我们最喜欢的项目libdirectional如何完成。

上次我们对其进行了预测,并启用了测试标签,以帮助定义项目中的测试。现在,Jenkins插件知道该怎么做。想在行动中看到它吗?我也走。

First ya gotta get the plugin installed. This is actually pretty easy, you can find it on theJenkins插件索引

From there you or your Jenkins administrator can download it and install it directly. However, its actually much easier just to install it directly within Jenkins.

现在安装了插件,让我们设置我们的项目并开始。它要做的就是

  1. 将git细节指向libdirectional
  2. 如果需要,指定MATLAB构建agents. This step isn't needed if your build agents are already configured with MATLAB on the system PATH. The location specified in the plugin will simply add the MATLAB location specified to the PATH, but if invoking "matlab" from the terminal or shell finds the right desired MATLAB on your build machines you can skip this.
  3. Now we can go ahead and run the MATLAB tests in the project. You even have one click access to produce a variety of test artifacts such as test results, reports, and coverage information. Using these artifacts you can leverage a variety of other plugins and features of the Jenkins environment to get more insight into your build.

这些步骤中的所有三个步骤均显示在这里:

Super easy, but when we run the build we will see it fails:

如果您熟悉该项目,则查看测试结果清楚地表明,这些测试失败了,因为所需的MEX文件缺少。当然!我们需要一个构建步骤。为此,我们可以利用插件提供的另一个构建步骤来运行任意MATLAB命令。该存储库非常完美地配置为具有构建所有MEX文件的简单方法,并且是一个称为的函数compileall。Put a call to that function, preceded by a call to open the project, in a build step prior to running the tests and that's all we need to do.

因此,我们走了,这就是我们可以使用Jenkins插件快速,轻松地设置MATLAB的方式。这是如此简单,以至于很容易意识到这是您购买的一些东西:

  1. 快速简便地生产MATLAB和SIMULINK CI工件金宝app
  2. Minimal CI configuration
  3. 无需了解为CI构建启动MATLAB的“最佳方法”。您将不再忘记尝试/捕捉或尝试记住17B中所需的精确MATLAB启动选项,以便在CI中运行MATLAB的最佳方式
  4. 金宝app支持测试工作流程回到13B,甚至支持矩阵构建,用于测试不同平台上不同版本的MATLAB。您需要指定的只是要使用的MATLAB命令或测试配置。所有其他插件都为您处理。

There ya go, the Jenkins plugin always doing its part to help improve your CI workflows with MATLAB and Simulink.

我们还听到了一些不使用Jenkins并且对其他CI平台和服务感兴趣的人的消息。请放心,我们还在努力支持其他平台,还有更多的博客。金宝app您有兴趣了解更多有关CI平台的信息?




Published with MATLAB® R2020b

|
  • 打印
  • 发送电子邮件

コメント

コメントを残すは,ここをクリックして MathWorks アカウントにサインインするか新しい MathWorks アカウントを作成します。