Skip to content

Commit 34ec70b

Browse files
committed
update artifact name
1 parent 1fc32c9 commit 34ec70b

File tree

3 files changed

+6
-22
lines changed

3 files changed

+6
-22
lines changed

plugins/+ciplugins/+github/TestResultsSummaryPlugin.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function reportFinalizedSuite(plugin, pluginData)
1313
end
1414

1515
% If test results artifact exists, update the same file
16-
testArtifactFile = fullfile(getenv("RUNNER_TEMP"), "matlabTestResults_" + getenv("GITHUB_RUN_ID") + "_" + getenv("GITHUB_ACTION") + ".json");
16+
testArtifactFile = fullfile(getenv("RUNNER_TEMP"), "matlabTestResults" + getenv("GITHUB_RUN_ID") + ".json");
1717
if isfile(testArtifactFile)
1818
testResults = {jsondecode(fileread(testArtifactFile))};
1919
else

src/testResultsSummary.ts

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@ export function getStatusEmoji(status: MatlabTestStatus): string {
199199
export function getTestResults(
200200
runnerTemp: string,
201201
runId: string,
202-
actionName: string,
203202
workspace: string,
204203
): TestResultsData {
205204
const testResults: MatlabTestFile[][] = [];
@@ -215,20 +214,7 @@ export function getTestResults(
215214
TestResults: testResults,
216215
Stats: stats,
217216
};
218-
const resultsPath = path.join(runnerTemp, `matlabTestResults_${runId}_${actionName}.json`);
219-
220-
try {
221-
const fs = require('fs');
222-
core.info(`Contents of runnerTemp directory (${runnerTemp}):`);
223-
const files = fs.readdirSync(runnerTemp);
224-
files.forEach((file: string) => {
225-
const filePath = path.join(runnerTemp, file);
226-
const stats = fs.statSync(filePath);
227-
core.info(`- ${file} (${stats.isDirectory() ? 'directory' : 'file'}, ${stats.size} bytes)`);
228-
});
229-
} catch (listError) {
230-
core.info(`Error listing files in runnerTemp directory: ${listError}`);
231-
}
217+
const resultsPath = path.join(runnerTemp, `matlabTestResults${runId}.json`);
232218

233219
if (existsSync(resultsPath)) {
234220
try {
@@ -263,8 +249,6 @@ export function getTestResults(
263249
);
264250
}
265251
}
266-
} else {
267-
console.warn(`Test results summary file ${resultsPath} does not exist.`);
268252
}
269253

270254
return testResultsData;

src/testResultsSummary.unit.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe("Artifact Processing Tests", () => {
3434

3535
copyTestDataFile(osInfo.osName, runnerTemp, runId, actionName);
3636

37-
testResultsData = testResultsSummary.getTestResults(runnerTemp, runId, actionName, workspace);
37+
testResultsData = testResultsSummary.getTestResults(runnerTemp, runId, workspace);
3838
testResults = testResultsData.TestResults;
3939
stats = testResultsData.Stats;
4040
});
@@ -58,7 +58,7 @@ describe("Artifact Processing Tests", () => {
5858
osName,
5959
"matlabTestResults.json",
6060
);
61-
const destinationFilePath = path.join(runnerTemp, "matlabTestResults_" + runId + "_" + actionName + ".json");
61+
const destinationFilePath = path.join(runnerTemp, "matlabTestResults" + runId + ".json");
6262

6363
try {
6464
fs.copyFileSync(sourceFilePath, destinationFilePath);
@@ -363,7 +363,7 @@ describe("Error Handling Tests", () => {
363363
process.env.GITHUB_ACTION = "run-tests";
364364

365365
// Create a file with invalid JSON
366-
const invalidJsonPath = path.join(process.env.RUNNER_TEMP, "matlabTestResults_123_run-tests.json");
366+
const invalidJsonPath = path.join(process.env.RUNNER_TEMP, "matlabTestResults123.json");
367367
fs.writeFileSync(invalidJsonPath, "{ invalid json content");
368368

369369
try {
@@ -413,7 +413,7 @@ describe("Error Handling Tests", () => {
413413
process.env.GITHUB_ACTION = "run-tests";
414414

415415
// Create a valid JSON file
416-
const validJsonPath = path.join(process.env.RUNNER_TEMP, "matlabTestResults_123_run-tests.json");
416+
const validJsonPath = path.join(process.env.RUNNER_TEMP, "matlabTestResults123.json");
417417
fs.writeFileSync(validJsonPath, "[]"); // Empty array - valid JSON
418418

419419
try {

0 commit comments

Comments
 (0)