Skip to content

Commit

Permalink
test results failed in pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
ebenetce committed Dec 6, 2023
1 parent 8cf7b93 commit c5995d9
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 19 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ jobs:
name: MatSDMX
path: |
MATLAB/releases/SDMX.mltbx
if-no-files-found: error
- name: Setup Pages
uses: actions/configure-pages@v3
Expand Down
44 changes: 29 additions & 15 deletions MATLAB/buildfile.m
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@
% Create a plan from task functions
plan = buildplan(localfunctions);

% Default test output to false
% plan("test").Outpbuts = "test";

% Make the "archive" task the default task in the plan
plan.DefaultTasks = "archive";

% Make the "archive" task dependent on the "check" and "test" tasks
plan("archive").Dependencies = ["check" "test"];

plan("archive").Inputs = 'tests/reports/testresults.csv';
end

function checkTask(~)
Expand Down Expand Up @@ -44,22 +49,31 @@ function testTask(~)

results = runner.run(suite);

assertSuccess(results);
results = table(results);
writetable(results(:,1:3), 'tests/reports/testresults.csv')

end

function archiveTask(tc)

testResults = readtable( tc.Task.Inputs.Path);
if ~all(testResults.Passed)
return
else

description = sprintf('The SDMX Connectors project has been developed with the aim of covering the ''last mile'' in SDMX implementations.\n\nIn particular, the focus of the project is to provide the end user a set of plugins that can be easily installed in the most popular data analysis tools (e.g. R, MATLAB, SAS, STATA, Excel, etc.) allowing a direct access to SDMX data from the tool.\nProject site: \n\nhttps://github.com/amattioc/SDMX');
% Create ZIP file
opts = matlab.addons.toolbox.ToolboxOptions('tbx', "50de8506-6d87-47ee-aa8a-2c7f2e56d761", ...
ToolboxName = 'MatSDMX', ...
ToolboxVersion = '4.0.0', ...
AuthorName = 'Attilio Mattiocco', ...
Summary = 'Provides functions to retrieve data and metadata from providers that disseminate data by means of SDMX web services.', ...
Description = description, ...
ToolboxJavaPath = "tbx/lib/SDMX.jar", ...
ToolboxGettingStartedGuide = 'tbx/doc/GettingStarted.mlx', ...
OutputFile = 'releases/SDMX.mltbx', ...
MinimumMatlabRelease = 'R2023a');
matlab.addons.toolbox.packageToolbox(opts)
end

function archiveTask(~)
description = sprintf('The SDMX Connectors project has been developed with the aim of covering the ''last mile'' in SDMX implementations.\n\nIn particular, the focus of the project is to provide the end user a set of plugins that can be easily installed in the most popular data analysis tools (e.g. R, MATLAB, SAS, STATA, Excel, etc.) allowing a direct access to SDMX data from the tool.\nProject site: \n\nhttps://github.com/amattioc/SDMX');
% Create ZIP file
opts = matlab.addons.toolbox.ToolboxOptions('tbx', "50de8506-6d87-47ee-aa8a-2c7f2e56d761", ...
ToolboxName = 'MatSDMX', ...
ToolboxVersion = '4.0.0', ...
AuthorName = 'Attilio Mattiocco', ...
Summary = 'Provides functions to retrieve data and metadata from providers that disseminate data by means of SDMX web services.', ...
Description = description, ...
ToolboxJavaPath = "tbx/lib/SDMX.jar", ...
ToolboxGettingStartedGuide = 'tbx/doc/GettingStarted.mlx', ...
OutputFile = 'releases/SDMX.mltbx', ...
MinimumMatlabRelease = 'R2023a');
matlab.addons.toolbox.packageToolbox(opts)
end
6 changes: 3 additions & 3 deletions MATLAB/tests/testSDMX.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function tGetFlows(tc)
% Test 2: getFlows
flows = sdmx.getFlows('ECB');
tc.verifyNotEmpty(flows)
tc.verifyEqual(flows('ECB,EXR,1.0'), "Exchange Rates")
tc.verifyEqual(flows('ECB,EXR,1.0'), "Exchange Rate")
end

function tGetDimensions(tc)
Expand Down Expand Up @@ -140,8 +140,8 @@ function tGetDSDIdentifier(tc)
end

function tGetSDMXTable(tc)
% getSDMXTable
% Test 10: getSDMXTable

tts = sdmx.getTimeSeries('ECB', 'EXR.M.USD|GBP.EUR.SP00.A');
tb = sdmxtable(tts, true);
tc.verifyClass(tb, 'table')
Expand Down

0 comments on commit c5995d9

Please sign in to comment.