MATLAB: Obtain Coverage Report to Publish on Jira

jiraSimulink Coveragesimulink test

Hello All I am trying to obtain Coverage report which can be published on JIRA. I would like to use test manager file (.mldatx) as all my tests are there. For that purpose I was using a blog Coverage Matlab and Jira. The issue I faced is that there is no way to add a plugin for .mldatx file in CodeCoveragePlugin. Below is my code
% Run tests======================================
% Import Plugins

% Import Plugins
import matlab.unittest.TestRunner;
import matlab.unittest.TestSuite;
import matlab.unittest.plugins.TAPPlugin;
import matlab.unittest.plugins.ToFile;
% Disable Warnings
warning off Stateflow:Runtime:TestVerificationFailed;
warning off Stateflow:cdr:VerifyDangerousComparison;
% Create Test Runner
testRunnerLocal = TestRunner.withTextOutput;
if exist('testRunnerFile.tap', 'file')== 2
% Create a TAP plugin that sends output to the file testRunnerFile.tap.
tapFile = fullfile(getenv('WORKSPACE'), 'testRunnerFile.tap');
tapPlugin = TAPPlugin.producingVersion13(ToFile(tapFile));
% Add the plugin to the test runner.
% Add Coverage Plugin
coverageFile = fullfile(pwd, 'coverage.xml');
% HERE IS THE ISSUE, I tried fronFile and fromFolder
% Creating Test Suite
testSuite = testsuite('Test1.mldatx');
% Run the Tests
testResults =;
% Display results
catch exception
I am also attaching my files with it for access. Please leave a suggestion how to go about it.

Best Answer

Hi Abhishek, Using 2017b, we do not support to publish the model coverage report to CI server automatically. The best practice to have code coverage report for all the tests is using Test Manager. You can get the accumulated coverage automatically from all test cases.
Here is the document talking about enable collecting coverage in Test Manager.
In the "Coverage Results section", you can click the button under "REPORT" to open the html format model coverage report. Please see the below image for the button's location.