Skip to content

Commit

Permalink
Updated build.yml and testToolbox based on failures
Browse files Browse the repository at this point in the history
  • Loading branch information
MWSestabro committed Apr 12, 2024
1 parent 93438b8 commit 5addbb8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,7 @@ jobs:
with:
source-folder: install/+opentelemetry
code-coverage-cobertura: cobertura.xml
uses: codecov/codecov-action@v4
token: ${{ secrets.CODECOV_TOKEN }}
slug: mathworks/OpenTelemetry-Matlab
file: cobertura.xml
17 changes: 10 additions & 7 deletions testToolbox.m
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
suite = testsuite(fullfile('test/'));
runner = testrunner("textoutput");
import matlab.unittest.TestRunner
import matlab.unittest.Verbosity
import matlab.unittest.plugins.CodeCoveragePlugin
import matlab.unittest.plugins.codecoverage.CoverageReport
import matlab.unittest.plugins.codecoverage.CoberturaFormat

sourceFile = fullfile('install','+opentelemetry');
suite = testsuite(fullfile('test/'));
runner = TestRunner.withTextOutput("OutputDetail",Verbosity.Detailed);

sourceFile = fullfile('install');

reportFile = fullfile("cobertura.xml");
reportFormat = CoberturaFormat(reportFile);
p = CodeCoveragePlugin.forFolder(sourceFile,'IncludingSubfolders',true,'Producing',reportFormat);
runner.addPlugin(p);
result = runner.run(suite);

result.assertSuccess()
results = runner.run(suite);
nfailed = nnz([results.Failed]);
assert(nfailed == 0,[num2str(nfailed) ' test(s) failed.'])

0 comments on commit 5addbb8

Please sign in to comment.