| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -192,7 +192,7 @@ jobs: | |||
| 192 | 192 | --arg ccache '(import <nixpkgs> {}).sccache' \ | |
| 193 | 193 | --arg devTools '[]' \ | |
| 194 | 194 | --arg benchmarkTools '[]' \ | |
| 195 | - ${{ endsWith(matrix.system, '-darwin') && '--arg extraConfigFlags ''["--without-amaro" "--without-inspector"]'' \' || '\' }} | ||
| 195 | + ${{ endsWith(matrix.system, '-darwin') && '--arg extraConfigFlags ''["--without-amaro" "--without-inspector" "--without-node-options"]'' \' || '\' }} | ||
| 196 | 196 | --run ' | |
| 197 | 197 | make -C "$TAR_DIR" run-ci -j4 V=1 TEST_CI_ARGS="-p actions --measure-flakiness 9 --skip-tests=$CI_SKIP_TESTS" | |
| 198 | 198 | ' | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -154,7 +154,7 @@ for (const extraSnapshotArgs of [ | |||
| 154 | 154 | } | |
| 155 | 155 | ||
| 156 | 156 | // Guarantee NODE_REPL_EXTERNAL_MODULE won't bypass kDisableNodeOptionsEnv | |
| 157 | - { | ||
| 157 | + if (!process.config.variables.node_without_node_options) { | ||
| 158 | 158 | spawnSyncAndExit( | |
| 159 | 159 | binary, | |
| 160 | 160 | ['require("os")'], | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,6 +9,7 @@ const cjsImport = fixtures.fileURL('es-modules', 'cjs-file.cjs'); | |||
| 9 | 9 | const mjsEntry = fixtures.path('es-modules', 'mjs-file.mjs'); | |
| 10 | 10 | const mjsImport = fixtures.fileURL('es-modules', 'mjs-file.mjs'); | |
| 11 | 11 | ||
| 12 | + const onlyIfNodeOptionsSupport = { skip: process.config.variables.node_without_node_options }; | ||
| 12 | 13 | ||
| 13 | 14 | describe('import modules using --import', { concurrency: !process.env.TEST_PARALLEL }, () => { | |
| 14 | 15 | it('should import when using --eval', async () => { | |
@@ -199,7 +200,7 @@ describe('import modules using --import', { concurrency: !process.env.TEST_PARAL | |||
| 199 | 200 | assert.strictEqual(signal, null); | |
| 200 | 201 | }); | |
| 201 | 202 | ||
| 202 | - it('should import files from the env before ones from the CLI', async () => { | ||
| 203 | + it('should import files from the env before ones from the CLI', onlyIfNodeOptionsSupport, async () => { | ||
| 203 | 204 | const { code, signal, stderr, stdout } = await spawnPromisified( | |
| 204 | 205 | execPath, | |
| 205 | 206 | [ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,6 +6,10 @@ const assert = require('assert'); | |||
| 6 | 6 | const exec = require('child_process').execFile; | |
| 7 | 7 | const fs = require('fs'); | |
| 8 | 8 | ||
| 9 | + if (process.config.variables.node_without_node_options) { | ||
| 10 | + common.skip('missing NODE_OPTIONS support'); | ||
| 11 | + } | ||
| 12 | + | ||
| 9 | 13 | const tmpdir = require('../common/tmpdir'); | |
| 10 | 14 | tmpdir.refresh(); | |
| 11 | 15 | const tmpDir = tmpdir.path; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,6 +4,10 @@ const assert = require('assert'); | |||
| 4 | 4 | const exec = require('child_process').execFile; | |
| 5 | 5 | const { describe, it } = require('node:test'); | |
| 6 | 6 | ||
| 7 | + if (process.config.variables.node_without_node_options) { | ||
| 8 | + common.skip('missing NODE_OPTIONS support'); | ||
| 9 | + } | ||
| 10 | + | ||
| 7 | 11 | const mjsFile = require.resolve('../fixtures/es-modules/mjs-file.mjs'); | |
| 8 | 12 | const cjsFile = require.resolve('../fixtures/es-modules/cjs-file.cjs'); | |
| 9 | 13 | const packageWithoutTypeMain = | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,6 +12,8 @@ const fixtureFile = fixtures.path(path.join('options-as-flags', 'fixture.cjs')); | |||
| 12 | 12 | const configFile = fixtures.path(path.join('options-as-flags', 'test-config.json')); | |
| 13 | 13 | const envFile = fixtures.path(path.join('options-as-flags', '.test.env')); | |
| 14 | 14 | ||
| 15 | + const onlyIfNodeOptionsSupport = { skip: process.config.variables.node_without_node_options }; | ||
| 16 | + | ||
| 15 | 17 | describe('getOptionsAsFlagsFromBinding', () => { | |
| 16 | 18 | it('should extract flags from command line arguments', async () => { | |
| 17 | 19 | const result = await spawnPromisified(process.execPath, [ | |
@@ -28,7 +30,7 @@ describe('getOptionsAsFlagsFromBinding', () => { | |||
| 28 | 30 | assert.strictEqual(flags.includes('--stack-trace-limit=512'), true); | |
| 29 | 31 | }); | |
| 30 | 32 | ||
| 31 | - it('should extract flags from NODE_OPTIONS environment variable', async () => { | ||
| 33 | + it('should extract flags from NODE_OPTIONS environment variable', onlyIfNodeOptionsSupport, async () => { | ||
| 32 | 34 | const result = await spawnPromisified(process.execPath, [ | |
| 33 | 35 | '--no-warnings', | |
| 34 | 36 | '--expose-internals', | |
@@ -49,7 +51,7 @@ describe('getOptionsAsFlagsFromBinding', () => { | |||
| 49 | 51 | assert.strictEqual(flags.includes('--no-warnings'), true); | |
| 50 | 52 | }); | |
| 51 | 53 | ||
| 52 | - it('should extract flags from config file', async () => { | ||
| 54 | + it('should extract flags from config file', onlyIfNodeOptionsSupport, async () => { | ||
| 53 | 55 | const result = await spawnPromisified(process.execPath, [ | |
| 54 | 56 | '--no-warnings', | |
| 55 | 57 | '--expose-internals', | |
@@ -69,7 +71,7 @@ describe('getOptionsAsFlagsFromBinding', () => { | |||
| 69 | 71 | assert.strictEqual(flags.includes('--no-warnings'), true); | |
| 70 | 72 | }); | |
| 71 | 73 | ||
| 72 | - it('should extract flags from config file and command line', async () => { | ||
| 74 | + it('should extract flags from config file and command line', onlyIfNodeOptionsSupport, async () => { | ||
| 73 | 75 | const result = await spawnPromisified(process.execPath, [ | |
| 74 | 76 | '--no-warnings', | |
| 75 | 77 | '--expose-internals', | |
@@ -92,7 +94,7 @@ describe('getOptionsAsFlagsFromBinding', () => { | |||
| 92 | 94 | assert.strictEqual(flags.includes('--test-isolation=none'), true); | |
| 93 | 95 | }); | |
| 94 | 96 | ||
| 95 | - it('should extract flags from .env file', async () => { | ||
| 97 | + it('should extract flags from .env file', onlyIfNodeOptionsSupport, async () => { | ||
| 96 | 98 | const result = await spawnPromisified(process.execPath, [ | |
| 97 | 99 | '--no-warnings', | |
| 98 | 100 | '--expose-internals', | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,7 +13,14 @@ const { test, it, describe } = require('node:test'); | |||
| 13 | 13 | const { chmodSync, writeFileSync, constants } = require('node:fs'); | |
| 14 | 14 | const { join } = require('node:path'); | |
| 15 | 15 | ||
| 16 | + const onlyIfNodeOptionsSupport = { skip: process.config.variables.node_without_node_options }; | ||
| 16 | 17 | const onlyWithAmaro = { skip: !process.config.variables.node_use_amaro }; | |
| 18 | + const onlyWithAmaroAndNodeOptions = { | ||
| 19 | + skip: !process.config.variables.node_use_amaro || process.config.variables.node_without_node_options, | ||
| 20 | + }; | ||
| 21 | + const onlyWithInspectorAndNodeOptions = { | ||
| 22 | + skip: !process.features.inspector || process.config.variables.node_without_node_options, | ||
| 23 | + }; | ||
| 17 | 24 | ||
| 18 | 25 | test('should handle non existing json', async () => { | |
| 19 | 26 | const result = await spawnPromisified(process.execPath, [ | |
@@ -51,7 +58,7 @@ test('should handle empty object json', async () => { | |||
| 51 | 58 | assert.strictEqual(result.code, 0); | |
| 52 | 59 | }); | |
| 53 | 60 | ||
| 54 | - test('should parse boolean flag', onlyWithAmaro, async () => { | ||
| 61 | + test('should parse boolean flag', onlyWithAmaroAndNodeOptions, async () => { | ||
| 55 | 62 | const result = await spawnPromisified(process.execPath, [ | |
| 56 | 63 | '--experimental-config-file', | |
| 57 | 64 | fixtures.path('rc/transform-types.json'), | |
@@ -62,7 +69,7 @@ test('should parse boolean flag', onlyWithAmaro, async () => { | |||
| 62 | 69 | assert.strictEqual(result.code, 0); | |
| 63 | 70 | }); | |
| 64 | 71 | ||
| 65 | - test('should parse boolean flag defaulted to true', async () => { | ||
| 72 | + test('should parse boolean flag defaulted to true', onlyIfNodeOptionsSupport, async () => { | ||
| 66 | 73 | const result = await spawnPromisified(process.execPath, [ | |
| 67 | 74 | '--experimental-config-file', | |
| 68 | 75 | fixtures.path('rc/warnings-false.json'), | |
@@ -85,7 +92,7 @@ test('should throw an error when a flag is declared twice', async () => { | |||
| 85 | 92 | assert.strictEqual(result.code, 9); | |
| 86 | 93 | }); | |
| 87 | 94 | ||
| 88 | - test('should override env-file', onlyWithAmaro, async () => { | ||
| 95 | + test('should override env-file', onlyWithAmaroAndNodeOptions, async () => { | ||
| 89 | 96 | const result = await spawnPromisified(process.execPath, [ | |
| 90 | 97 | '--no-warnings', | |
| 91 | 98 | '--experimental-config-file', | |
@@ -128,7 +135,7 @@ test('should not override CLI flags', onlyWithAmaro, async () => { | |||
| 128 | 135 | assert.strictEqual(result.code, 1); | |
| 129 | 136 | }); | |
| 130 | 137 | ||
| 131 | - test('should parse array flag correctly', async () => { | ||
| 138 | + test('should parse array flag correctly', onlyIfNodeOptionsSupport, async () => { | ||
| 132 | 139 | const result = await spawnPromisified(process.execPath, [ | |
| 133 | 140 | '--no-warnings', | |
| 134 | 141 | '--experimental-config-file', | |
@@ -152,7 +159,7 @@ test('should validate invalid array flag', async () => { | |||
| 152 | 159 | assert.strictEqual(result.code, 9); | |
| 153 | 160 | }); | |
| 154 | 161 | ||
| 155 | - test('should validate array flag as string', async () => { | ||
| 162 | + test('should validate array flag as string', onlyIfNodeOptionsSupport, async () => { | ||
| 156 | 163 | const result = await spawnPromisified(process.execPath, [ | |
| 157 | 164 | '--no-warnings', | |
| 158 | 165 | '--experimental-config-file', | |
@@ -188,7 +195,7 @@ test('should throw at flag not available in NODE_OPTIONS', async () => { | |||
| 188 | 195 | assert.strictEqual(result.code, 9); | |
| 189 | 196 | }); | |
| 190 | 197 | ||
| 191 | - test('unsigned flag should be parsed correctly', async () => { | ||
| 198 | + test('unsigned flag should be parsed correctly', onlyIfNodeOptionsSupport, async () => { | ||
| 192 | 199 | const result = await spawnPromisified(process.execPath, [ | |
| 193 | 200 | '--no-warnings', | |
| 194 | 201 | '--experimental-config-file', | |
@@ -225,7 +232,7 @@ test('v8 flag should not be allowed in config file', async () => { | |||
| 225 | 232 | assert.strictEqual(result.code, 9); | |
| 226 | 233 | }); | |
| 227 | 234 | ||
| 228 | - test('string flag should be parsed correctly', async () => { | ||
| 235 | + test('string flag should be parsed correctly', onlyIfNodeOptionsSupport, async () => { | ||
| 229 | 236 | const result = await spawnPromisified(process.execPath, [ | |
| 230 | 237 | '--no-warnings', | |
| 231 | 238 | '--test', | |
@@ -238,7 +245,7 @@ test('string flag should be parsed correctly', async () => { | |||
| 238 | 245 | assert.strictEqual(result.code, 0); | |
| 239 | 246 | }); | |
| 240 | 247 | ||
| 241 | - test('host port flag should be parsed correctly', { skip: !process.features.inspector }, async () => { | ||
| 248 | + test('host port flag should be parsed correctly', onlyWithInspectorAndNodeOptions, async () => { | ||
| 242 | 249 | const result = await spawnPromisified(process.execPath, [ | |
| 243 | 250 | '--no-warnings', | |
| 244 | 251 | '--expose-internals', | |
@@ -251,7 +258,7 @@ test('host port flag should be parsed correctly', { skip: !process.features.insp | |||
| 251 | 258 | assert.strictEqual(result.code, 0); | |
| 252 | 259 | }); | |
| 253 | 260 | ||
| 254 | - test('--inspect=true should be parsed correctly', { skip: !process.features.inspector }, async () => { | ||
| 261 | + test('--inspect=true should be parsed correctly', onlyWithInspectorAndNodeOptions, async () => { | ||
| 255 | 262 | const result = await spawnPromisified(process.execPath, [ | |
| 256 | 263 | '--no-warnings', | |
| 257 | 264 | '--experimental-config-file', | |
@@ -351,7 +358,7 @@ test('broken value in node_options', async () => { | |||
| 351 | 358 | assert.strictEqual(result.code, 9); | |
| 352 | 359 | }); | |
| 353 | 360 | ||
| 354 | - test('should use node.config.json as default', async () => { | ||
| 361 | + test('should use node.config.json as default', onlyIfNodeOptionsSupport, async () => { | ||
| 355 | 362 | const result = await spawnPromisified(process.execPath, [ | |
| 356 | 363 | '--no-warnings', | |
| 357 | 364 | '--experimental-default-config-file', | |
@@ -364,7 +371,7 @@ test('should use node.config.json as default', async () => { | |||
| 364 | 371 | assert.strictEqual(result.code, 0); | |
| 365 | 372 | }); | |
| 366 | 373 | ||
| 367 | - test('should override node.config.json when specificied', async () => { | ||
| 374 | + test('should override node.config.json when specificied', onlyIfNodeOptionsSupport, async () => { | ||
| 368 | 375 | const result = await spawnPromisified(process.execPath, [ | |
| 369 | 376 | '--no-warnings', | |
| 370 | 377 | '--experimental-default-config-file', | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -44,6 +44,10 @@ invalidPercentages.forEach((input) => { | |||
| 44 | 44 | assert.match(result.stderr.toString(), input[1]); | |
| 45 | 45 | }); | |
| 46 | 46 | ||
| 47 | + if (process.config.variables.node_without_node_options) { | ||
| 48 | + common.skip('missing NODE_OPTIONS support'); | ||
| 49 | + } | ||
| 50 | + | ||
| 47 | 51 | // Test NODE_OPTIONS with valid percentages | |
| 48 | 52 | validPercentages.forEach((input) => { | |
| 49 | 53 | const result = spawnSync(process.execPath, [], { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,6 +8,9 @@ const { isMainThread } = require('worker_threads'); | |||
| 8 | 8 | if (!isMainThread) { | |
| 9 | 9 | common.skip('This test only works on a main thread'); | |
| 10 | 10 | } | |
| 11 | + if (process.config.variables.node_without_node_options) { | ||
| 12 | + common.skip('missing NODE_OPTIONS support'); | ||
| 13 | + } | ||
| 11 | 14 | ||
| 12 | 15 | const assert = require('assert'); | |
| 13 | 16 | const childProcess = require('child_process'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,6 +7,9 @@ const { isMainThread } = require('worker_threads'); | |||
| 7 | 7 | if (!isMainThread) { | |
| 8 | 8 | common.skip('This test only works on a main thread'); | |
| 9 | 9 | } | |
| 10 | + if (process.config.variables.node_without_node_options) { | ||
| 11 | + common.skip('missing NODE_OPTIONS support'); | ||
| 12 | + } | ||
| 10 | 13 | ||
| 11 | 14 | const assert = require('assert'); | |
| 12 | 15 | const childProcess = require('child_process'); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments