Skip to content

Commit 810458f

Browse files
committed
Fix bug with inconsistent return from loadResults
This would return an object with an `engines` key if returning early, and an `orderedEngines` key if returning at the end of the function. Fix this so the key is always named `engines`.
1 parent 72579ec commit 810458f

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

‎tools/misc/build-results-comment.mjs‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,21 +76,21 @@ function loadResults() {
7676
}
7777
}
7878

79-
const orderedEngines = engines.sort();
80-
return { orderedEngines, testResults, errors };
79+
engines.sort();
80+
return { engines, testResults, errors };
8181
}
8282

83-
function buildCommentBody({ orderedEngines, testResults, errors }) {
83+
function buildCommentBody({ engines, testResults, errors }) {
8484
const errorList = errors.length ? "\n\nErrors encountered:" + errors.map(s => `\n- ${s}`).join("") : "";
85-
if (orderedEngines.length === 0) {
85+
if (engines.length === 0) {
8686
return `No engine results were produced.${errorList}`;
8787
}
8888

8989
const sortedTests = Array.from(testResults.keys()).sort();
90-
const table = buildMarkdownTable(sortedTests, orderedEngines, testResults);
90+
const table = buildMarkdownTable(sortedTests, engines, testResults);
9191
const summary =
9292
`${sortedTests.length} new or modified ${sortedTests.length === 1 ? "test" : "tests"} ` +
93-
`were run on ${orderedEngines.length} ${orderedEngines.length === 1 ? "engine" : "engines"}.`;
93+
`were run on ${engines.length} ${engines.length === 1 ? "engine" : "engines"}.`;
9494
const link = WORKFLOW_RUN_URL ? `\n\n[View workflow run](${WORKFLOW_RUN_URL})` : '';
9595

9696
return `${summary}${link}${errorList}\n\n${table}`;

0 commit comments

Comments
 (0)