Skip to content

Commit 8d5fe52

Browse files
committed
Fix missing non-zero exit code for failure cases in test.mjs
The two affected code paths caught and logged errors, but that wasn't reflected in the exit code of the process, and that is what GitHub Actions (and other tools) to determine if process execution was successful or not. This commit fixes the issue by making sure we consistently exit with code 1 in case of errors so that GitHub Actions pipelines correctly reflect the outcome of the test run.
1 parent 80c8e62 commit 8d5fe52

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

test/test.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,6 +1148,7 @@ async function startBrowsers({ baseUrl, initializeSession, numSessions = 1 }) {
11481148
})
11491149
.catch(function (ex) {
11501150
console.log(`Error while starting ${browserName}: ${ex.message}`);
1151+
session.numErrors = 1;
11511152
closeSession(sessionName);
11521153
});
11531154
}
@@ -1395,6 +1396,7 @@ async function main() {
13951396
// because the teardown logic of the tests did not get a chance to run.
13961397
console.error(e);
13971398
await Promise.all(sessions.map(session => closeSession(session.name)));
1399+
process.exit(1);
13981400
}
13991401
}
14001402

0 commit comments

Comments
 (0)