mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-06-02 16:21:01 +02:00
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.
This commit is contained in:
parent
80c8e62e65
commit
8d5fe521b3
@ -1148,6 +1148,7 @@ async function startBrowsers({ baseUrl, initializeSession, numSessions = 1 }) {
|
||||
})
|
||||
.catch(function (ex) {
|
||||
console.log(`Error while starting ${browserName}: ${ex.message}`);
|
||||
session.numErrors = 1;
|
||||
closeSession(sessionName);
|
||||
});
|
||||
}
|
||||
@ -1395,6 +1396,7 @@ async function main() {
|
||||
// because the teardown logic of the tests did not get a chance to run.
|
||||
console.error(e);
|
||||
await Promise.all(sessions.map(session => closeSession(session.name)));
|
||||
process.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user