test: skip SEA tests when SEA generation fails

In the SEA tests, if any of these steps fail:

1. Copy the executable
2. Inject the SEA blob
3. Signing the SEA

We skip the test because the error likely comes from the system or
postject and is not something the Node.js core can fix. We only leave
an exception for a basic test that test injecting empty files as
SEA to ensure the workflow is working (but we still skip if copying
fails or signing fails on Windows).

PR-URL: https://github.com/nodejs/node/pull/51887
Refs: https://github.com/nodejs/node/issues/49630
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit is contained in:
Joyee Cheung authored and Richard Lau committed 2024-03-25 19:28:29 +00:00
1 parent 9b164c6eec
commit f37648ee5c
10 files changed
+99 -63

No files matched your search

@@ -3,7 +3,7 @@
require('../common');
const {
injectAndCodeSign,
generateSEA,
skipIfSingleExecutableIsNotSupported,
} = require('../common/sea');
@@ -56,8 +56,7 @@ spawnSyncAndExitWithoutError(
assert(existsSync(seaPrepBlob));
copyFileSync(process.execPath, outputFile);
injectAndCodeSign(outputFile, seaPrepBlob);
generateSEA(outputFile, process.execPath, seaPrepBlob);
spawnSyncAndExitWithoutError(
outputFile,