test: move sea tests into test/sea

This makes skipping/running these tests easier to manage with a
dedicated test runner that can be tweaked for SEA.

PR-URL: https://github.com/nodejs/node/pull/60250
Refs: https://github.com/nodejs/node/issues/59553
Reviewed-By: Richard Lau <richard.lau@ibm.com>
Reviewed-By: Ulises Gascón <ulisesgascongonzalez@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
This commit is contained in:
Joyee Cheung authored and Antoine du Hamel committed 2025-11-07 18:11:31 +01:00
1 parent eb8a0493d1
commit cedba09e60
24 files changed
+105 -107

No files matched your search

+1 -2
View File
@@ -158,8 +158,7 @@
/doc/contributing/maintaining/maintaining-single-executable-application-support.md @nodejs/single-executable
/src/node_sea* @nodejs/single-executable
/test/fixtures/postject-copy @nodejs/single-executable
/test/parallel/test-single-executable-* @nodejs/single-executable
/test/sequential/test-single-executable-* @nodejs/single-executable
/test/sea @nodejs/single-executable
/tools/dep_updaters/update-postject.sh @nodejs/single-executable
# Permission Model
+38
View File
@@ -0,0 +1,38 @@
prefix sea
# To mark a test as flaky, list the test name in the appropriate section
# below, without ".js", followed by ": PASS,FLAKY". Example:
# sample-test : PASS,FLAKY
[true] # This section applies to all platforms
[$system==macos && $arch==x64]
# https://github.com/nodejs/node/issues/59553
test-single-executable-application: PASS, FLAKY
test-single-executable-application-assets: PASS, FLAKY
test-single-executable-application-assets-raw: PASS, FLAKY
test-single-executable-application-asset-keys-empty: PASS, FLAKY
test-single-executable-application-asset-keys: PASS, FLAKY
test-single-executable-application-disable-experimental-sea-warning: PASS, FLAKY
test-single-executable-application-empty: PASS, FLAKY
test-single-executable-application-exec-argv: PASS, FLAKY
test-single-executable-application-exec-argv-empty: PASS, FLAKY
test-single-executable-application-exec-argv-extension-cli: PASS, FLAKY
test-single-executable-application-exec-argv-extension-env: PASS, FLAKY
test-single-executable-application-exec-argv-extension-none: PASS, FLAKY
test-single-executable-application-inspect-in-sea-flags: PASS, FLAKY
test-single-executable-application-inspect: PASS, FLAKY
test-single-executable-application-snapshot: PASS, FLAKY
test-single-executable-application-snapshot-and-code-cache: PASS, FLAKY
test-single-executable-application-snapshot-worker: PASS, FLAKY
test-single-executable-application-use-code-cache: PASS, FLAKY
[$system==linux && $arch==ppc64]
# https://github.com/nodejs/node/issues/59561
test-single-executable-application*: SKIP
[$system==win32]
# https://github.com/nodejs/node/issues/49630
test-single-executable-application-snapshot: PASS, FLAKY
test-single-executable-application-snapshot-and-code-cache: PASS, FLAKY
@@ -43,7 +43,7 @@ spawnSyncAndExitWithoutError(
NODE_DEBUG_NATIVE: 'SEA',
...process.env,
},
cwd: tmpdir.path
cwd: tmpdir.path,
},
{});
@@ -57,9 +57,9 @@ spawnSyncAndAssert(
env: {
...process.env,
NODE_DEBUG_NATIVE: 'SEA',
}
},
},
{
stdout: /Asset keys: \[\]/,
}
},
);
@@ -52,7 +52,7 @@ spawnSyncAndExitWithoutError(
NODE_DEBUG_NATIVE: 'SEA',
...process.env,
},
cwd: tmpdir.path
cwd: tmpdir.path,
},
{});
@@ -66,9 +66,9 @@ spawnSyncAndAssert(
env: {
...process.env,
NODE_DEBUG_NATIVE: 'SEA',
}
},
},
{
stdout: /Asset keys: \["asset-1\.txt","asset-2\.txt","asset-3\.txt"\]/,
}
},
);
@@ -50,7 +50,7 @@ const outputFile = tmpdir.resolve(process.platform === 'win32' ? 'sea.exe' : 'se
NODE_DEBUG_NATIVE: 'SEA',
...process.env,
},
cwd: tmpdir.path
cwd: tmpdir.path,
});
assert(existsSync(seaPrepBlob));
@@ -64,7 +64,7 @@ const outputFile = tmpdir.resolve(process.platform === 'win32' ? 'sea.exe' : 'se
...process.env,
NODE_DEBUG_NATIVE: 'SEA',
__TEST_PERSON_JPG: fixtures.path('person.jpg'),
}
},
},
);
}
@@ -45,12 +45,12 @@ const outputFile = tmpdir.resolve(process.platform === 'win32' ? 'sea.exe' : 'se
process.execPath,
['--experimental-sea-config', 'sea-config.json'],
{
cwd: tmpdir.path
cwd: tmpdir.path,
},
{
status: 1,
signal: null,
stderr: /"assets" field of sea-config\.json is not a map of strings/
stderr: /"assets" field of sea-config\.json is not a map of strings/,
});
}
@@ -71,12 +71,12 @@ const outputFile = tmpdir.resolve(process.platform === 'win32' ? 'sea.exe' : 'se
process.execPath,
['--experimental-sea-config', 'sea-config.json'],
{
cwd: tmpdir.path
cwd: tmpdir.path,
},
{
status: 1,
signal: null,
stderr: /Cannot read asset nonexistent\.txt: no such file or directory/
stderr: /Cannot read asset nonexistent\.txt: no such file or directory/,
});
}
@@ -104,7 +104,7 @@ const outputFile = tmpdir.resolve(process.platform === 'win32' ? 'sea.exe' : 'se
NODE_DEBUG_NATIVE: 'SEA',
...process.env,
},
cwd: tmpdir.path
cwd: tmpdir.path,
});
assert(existsSync(seaPrepBlob));
@@ -119,11 +119,11 @@ const outputFile = tmpdir.resolve(process.platform === 'win32' ? 'sea.exe' : 'se
NODE_DEBUG_NATIVE: 'SEA',
__TEST_PERSON_JPG: fixtures.path('person.jpg'),
__TEST_UTF8_TEXT_PATH: fixtures.path('utf8_test_text.txt'),
}
},
},
{
trim: true,
stdout: fixtures.utf8TestText,
}
},
);
}
@@ -60,8 +60,8 @@ spawnSyncAndAssert(
COMMON_DIRECTORY: join(__dirname, '..', 'common'),
NODE_DEBUG_NATIVE: 'SEA',
...process.env,
}
},
},
{
stdout: 'Hello, world! 😊\n'
stdout: 'Hello, world! 😊\n',
});
@@ -59,5 +59,5 @@ spawnSyncAndExitWithoutError(
env: {
NODE_DEBUG_NATIVE: 'SEA',
...process.env,
}
},
});
@@ -54,8 +54,8 @@ spawnSyncAndAssert(
COMMON_DIRECTORY: join(__dirname, '..', 'common'),
NODE_DEBUG_NATIVE: 'SEA',
...process.env,
}
},
},
{
stdout: /empty execArgv test passed/
stdout: /empty execArgv test passed/,
});
@@ -56,8 +56,8 @@ spawnSyncAndAssert(
NODE_OPTIONS: '--max-old-space-size=2048', // Should be ignored
COMMON_DIRECTORY: join(__dirname, '..', 'common'),
NODE_DEBUG_NATIVE: 'SEA',
}
},
},
{
stdout: /execArgvExtension cli test passed/
stdout: /execArgvExtension cli test passed/,
});
@@ -56,7 +56,7 @@ spawnSyncAndAssert(
NODE_OPTIONS: '--max-old-space-size=512',
COMMON_DIRECTORY: join(__dirname, '..', 'common'),
NODE_DEBUG_NATIVE: 'SEA',
}
},
},
{
stdout: /execArgvExtension env test passed/,
@@ -64,5 +64,5 @@ spawnSyncAndAssert(
assert.doesNotMatch(output, /This warning should not be shown in the output/);
return true;
},
trim: true
trim: true,
});
@@ -56,8 +56,8 @@ spawnSyncAndAssert(
NODE_OPTIONS: '--max-old-space-size=2048',
COMMON_DIRECTORY: join(__dirname, '..', 'common'),
NODE_DEBUG_NATIVE: 'SEA',
}
},
},
{
stdout: /execArgvExtension none test passed/
stdout: /execArgvExtension none test passed/,
});
@@ -55,7 +55,7 @@ spawnSyncAndAssert(
NODE_NO_WARNINGS: '0',
COMMON_DIRECTORY: join(__dirname, '..', 'common'),
NODE_DEBUG_NATIVE: 'SEA',
}
},
},
{
stdout: /multiple execArgv test passed/,
@@ -38,7 +38,7 @@ writeFileSync(configFile, `
spawnSyncAndExitWithoutError(
process.execPath,
['--experimental-sea-config', 'sea-config.json'],
{ cwd: tmpdir.path }
{ cwd: tmpdir.path },
);
assert(existsSync(seaPrepBlob));
@@ -65,5 +65,5 @@ spawnSyncAndAssert(
return true;
},
trim: true,
}
},
);
@@ -38,7 +38,7 @@ writeFileSync(configFile, `
spawnSyncAndExitWithoutError(
process.execPath,
['--experimental-sea-config', 'sea-config.json'],
{ cwd: tmpdir.path }
{ cwd: tmpdir.path },
);
assert(existsSync(seaPrepBlob));
@@ -56,8 +56,8 @@ const outputFile = join(tmpdir.path, process.platform === 'win32' ? 'sea.exe' :
},
},
{
stderr: /"useCodeCache" is redundant when "useSnapshot" is true/
}
stderr: /"useCodeCache" is redundant when "useSnapshot" is true/,
},
);
assert(existsSync(seaPrepBlob));
@@ -70,7 +70,7 @@ const outputFile = join(tmpdir.path, process.platform === 'win32' ? 'sea.exe' :
env: {
NODE_DEBUG_NATIVE: 'SEA,MKSNAPSHOT',
...process.env,
}
},
}, {
stdout: 'Hello from snapshot',
trim: true,
@@ -70,11 +70,11 @@ const outputFile = tmpdir.resolve(process.platform === 'win32' ? 'sea.exe' : 'se
env: {
NODE_DEBUG_NATIVE: 'SEA',
...process.env,
}
},
},
{
trim: true,
stdout: 'Hello from Worker'
}
stdout: 'Hello from Worker',
},
);
}
@@ -39,12 +39,12 @@ const outputFile = tmpdir.resolve(process.platform === 'win32' ? 'sea.exe' : 'se
process.execPath,
['--experimental-sea-config', 'sea-config.json'],
{
cwd: tmpdir.path
cwd: tmpdir.path,
},
{
status: 1,
signal: null,
stderr: /snapshot\.js does not invoke v8\.startupSnapshot\.setDeserializeMainFunction\(\)/
stderr: /snapshot\.js does not invoke v8\.startupSnapshot\.setDeserializeMainFunction\(\)/,
});
}
@@ -80,7 +80,7 @@ const outputFile = tmpdir.resolve(process.platform === 'win32' ? 'sea.exe' : 'se
},
},
{
stderr: /Single executable application is an experimental feature/
stderr: /Single executable application is an experimental feature/,
});
assert(existsSync(seaPrepBlob));
@@ -93,7 +93,7 @@ const outputFile = tmpdir.resolve(process.platform === 'win32' ? 'sea.exe' : 'se
env: {
NODE_DEBUG_NATIVE: 'SEA,MKSNAPSHOT',
...process.env,
}
},
},
{
trim: true,
@@ -102,7 +102,7 @@ const outputFile = tmpdir.resolve(process.platform === 'win32' ? 'sea.exe' : 'se
assert.doesNotMatch(
output,
/Single executable application is an experimental feature/);
}
}
},
},
);
}
@@ -66,8 +66,8 @@ spawnSyncAndAssert(
COMMON_DIRECTORY: join(__dirname, '..', 'common'),
NODE_DEBUG_NATIVE: 'SEA',
...process.env,
}
},
},
{
stdout: 'Hello, world! 😊\n'
stdout: 'Hello, world! 😊\n',
});
@@ -59,8 +59,8 @@ spawnSyncAndAssert(
COMMON_DIRECTORY: join(__dirname, '..', 'common'),
NODE_DEBUG_NATIVE: 'SEA',
...process.env,
}
},
},
{
stdout: 'Hello, world! 😊\n'
stdout: 'Hello, world! 😊\n',
});
@@ -16,7 +16,7 @@ const { spawnSyncAndAssert } = require('../common/child_process');
cwd: tmpdir.path,
}, {
status: 1,
stderr: /Cannot read single executable configuration from non-existent-relative\.json/
stderr: /Cannot read single executable configuration from non-existent-relative\.json/,
});
}
@@ -29,7 +29,7 @@ const { spawnSyncAndAssert } = require('../common/child_process');
cwd: tmpdir.path,
}, {
status: 1,
stderr: /Cannot read single executable configuration from .*non-existent-absolute\.json/
stderr: /Cannot read single executable configuration from .*non-existent-absolute\.json/,
});
}
@@ -43,7 +43,7 @@ const { spawnSyncAndAssert } = require('../common/child_process');
cwd: tmpdir.path,
}, {
status: 1,
stderr: /INCOMPLETE_ARRAY_OR_OBJECT/
stderr: /INCOMPLETE_ARRAY_OR_OBJECT/,
});
}
@@ -57,7 +57,7 @@ const { spawnSyncAndAssert } = require('../common/child_process');
cwd: tmpdir.path,
}, {
status: 1,
stderr: /"main" field of .*empty\.json is not a non-empty string/
stderr: /"main" field of .*empty\.json is not a non-empty string/,
});
}
@@ -71,7 +71,7 @@ const { spawnSyncAndAssert } = require('../common/child_process');
cwd: tmpdir.path,
}, {
status: 1,
stderr: /"main" field of .*no-main\.json is not a non-empty string/
stderr: /"main" field of .*no-main\.json is not a non-empty string/,
});
}
@@ -85,7 +85,7 @@ const { spawnSyncAndAssert } = require('../common/child_process');
cwd: tmpdir.path,
}, {
status: 1,
stderr: /"output" field of .*no-output\.json is not a non-empty string/
stderr: /"output" field of .*no-output\.json is not a non-empty string/,
});
}
@@ -105,7 +105,7 @@ const { spawnSyncAndAssert } = require('../common/child_process');
cwd: tmpdir.path,
}, {
status: 1,
stderr: /"disableExperimentalSEAWarning" field of .*invalid-disableExperimentalSEAWarning\.json is not a Boolean/
stderr: /"disableExperimentalSEAWarning" field of .*invalid-disableExperimentalSEAWarning\.json is not a Boolean/,
});
}
@@ -119,7 +119,7 @@ const { spawnSyncAndAssert } = require('../common/child_process');
cwd: tmpdir.path,
}, {
status: 1,
stderr: /Cannot read main script .*bundle\.js/
stderr: /Cannot read main script .*bundle\.js/,
});
}
@@ -129,7 +129,7 @@ const { spawnSyncAndAssert } = require('../common/child_process');
const main = tmpdir.resolve('bundle.js');
const configJson = JSON.stringify({
main,
output: 'sea.blob'
output: 'sea.blob',
});
writeFileSync(config, configJson, 'utf8');
spawnSyncAndAssert(
@@ -138,7 +138,7 @@ const { spawnSyncAndAssert } = require('../common/child_process');
cwd: tmpdir.path,
}, {
status: 1,
stderr: /Cannot read main script .*bundle\.js/
stderr: /Cannot read main script .*bundle\.js/,
});
}
@@ -160,7 +160,7 @@ const { spawnSyncAndAssert } = require('../common/child_process');
cwd: tmpdir.path,
}, {
status: 1,
stderr: /Cannot write output to .*output-dir/
stderr: /Cannot write output to .*output-dir/,
});
}
@@ -173,7 +173,7 @@ const { spawnSyncAndAssert } = require('../common/child_process');
writeFileSync(main, 'console.log("hello")', 'utf-8');
const configJson = JSON.stringify({
main,
output: 'output-dir'
output: 'output-dir',
});
writeFileSync(config, configJson, 'utf8');
spawnSyncAndAssert(
@@ -182,6 +182,6 @@ const { spawnSyncAndAssert } = require('../common/child_process');
cwd: tmpdir.path,
}, {
status: 1,
stderr: /Cannot write output to output-dir/
stderr: /Cannot write output to output-dir/,
});
}
@@ -35,7 +35,7 @@ const assert = require('assert');
writeFileSync(main, 'console.log("hello")', 'utf-8');
const configJson = JSON.stringify({
main: 'bundle.js',
output: 'output.blob'
output: 'output.blob',
});
writeFileSync(config, configJson, 'utf8');
const child = spawnSync(
+6
View File
@@ -0,0 +1,6 @@
import sys, os
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
import testpy
def GetConfiguration(context, root):
return testpy.SimpleTestConfiguration(context, root, 'sea')
-45
View File
@@ -14,9 +14,6 @@ test-watch-mode-inspect: PASS, FLAKY
test-http2-large-file: PASS, FLAKY
[$system==win32]
# https://github.com/nodejs/node/issues/49630
test-single-executable-application-snapshot: PASS, FLAKY
test-single-executable-application-snapshot-and-code-cache: PASS, FLAKY
# https://github.com/nodejs/node/issues/47409
test-http2-large-file: PASS, FLAKY
@@ -26,27 +23,6 @@ test-http-server-request-timeouts-mixed: PASS, FLAKY
[$system==macos]
[$system==macos && $arch==x64]
# https://github.com/nodejs/node/issues/59553
test-single-executable-application: PASS, FLAKY
test-single-executable-application-assets: PASS, FLAKY
test-single-executable-application-assets-raw: PASS, FLAKY
test-single-executable-application-asset-keys-empty: PASS, FLAKY
test-single-executable-application-asset-keys: PASS, FLAKY
test-single-executable-application-disable-experimental-sea-warning: PASS, FLAKY
test-single-executable-application-empty: PASS, FLAKY
test-single-executable-application-exec-argv: PASS, FLAKY
test-single-executable-application-exec-argv-empty: PASS, FLAKY
test-single-executable-application-exec-argv-extension-cli: PASS, FLAKY
test-single-executable-application-exec-argv-extension-env: PASS, FLAKY
test-single-executable-application-exec-argv-extension-none: PASS, FLAKY
test-single-executable-application-inspect-in-sea-flags: PASS, FLAKY
test-single-executable-application-inspect: PASS, FLAKY
test-single-executable-application-snapshot: PASS, FLAKY
test-single-executable-application-snapshot-and-code-cache: PASS, FLAKY
test-single-executable-application-snapshot-worker: PASS, FLAKY
test-single-executable-application-use-code-cache: PASS, FLAKY
# https://github.com/nodejs/node/issues/43465
test-http-server-request-timeouts-mixed: PASS, FLAKY
@@ -70,24 +46,3 @@ test-tls-psk-client: PASS, FLAKY
[$arch==arm]
# https://github.com/nodejs/node/issues/49933
test-watch-mode-inspect: SKIP
[$system==linux && $arch==ppc64]
# https://github.com/nodejs/node/issues/59561
test-single-executable-application: SKIP
test-single-executable-application-assets: SKIP
test-single-executable-application-assets-raw: SKIP
test-single-executable-application-asset-keys-empty: SKIP
test-single-executable-application-asset-keys: SKIP
test-single-executable-application-disable-experimental-sea-warning: SKIP
test-single-executable-application-empty: SKIP
test-single-executable-application-exec-argv: SKIP
test-single-executable-application-exec-argv-empty: SKIP
test-single-executable-application-exec-argv-extension-cli: SKIP
test-single-executable-application-exec-argv-extension-env: SKIP
test-single-executable-application-exec-argv-extension-none: SKIP
test-single-executable-application-inspect-in-sea-flags: SKIP
test-single-executable-application-inspect: SKIP
test-single-executable-application-snapshot: SKIP
test-single-executable-application-snapshot-and-code-cache: SKIP
test-single-executable-application-snapshot-worker: SKIP
test-single-executable-application-use-code-cache: SKIP