Skip to content

Commit 75f1404

Browse files
committed
Do not reveal matlab-batch in log
1 parent 14ae9cb commit 75f1404

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

src/install.ts

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,22 @@ export async function install(platform: string, release: string, skipActivationF
2525
);
2626
}
2727

28-
// Invoke ephemeral installer to setup a MATLAB on the runner
29-
await core.group("Setting up MATLAB", () =>
30-
script
28+
// Set up MATLAB and matlab-batch
29+
await core.group("Setting up MATLAB", () => {
30+
const matlabResult = script
3131
.downloadAndRunScript(platform, properties.ephemeralInstallerUrl, [
3232
"--release",
3333
release,
34-
skipActivationFlag,
35-
])
36-
.then(ematlab.addToPath)
37-
);
34+
skipActivationFlag,])
35+
.then(ematlab.addToPath);
3836

39-
const batchInstallDir = matlabBatch.installDir(platform);
40-
41-
await core.group("Setting up matlab-batch", () =>
42-
script
37+
const batchInstallDir = matlabBatch.installDir(platform);
38+
39+
const batchResult = script
4340
.downloadAndRunScript(platform, properties.matlabBatchInstallerUrl, [batchInstallDir])
44-
.then(() => core.addPath(batchInstallDir))
45-
)
41+
.then(() => core.addPath(batchInstallDir));
42+
43+
return Promise.all([matlabResult, batchResult]);
44+
});
4645
return;
4746
}

src/install.unit.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ describe("install procedure", () => {
5959
it("rejects when executing the command returns with a non-zero code", async () => {
6060
downloadAndRunScriptMock
6161
.mockResolvedValueOnce(undefined)
62-
.mockRejectedValueOnce(Error("oof"));
62+
.mockRejectedValue(Error("oof"));
6363

6464
await expect(doInstall()).rejects.toBeDefined();
65-
expect(downloadAndRunScriptMock).toHaveBeenCalledTimes(2);
65+
expect(downloadAndRunScriptMock).toHaveBeenCalledTimes(3);
6666
expect(addToPathMock).toHaveBeenCalledTimes(0);
6767
expect(core.group).toHaveBeenCalledTimes(2);
6868
});
@@ -72,7 +72,7 @@ describe("install procedure", () => {
7272
addToPathMock.mockRejectedValueOnce(Error("oof"));
7373

7474
await expect(doInstall()).rejects.toBeDefined();
75-
expect(downloadAndRunScriptMock).toHaveBeenCalledTimes(2);
75+
expect(downloadAndRunScriptMock).toHaveBeenCalledTimes(3);
7676
expect(addToPathMock).toHaveBeenCalledTimes(1);
7777
});
7878

0 commit comments

Comments
 (0)