Skip to content

Commit fe98514

Browse files
committed
move test summary and log grouping to common-utils
1 parent 5947a9e commit fe98514

File tree

13 files changed

+372
-2770
lines changed

13 files changed

+372
-2770
lines changed

package-lock.json

Lines changed: 364 additions & 1284 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"dependencies": {
2222
"@actions/core": "^1.11.1",
2323
"@actions/exec": "^1.1.1",
24-
"run-matlab-command-action": "github:matlab-actions/run-command#v2.2.1"
24+
"run-matlab-command-action": "github:matlab-actions/run-command#v2.2.1",
25+
"common-utils": "github:matlab-actions/common-utils#kapilg/refactor"
2526
},
2627
"devDependencies": {
2728
"@types/jest": "^30.0.0",

plugins/+ciplugins/+github/GitHubLogPlugin.m

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

plugins/+ciplugins/+github/TestResultsSummaryPlugin.m

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

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

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

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

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

scripts/setupdeps.sh

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,8 @@
11
#!/bin/bash
22

3-
# Temporarily using a snapshot build of scriptgen until the official release is available
4-
# TODO: Before merging to main branch, Update to official release URL when available
5-
# SCRIPTGEN_URL='https://ssd.mathworks.com/supportfiles/ci/matlab-script-generator/v0/matlab-script-generator.zip'
6-
SCRIPTGEN_URL='https://mw-ci-static-dev.s3.us-east-1.amazonaws.com/matlab-script-generator/v0/matlab-script-generator-0.13.0-SNAPSHOT.zip'
7-
RMC_BASE_URL='https://ssd.mathworks.com/supportfiles/ci/run-matlab-command/v2'
8-
SUPPORTED_OS=('win64' 'maci64' 'maca64' 'glnxa64')
3+
source ./node_modules/common-utils/scripts/setupdeps.sh
94

10-
# Create dist directory if it doesn't already exist
11-
DISTDIR="$(pwd)/dist"
12-
mkdir -p $DISTDIR/bin
13-
14-
# Create plugins directory and copy plugin code
15-
cp -R plugins $(pwd)/dist/
16-
17-
# Download and extract in a temporary directory
18-
WORKINGDIR=$(mktemp -d -t rmc_build.XXXXXX)
19-
cd $WORKINGDIR
20-
21-
wget -O "$WORKINGDIR/license.txt" "$RMC_BASE_URL/license.txt"
22-
wget -O "$WORKINGDIR/thirdpartylicenses.txt" "$RMC_BASE_URL/thirdpartylicenses.txt"
23-
24-
for os in ${SUPPORTED_OS[@]}
25-
do
26-
if [[ $os == 'win64' ]] ; then
27-
bin_ext='.exe'
28-
else
29-
bin_ext=''
30-
fi
31-
mkdir -p "$WORKINGDIR/$os"
32-
wget -O "$WORKINGDIR/$os/run-matlab-command$bin_ext" "$RMC_BASE_URL/$os/run-matlab-command$bin_ext"
33-
done
5+
SCRIPTGEN_URL='https://ssd.mathworks.com/supportfiles/ci/matlab-script-generator/v0/matlab-script-generator.zip'
346

357
wget -O scriptgen.zip $SCRIPTGEN_URL
368
unzip -qod scriptgen scriptgen.zip
@@ -39,4 +11,3 @@ rm scriptgen.zip
3911

4012
mv -f ./* "$DISTDIR/bin"
4113
rm -rf $WORKINGDIR
42-

src/index.ts

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
// Copyright 2020-2023 The MathWorks, Inc.
1+
// Copyright 2020-2025 The MathWorks, Inc.
22

33
import * as core from "@actions/core";
44
import * as exec from "@actions/exec";
55
import { matlab } from "run-matlab-command-action";
66
import * as scriptgen from "./scriptgen";
7-
import * as testResultsSummary from "./testResultsSummary";
7+
import { testResultsSummary } from "common-utils";
88
import * as path from "path";
99

1010
/**
@@ -32,23 +32,14 @@ async function run() {
3232

3333
const pluginsPath = path.join(__dirname, "plugins").replaceAll("'","''");
3434
const command = "addpath('"+ pluginsPath +"'); " + scriptgen.generateCommand(options);
35-
// TODO: Remove these lines before merging to main branch
36-
// "import matlab.unittest.TestRunner;" +
37-
// "addpath(genpath('sample'));" +
38-
// "suite = testsuite(pwd, 'IncludeSubfolders', true);" +
39-
// "runner = TestRunner.withDefaultPlugins();" +
40-
// "results = runner.run(suite);" +
41-
// "results = runner.run(suite);" +
42-
// "display(results);" +
43-
// "assertSuccess(results);";
4435
const startupOptions = core.getInput("startup-options").split(" ");
4536

4637
const helperScript = await matlab.generateScript(workspaceDir, command);
4738
core.info("Successfully generated test script!");
4839

4940
await matlab.runCommand(helperScript, platform, architecture, exec.exec, startupOptions).finally(() => {
50-
const { testResults, stats } = testResultsSummary.getTestResults();
51-
testResultsSummary.writeSummary(testResults, stats);
41+
const testResultsData = testResultsSummary.getTestResults(process.env.RUNNER_TEMP || '', process.env.GITHUB_RUN_ID || '', workspaceDir);
42+
testResultsSummary.writeSummary(testResultsData, process.env.GITHUB_ACTION || '');
5243
});
5344
}
5445

src/test-data/testResultsArtifacts/t1/linux/matlabTestResults.json

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

0 commit comments

Comments
 (0)