-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add skip reason for skipped tasks in build summary table (#49)
* add skip reason * update test * fix build summary plugin * Add 25a enum name compatibility * update as per review comments * fix test failure * Use user requested for both UserSpecified and UserRequested * add a couple more unit tests * Update properties access level * update build summary table * update status to succeeded
- Loading branch information
Showing
3 changed files
with
57 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,27 +2,46 @@ | |
|
||
% Copyright 2024 The MathWorks, Inc. | ||
|
||
methods (Access=protected) | ||
properties (Access=private) | ||
TaskDetails = {}; | ||
end | ||
|
||
methods (Access=protected) | ||
function runTaskGraph(plugin, pluginData) | ||
[email protected](plugin, pluginData); | ||
[fID, msg] = fopen(fullfile(getenv("RUNNER_TEMP") ,"buildSummary" + getenv("GITHUB_RUN_ID") + ".json"), "w"); | ||
|
||
[fID, msg] = fopen(fullfile(getenv("RUNNER_TEMP") ,"buildSummary" + getenv("GITHUB_RUN_ID") + ".json"), "w"); | ||
if fID == -1 | ||
warning("ciplugins:github:BuildSummaryPlugin:UnableToOpenFile","Unable to open a file required to create the MATLAB build summary table: %s", msg); | ||
else | ||
closeFile = onCleanup(@()fclose(fID)); | ||
taskDetails = struct(); | ||
for idx = 1:numel(pluginData.TaskResults) | ||
taskDetails(idx).name = pluginData.TaskResults(idx).Name; | ||
taskDetails(idx).description = pluginData.TaskGraph.Tasks(idx).Description; | ||
taskDetails(idx).failed = pluginData.TaskResults(idx).Failed; | ||
taskDetails(idx).skipped = pluginData.TaskResults(idx).Skipped; | ||
taskDetails(idx).duration = string(pluginData.TaskResults(idx).Duration); | ||
end | ||
s = jsonencode(taskDetails); | ||
s = jsonencode(plugin.TaskDetails); | ||
fprintf(fID, "%s",s); | ||
end | ||
end | ||
|
||
function runTask(plugin, pluginData) | ||
[email protected](plugin, pluginData); | ||
|
||
taskDetail = getCommonTaskDetail(pluginData); | ||
plugin.TaskDetails = [plugin.TaskDetails, taskDetail]; | ||
end | ||
|
||
function skipTask(plugin, pluginData) | ||
[email protected](plugin, pluginData); | ||
|
||
taskDetail = getCommonTaskDetail(pluginData); | ||
taskDetail.skipReason = pluginData.SkipReason; | ||
plugin.TaskDetails = [plugin.TaskDetails, taskDetail]; | ||
end | ||
end | ||
end | ||
|
||
function taskDetail = getCommonTaskDetail(pluginData) | ||
taskDetail = struct(); | ||
taskDetail.name = pluginData.TaskResults.Name; | ||
taskDetail.description = pluginData.TaskGraph.Tasks.Description; | ||
taskDetail.failed = pluginData.TaskResults.Failed; | ||
taskDetail.skipped = pluginData.TaskResults.Skipped; | ||
taskDetail.duration = string(pluginData.TaskResults.Duration); | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters