-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance Build and Test Results Visualization using Service Messages (#39
- Loading branch information
Showing
10 changed files
with
128 additions
and
3 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
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
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
18 changes: 18 additions & 0 deletions
18
matlab-plugin-agent/src/main/resources/+ciplugins/+teamcity/BuildVisualizationPlugin.m
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
classdef BuildVisualizationPlugin < matlab.buildtool.plugins.BuildRunnerPlugin | ||
|
||
% Copyright 2025 The MathWorks, Inc. | ||
|
||
methods (Access=protected) | ||
|
||
function runTask(plugin, pluginData) | ||
disp("##teamcity[blockOpened name ='" + pluginData.TaskResults.Name + "']"); | ||
disp("##teamcity[progressStart 'Running " + pluginData.TaskResults.Name + " Task']"); | ||
|
||
[email protected](plugin, pluginData); | ||
|
||
disp("##teamcity[progressFinish 'Running " + pluginData.TaskResults.Name + " Task']"); | ||
disp("##teamcity[blockClosed name ='" + pluginData.TaskResults.Name + "']"); | ||
end | ||
|
||
end | ||
end |
27 changes: 27 additions & 0 deletions
27
matlab-plugin-agent/src/main/resources/+ciplugins/+teamcity/TestVisualizationPlugin.m
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
classdef TestVisualizationPlugin < matlab.unittest.plugins.TestRunnerPlugin | ||
|
||
% Copyright 2025 The MathWorks, Inc. | ||
|
||
methods (Access=protected) | ||
|
||
function runTest(plugin, pluginData) | ||
classAndTestName = strrep(pluginData.Name,"/","."); | ||
|
||
fprintf("##teamcity[testStarted name='%s' captureStandardOutput='true']", classAndTestName) | ||
|
||
% Invoke super class method to run the test | ||
[email protected](plugin, pluginData); | ||
|
||
result = pluginData.TestResult; | ||
|
||
if result.Failed | ||
fprintf("##teamcity[testFailed name='%s' status='ERROR']", classAndTestName); | ||
elseif result.Incomplete | ||
fprintf("##teamcity[testIgnored name='%s']", classAndTestName); | ||
end | ||
|
||
fprintf("##teamcity[testFinished name='%s' duration='%f']", classAndTestName, result.Duration) | ||
end | ||
|
||
end | ||
end |
13 changes: 13 additions & 0 deletions
13
matlab-plugin-agent/src/main/resources/+ciplugins/+teamcity/getDefaultPlugins.m
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
function plugins = getDefaultPlugins(pluginProviderData) | ||
|
||
% Copyright 2025 The MathWorks, Inc. | ||
|
||
arguments | ||
pluginProviderData (1,1) struct = struct(); | ||
end | ||
|
||
plugins = [ ... | ||
matlab.buildtool.internal.getFactoryDefaultPlugins(pluginProviderData) ... | ||
ciplugins.teamcity.BuildVisualizationPlugin() ... | ||
]; | ||
end |
9 changes: 9 additions & 0 deletions
9
...resources/+matlab/+unittest/+internal/+services/+plugins/TestVisualizationPluginService.m
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
classdef TestVisualizationPluginService < matlab.buildtool.internal.services.ciplugins.CITestRunnerPluginService | ||
% Copyright 2025 The MathWorks, Inc. | ||
|
||
methods | ||
function plugins = providePlugins(~, ~) | ||
plugins = ciplugins.teamcity.TestVisualizationPlugin(); | ||
end | ||
end | ||
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