Skip to content

Commit e4400b4

Browse files
committed
changes
1 parent 64f86bc commit e4400b4

5 files changed

Lines changed: 6 additions & 95 deletions

File tree

plugins/+matlab/+unittest/+internal/+services/+plugins/CodeCoverageSummaryPluginService.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
% Check if MATLAB Test license is available
88
if license('test', 'matlab_test')
99

10-
% Get metric level from environment variable
10+
% Get metric level from environment variable
1111
metricLevel = getenv('INPUT_CODE_COVERAGE_METRIC_LEVEL');
1212

1313
% Create a shared CoverageResult format object

plugins/+testframework/CodeCoverageSummaryPlugin.m

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,27 +59,22 @@ function runSession(plugin, pluginData)
5959
end
6060

6161
% Determine file path for coverage results
62-
if ~isempty(getenv("RUNNER_TEMP")) && ~isempty(getenv("GITHUB_RUN_ID"))
63-
% GitHub Actions environment
64-
coverageArtifactFile = fullfile(getenv("RUNNER_TEMP"), "matlabCoverageResults" + getenv("GITHUB_RUN_ID") + ".json");
65-
else
66-
% Local environment
67-
coverageArtifactFile = fullfile(pwd, "matlabCoverageResults.json");
68-
end
62+
coverageArtifactFile = fullfile(getenv("RUNNER_TEMP"), "matlabCoverageResults" + getenv("GITHUB_RUN_ID") + ".json");
63+
6964
coverageResults = {coverageDetails};
7065

7166
try
7267
JsonCoverageResults = jsonencode(coverageResults, "PrettyPrint", true);
7368

7469
[fID, msg] = fopen(coverageArtifactFile, "w");
7570
if fID == -1
76-
warning("testframework:CodeCoverageSummaryPlugin:UnableToOpenFile","Unable to open a file required to create the table of code coverage. (Cause: %s)", msg);
71+
warning("testframework:CodeCoverageSummaryPlugin:UnableToOpenFile","Unable to open a file required to show code coverage data. (Cause: %s)", msg);
7772
else
7873
closeFile = onCleanup(@()fclose(fID));
7974
fprintf(fID, '%s', JsonCoverageResults);
8075
end
8176
catch e
82-
warning("testframework:TestResultsSummaryPlugin:UnableToJsonEncode","Unable to jsonencode test results data. (Cause: %s)", e.message);
77+
warning("testframework:CodeCoverageSummaryPlugin:UnableToJsonEncode","Unable to jsonencode code coverage data. (Cause: %s)", e.message);
8378
end
8479
end
8580
end

sample/CircleCalculator.m

Lines changed: 0 additions & 53 deletions
This file was deleted.

sample/CircleCalculatorTest.m

Lines changed: 0 additions & 31 deletions
This file was deleted.

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ async function run() {
4949
...process.env,
5050
MW_BATCH_LICENSING_ONLINE:'true', // Remove when online batch licensing is the default
5151
INPUT_CODE_COVERAGE_METRIC_LEVEL: codeCoverageMetricLevel,
52-
INPUT_SOURCE_FOLDER: options.SourceFolder || '' // Add source folder to environment
52+
INPUT_SOURCE_FOLDER: options.SourceFolder // Add source folder to environment
5353
}
5454
};
5555
core.info("Successfully generated test script!");

0 commit comments

Comments
 (0)