test: log more information in SEA tests

- Use spawnSyncAndExitWithoutError to log more information on error.
- Use NODE_DEBUG_NATIVE to log internals
- Skip the test when available disk space < 120MB

PR-URL: https://github.com/nodejs/node/pull/50759
Refs: https://github.com/nodejs/node/issues/50740
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
This commit is contained in:
Joyee Cheung authored and Michaël Zasso committed 2023-12-04 11:15:02 +01:00
1 parent 74f5a1cbc9
commit ac3a6eefe3
7 files changed
+106 -35

No files matched your search

@@ -14,7 +14,7 @@ skipIfSingleExecutableIsNotSupported();
const tmpdir = require('../common/tmpdir');
const { copyFileSync, writeFileSync, existsSync } = require('fs');
const { execFileSync } = require('child_process');
const { spawnSyncAndExitWithoutError } = require('../common/child_process');
const assert = require('assert');
const configFile = tmpdir.resolve('sea-config.json');
@@ -31,13 +31,22 @@ writeFileSync(configFile, `
}
`);
execFileSync(process.execPath, ['--experimental-sea-config', 'sea-config.json'], {
cwd: tmpdir.path
});
spawnSyncAndExitWithoutError(
process.execPath,
['--experimental-sea-config', 'sea-config.json'],
{ cwd: tmpdir.path });
assert(existsSync(seaPrepBlob));
copyFileSync(process.execPath, outputFile);
injectAndCodeSign(outputFile, seaPrepBlob);
execFileSync(outputFile);
spawnSyncAndExitWithoutError(
outputFile,
{
env: {
NODE_DEBUG_NATIVE: 'SEA',
...process.env,
}
},
{});