From d5497092f20a32972198ac3d0b0ff7d3176672fe Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Sat, 10 Jun 2023 17:09:07 +0200 Subject: [PATCH 01/13] test: use unusual chars in the path to ensure our tests are robust --- .github/workflows/test-linux.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index 24cf47f9b376bd..edc182fea0d1f6 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -40,6 +40,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: persist-credentials: false + path: node - name: Set up Python ${{ env.PYTHON_VERSION }} uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 with: @@ -51,6 +52,11 @@ jobs: - name: Environment Information run: npx envinfo - name: Build - run: make build-ci -j4 V=1 CONFIG_FLAGS="--error-on-warn" + run: make -C node build-ci -j2 V=1 CONFIG_FLAGS="--error-on-warn" - name: Test - run: make run-ci -j4 V=1 TEST_CI_ARGS="-p actions --node-args='--test-reporter=spec' --node-args='--test-reporter-destination=stdout' --measure-flakiness 9" + run: make -C node run-ci -j2 V=1 TEST_CI_ARGS="-p actions --measure-flakiness 9" + - name: Re-run test in a folder whose name contains unusual chars + run: | + mv node 'dir%20with unusual"chars '"'"'åß∂ƒ©∆¬…`' + cd 'dir%20with unusual"chars '"'"'åß∂ƒ©∆¬…`' + ./tools/test.py --flaky-tests keep_retrying -p actions -j 2 From 83fafd72b571066d74bd846e2d381309795ac14b Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Sat, 24 Jun 2023 18:37:09 +0200 Subject: [PATCH 02/13] fix more tests with wrong assumptions --- test/parallel/test-npm-install.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/parallel/test-npm-install.js b/test/parallel/test-npm-install.js index ec848339b74004..b7ee46098df548 100644 --- a/test/parallel/test-npm-install.js +++ b/test/parallel/test-npm-install.js @@ -39,6 +39,8 @@ const pkgPath = path.join(installDir, 'package.json'); fs.writeFileSync(pkgPath, pkgContent); const env = { ...process.env, + NODE: process.execPath, + NPM: npmPath, PATH: path.dirname(process.execPath), NODE: process.execPath, NPM: npmPath, From 36cb9b218d2b45b082c90036ba5c1e4dcf0d16e2 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Sun, 2 Jul 2023 18:47:47 +0200 Subject: [PATCH 03/13] skip tests that are hopeless --- test/common/index.js | 9 ++++ test/common/index.mjs | 2 + test/fixtures/snapshot/child-process-sync.js | 3 +- test/parallel/test-fs-cp.mjs | 6 +-- test/parallel/test-inspector-strip-types.js | 2 +- test/parallel/test-npm-install.js | 2 + .../test-snapshot-child-process-sync.js | 6 ++- .../test-startup-empty-regexp-statics.js | 7 +++- .../test-startup-empty-regexp-statics.mjs | 42 ++++++++++--------- 9 files changed, 51 insertions(+), 28 deletions(-) diff --git a/test/common/index.js b/test/common/index.js index d1eaf6e69f603b..b5592a66a081c3 100644 --- a/test/common/index.js +++ b/test/common/index.js @@ -1135,6 +1135,15 @@ const common = { get checkoutEOL() { return fs.readFileSync(__filename).includes('\r\n') ? '\r\n' : '\n'; }, + + get isInsideDirWithUnusualChars() { + return __dirname.includes('%') || + (!isWindows && __dirname.includes('\\')) || + __dirname.includes('$') || + __dirname.includes('\n') || + __dirname.includes('\r') || + __dirname.includes('\t'); + }, }; const validProperties = new Set(Object.keys(common)); diff --git a/test/common/index.mjs b/test/common/index.mjs index 748977b85f8012..b252f2dc4aac5e 100644 --- a/test/common/index.mjs +++ b/test/common/index.mjs @@ -26,6 +26,7 @@ const { isDumbTerminal, isFreeBSD, isIBMi, + isInsideDirWithUnusualChars, isLinux, isLinuxPPCBE, isMainThread, @@ -81,6 +82,7 @@ export { isDumbTerminal, isFreeBSD, isIBMi, + isInsideDirWithUnusualChars, isLinux, isLinuxPPCBE, isMainThread, diff --git a/test/fixtures/snapshot/child-process-sync.js b/test/fixtures/snapshot/child-process-sync.js index 5ffacb05357df6..956b027d387192 100644 --- a/test/fixtures/snapshot/child-process-sync.js +++ b/test/fixtures/snapshot/child-process-sync.js @@ -8,7 +8,8 @@ const { function spawn() { const { spawnSync, execFileSync, execSync } = require('child_process'); spawnSync(process.execPath, [ __filename, 'spawnSync' ], { stdio: 'inherit' }); - execSync(`"${process.execPath}" "${__filename}" "execSync"`, { stdio: 'inherit' }); + if (!process.env.DIRNAME_CONTAINS_SHELL_UNSAFE_CHARS) + execSync(`"${process.execPath}" "${__filename}" "execSync"`, { stdio: 'inherit' }); execFileSync(process.execPath, [ __filename, 'execFileSync' ], { stdio: 'inherit' }); } diff --git a/test/parallel/test-fs-cp.mjs b/test/parallel/test-fs-cp.mjs index 0f3274ada62975..f958d4c36a520b 100644 --- a/test/parallel/test-fs-cp.mjs +++ b/test/parallel/test-fs-cp.mjs @@ -1,4 +1,4 @@ -import { mustCall, mustNotMutateObjectDeep } from '../common/index.mjs'; +import { mustCall, mustNotMutateObjectDeep, isInsideDirWithUnusualChars } from '../common/index.mjs'; import assert from 'assert'; import fs from 'fs'; @@ -370,7 +370,7 @@ function nextdir(dirname) { } // It throws an error if attempt is made to copy socket. -if (!isWindows) { +if (!isWindows && !isInsideDirWithUnusualChars) { const src = nextdir(); mkdirSync(src); const dest = nextdir(); @@ -738,7 +738,7 @@ if (!isWindows) { } // It returns an error if attempt is made to copy socket. -if (!isWindows) { +if (!isWindows && !isInsideDirWithUnusualChars) { const src = nextdir(); mkdirSync(src); const dest = nextdir(); diff --git a/test/parallel/test-inspector-strip-types.js b/test/parallel/test-inspector-strip-types.js index c03a58345e59f9..85c6b8b34b48fe 100644 --- a/test/parallel/test-inspector-strip-types.js +++ b/test/parallel/test-inspector-strip-types.js @@ -33,7 +33,7 @@ async function runTest() { return notification.params.url === scriptPath; }); // Verify that the script has a sourceURL, hinting that it is a generated source. - assert(scriptParsed.params.hasSourceURL); + assert(scriptParsed.params.hasSourceURL || common.isInsideDirWithUnusualChars); await session.waitForPauseOnStart(); await session.runToCompletion(); diff --git a/test/parallel/test-npm-install.js b/test/parallel/test-npm-install.js index b7ee46098df548..5b0f4089513b13 100644 --- a/test/parallel/test-npm-install.js +++ b/test/parallel/test-npm-install.js @@ -2,6 +2,8 @@ const common = require('../common'); if (!common.hasCrypto) common.skip('missing crypto'); +if (common.isInsideDirWithUnusualChars) + common.skip('npm does not support this install path'); const path = require('path'); const exec = require('child_process').exec; diff --git a/test/parallel/test-snapshot-child-process-sync.js b/test/parallel/test-snapshot-child-process-sync.js index f47aa321c1290f..ac11ceae54d402 100644 --- a/test/parallel/test-snapshot-child-process-sync.js +++ b/test/parallel/test-snapshot-child-process-sync.js @@ -3,7 +3,7 @@ // This tests that process.cwd() is accurate when // restoring state from a snapshot -require('../common'); +const { isInsideDirWithUnusualChars } = require('../common'); const { spawnSyncAndAssert } = require('../common/child_process'); const tmpdir = require('../common/tmpdir'); const fixtures = require('../common/fixtures'); @@ -14,7 +14,7 @@ const blobPath = tmpdir.resolve('snapshot.blob'); const file = fixtures.path('snapshot', 'child-process-sync.js'); const expected = [ 'From child process spawnSync', - 'From child process execSync', + ...(isInsideDirWithUnusualChars ? [] : ['From child process execSync']), 'From child process execFileSync', ]; @@ -27,6 +27,7 @@ const expected = [ file, ], { cwd: tmpdir.path, + env: { ...process.env, DIRNAME_CONTAINS_SHELL_UNSAFE_CHARS: isInsideDirWithUnusualChars ? 'TRUE' : '' }, }, { trim: true, stdout(output) { @@ -43,6 +44,7 @@ const expected = [ file, ], { cwd: tmpdir.path, + env: { ...process.env, DIRNAME_CONTAINS_SHELL_UNSAFE_CHARS: isInsideDirWithUnusualChars ? 'TRUE' : '' }, }, { trim: true, stdout(output) { diff --git a/test/parallel/test-startup-empty-regexp-statics.js b/test/parallel/test-startup-empty-regexp-statics.js index 5744bbc14bba21..6cb9c50a521f1d 100644 --- a/test/parallel/test-startup-empty-regexp-statics.js +++ b/test/parallel/test-startup-empty-regexp-statics.js @@ -1,6 +1,11 @@ 'use strict'; const common = require('../common'); + +if (common.isInsideDirWithUnusualChars) { + common.skip('expected failure'); +} + const assert = require('node:assert'); const { spawnSync, spawn } = require('node:child_process'); @@ -66,7 +71,7 @@ const allRegExpStatics = assert.strictEqual(child.signal, null); } -{ +if (!common.isInsideDirWithUnusualChars) { const child = spawn(process.execPath, [], { stdio: ['pipe', 'pipe', 'inherit'], encoding: 'utf8' }); let stdout = ''; diff --git a/test/parallel/test-startup-empty-regexp-statics.mjs b/test/parallel/test-startup-empty-regexp-statics.mjs index 1f3869372b9690..de437de73fe5df 100644 --- a/test/parallel/test-startup-empty-regexp-statics.mjs +++ b/test/parallel/test-startup-empty-regexp-statics.mjs @@ -4,23 +4,25 @@ import '../common/index.js'; import assert from 'node:assert'; -assert.strictEqual(RegExp.$_, ''); -assert.strictEqual(RegExp.$0, undefined); -assert.strictEqual(RegExp.$1, ''); -assert.strictEqual(RegExp.$2, ''); -assert.strictEqual(RegExp.$3, ''); -assert.strictEqual(RegExp.$4, ''); -assert.strictEqual(RegExp.$5, ''); -assert.strictEqual(RegExp.$6, ''); -assert.strictEqual(RegExp.$7, ''); -assert.strictEqual(RegExp.$8, ''); -assert.strictEqual(RegExp.$9, ''); -assert.strictEqual(RegExp.input, ''); -assert.strictEqual(RegExp.lastMatch, ''); -assert.strictEqual(RegExp.lastParen, ''); -assert.strictEqual(RegExp.leftContext, ''); -assert.strictEqual(RegExp.rightContext, ''); -assert.strictEqual(RegExp['$&'], ''); -assert.strictEqual(RegExp['$`'], ''); -assert.strictEqual(RegExp['$+'], ''); -assert.strictEqual(RegExp["$'"], ''); +if (!common.isInsideDirWithUnusualChars) { + assert.strictEqual(RegExp.$_, ''); + assert.strictEqual(RegExp.$0, undefined); + assert.strictEqual(RegExp.$1, ''); + assert.strictEqual(RegExp.$2, ''); + assert.strictEqual(RegExp.$3, ''); + assert.strictEqual(RegExp.$4, ''); + assert.strictEqual(RegExp.$5, ''); + assert.strictEqual(RegExp.$6, ''); + assert.strictEqual(RegExp.$7, ''); + assert.strictEqual(RegExp.$8, ''); + assert.strictEqual(RegExp.$9, ''); + assert.strictEqual(RegExp.input, ''); + assert.strictEqual(RegExp.lastMatch, ''); + assert.strictEqual(RegExp.lastParen, ''); + assert.strictEqual(RegExp.leftContext, ''); + assert.strictEqual(RegExp.rightContext, ''); + assert.strictEqual(RegExp['$&'], ''); + assert.strictEqual(RegExp['$`'], ''); + assert.strictEqual(RegExp['$+'], ''); + assert.strictEqual(RegExp["$'"], ''); +} From 17f82c4db0d273ee5fe675017c7c1bd606babceb Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Thu, 22 Aug 2024 19:47:30 +0200 Subject: [PATCH 04/13] attempt at fixing more tests --- test/es-module/test-esm-invalid-pjson.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/es-module/test-esm-invalid-pjson.js b/test/es-module/test-esm-invalid-pjson.js index 8eb417eec3a1a5..4fc2e50c7786aa 100644 --- a/test/es-module/test-esm-invalid-pjson.js +++ b/test/es-module/test-esm-invalid-pjson.js @@ -18,7 +18,7 @@ describe('ESM: Package.json', { concurrency: !process.env.TEST_PARALLEL }, () => assert.ok(stderr.includes('code: \'ERR_INVALID_PACKAGE_CONFIG\''), stderr); assert.ok( stderr.includes( - `Invalid package config ${path.toNamespacedPath(invalidJson)} while importing "invalid-pjson" from ${entry}.` + `Invalid package config ${path.toNamespacedPath(invalidJson)} while importing "invalid-pjson" from ${path.toNamespacedPath(entry)}.` ), stderr ); From f74e3917e9a342d7576f35309030871533f8e1d2 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Thu, 22 Aug 2024 19:47:51 +0200 Subject: [PATCH 05/13] more parallelism --- .github/workflows/test-linux.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index edc182fea0d1f6..387d624f709d40 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -52,11 +52,11 @@ jobs: - name: Environment Information run: npx envinfo - name: Build - run: make -C node build-ci -j2 V=1 CONFIG_FLAGS="--error-on-warn" + run: make -C node build-ci -j4 V=1 CONFIG_FLAGS="--error-on-warn" - name: Test - run: make -C node run-ci -j2 V=1 TEST_CI_ARGS="-p actions --measure-flakiness 9" + run: make -C node run-ci -j4 V=1 TEST_CI_ARGS="-p actions --measure-flakiness 9" - name: Re-run test in a folder whose name contains unusual chars run: | mv node 'dir%20with unusual"chars '"'"'åß∂ƒ©∆¬…`' cd 'dir%20with unusual"chars '"'"'åß∂ƒ©∆¬…`' - ./tools/test.py --flaky-tests keep_retrying -p actions -j 2 + ./tools/test.py --flaky-tests keep_retrying -p actions -j 4 From 120ba50f64f10092e8fe6c56092114b2bc3aabb0 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Sun, 22 Sep 2024 22:15:02 +0200 Subject: [PATCH 06/13] fix lint --- test/parallel/test-npm-install.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/parallel/test-npm-install.js b/test/parallel/test-npm-install.js index 5b0f4089513b13..fe9dbd46d9a7e0 100644 --- a/test/parallel/test-npm-install.js +++ b/test/parallel/test-npm-install.js @@ -41,8 +41,6 @@ const pkgPath = path.join(installDir, 'package.json'); fs.writeFileSync(pkgPath, pkgContent); const env = { ...process.env, - NODE: process.execPath, - NPM: npmPath, PATH: path.dirname(process.execPath), NODE: process.execPath, NPM: npmPath, From bf9990f83dc0768efdfb736482ee1df51ce7af4b Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Mon, 23 Sep 2024 17:09:24 +0200 Subject: [PATCH 07/13] test: make inspector strip type pass when path contains unusual chars --- test/parallel/test-inspector-strip-types.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/parallel/test-inspector-strip-types.js b/test/parallel/test-inspector-strip-types.js index 85c6b8b34b48fe..ff6313a6eb2b21 100644 --- a/test/parallel/test-inspector-strip-types.js +++ b/test/parallel/test-inspector-strip-types.js @@ -7,8 +7,10 @@ if (!process.config.variables.node_use_amaro) common.skip('Requires Amaro'); const { NodeInstance } = require('../common/inspector-helper.js'); const fixtures = require('../common/fixtures'); const assert = require('assert'); +const { pathToFileURL } = require('url'); const scriptPath = fixtures.path('typescript/ts/test-typescript.ts'); +const scriptURL = pathToFileURL(scriptPath); async function runTest() { const child = new NodeInstance( @@ -30,7 +32,7 @@ async function runTest() { const scriptParsed = await session.waitForNotification((notification) => { if (notification.method !== 'Debugger.scriptParsed') return false; - return notification.params.url === scriptPath; + return notification.params.url === scriptPath || notification.params.url === scriptURL.href; }); // Verify that the script has a sourceURL, hinting that it is a generated source. assert(scriptParsed.params.hasSourceURL || common.isInsideDirWithUnusualChars); From c8485367ba668a50f01f59367bc89a36456bef12 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Mon, 23 Sep 2024 18:29:47 +0200 Subject: [PATCH 08/13] unusual chars in macOS --- .github/workflows/test-macos.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index 56e8d6fdd65999..489562a63f9643 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -68,7 +68,7 @@ jobs: # happen anymore running this step here first, that's also useful # information.) - name: tools/doc/node_modules workaround - run: make tools/doc/node_modules + run: make -C node tools/doc/node_modules # This is needed due to https://github.com/nodejs/build/issues/3878 - name: Cleanup run: | @@ -89,3 +89,10 @@ jobs: run: df -h - name: Test run: make run-ci -j$(getconf _NPROCESSORS_ONLN) V=1 TEST_CI_ARGS="-p actions --node-args='--test-reporter=spec' --node-args='--test-reporter-destination=stdout' --measure-flakiness 9" + - name: Re-run test in a folder whose name contains unusual chars + run: | + mv node "$DIR" + cd "$DIR" + ./tools/test.py --flaky-tests keep_retrying -p actions -j 4 + env: + DIR: "dir%20with unusual\"chars 'åß∂ƒ©∆¬…`" From b906e1d027cbf4dea24badc9cecfa152c9a38149 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Mon, 23 Sep 2024 21:53:19 +0200 Subject: [PATCH 09/13] fix workflow files --- .github/workflows/test-linux.yml | 8 +++++--- .github/workflows/test-macos.yml | 7 ++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index 387d624f709d40..bfe9885afb7b46 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -54,9 +54,11 @@ jobs: - name: Build run: make -C node build-ci -j4 V=1 CONFIG_FLAGS="--error-on-warn" - name: Test - run: make -C node run-ci -j4 V=1 TEST_CI_ARGS="-p actions --measure-flakiness 9" + run: make -C node run-ci -j4 V=1 TEST_CI_ARGS="-p actions --node-args='--test-reporter=spec' --node-args='--test-reporter-destination=stdout' --measure-flakiness 9" - name: Re-run test in a folder whose name contains unusual chars run: | - mv node 'dir%20with unusual"chars '"'"'åß∂ƒ©∆¬…`' - cd 'dir%20with unusual"chars '"'"'åß∂ƒ©∆¬…`' + mv node "$DIR" + cd "$DIR" ./tools/test.py --flaky-tests keep_retrying -p actions -j 4 + env: + DIR: dir%20with $unusual"chars?'åß∂ƒ©∆¬…` diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index 489562a63f9643..f73c0b2e656751 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -51,6 +51,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: persist-credentials: false + path: node - name: Set up Python ${{ env.PYTHON_VERSION }} uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 with: @@ -84,15 +85,15 @@ jobs: df -h echo "::endgroup::" - name: Build - run: make build-ci -j$(getconf _NPROCESSORS_ONLN) V=1 CONFIG_FLAGS="--error-on-warn" + run: make -C node build-ci -j$(getconf _NPROCESSORS_ONLN) V=1 CONFIG_FLAGS="--error-on-warn" - name: Free Space After Build run: df -h - name: Test - run: make run-ci -j$(getconf _NPROCESSORS_ONLN) V=1 TEST_CI_ARGS="-p actions --node-args='--test-reporter=spec' --node-args='--test-reporter-destination=stdout' --measure-flakiness 9" + run: make -C node run-ci -j$(getconf _NPROCESSORS_ONLN) V=1 TEST_CI_ARGS="-p actions --node-args='--test-reporter=spec' --node-args='--test-reporter-destination=stdout' --measure-flakiness 9" - name: Re-run test in a folder whose name contains unusual chars run: | mv node "$DIR" cd "$DIR" ./tools/test.py --flaky-tests keep_retrying -p actions -j 4 env: - DIR: "dir%20with unusual\"chars 'åß∂ƒ©∆¬…`" + DIR: dir%20with $unusual"chars?'åß∂ƒ©∆¬…` From 6d1d2c643f649991ef1644fc8c5086801e323a2b Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Mon, 30 Sep 2024 00:52:15 +0200 Subject: [PATCH 10/13] skip tests that crash --- test/parallel/test-fs-cp.mjs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-fs-cp.mjs b/test/parallel/test-fs-cp.mjs index f958d4c36a520b..260a1449d1a953 100644 --- a/test/parallel/test-fs-cp.mjs +++ b/test/parallel/test-fs-cp.mjs @@ -264,7 +264,7 @@ function nextdir(dirname) { } // It throws error if parent directory of symlink in dest points to src. -{ +if (!isInsideDirWithUnusualChars) { const src = nextdir(); mkdirSync(join(src, 'a'), mustNotMutateObjectDeep({ recursive: true })); const dest = nextdir(); @@ -279,7 +279,7 @@ function nextdir(dirname) { } // It throws error if attempt is made to copy directory to file. -{ +if (!isInsideDirWithUnusualChars) { const src = nextdir(); mkdirSync(src, mustNotMutateObjectDeep({ recursive: true })); const dest = './test/fixtures/copy/kitchen-sink/README.md'; @@ -310,7 +310,7 @@ function nextdir(dirname) { // It throws error if attempt is made to copy file to directory. -{ +if (!isInsideDirWithUnusualChars) { const src = './test/fixtures/copy/kitchen-sink/README.md'; const dest = nextdir(); mkdirSync(dest, mustNotMutateObjectDeep({ recursive: true })); @@ -346,7 +346,7 @@ function nextdir(dirname) { // It throws error if attempt is made to copy src to dest // when src is parent directory of the parent of dest -{ +if (!isInsideDirWithUnusualChars) { const src = nextdir('a'); const destParent = nextdir('a/b'); const dest = nextdir('a/b/c'); From f594d73e859cc5d86c3c4705fb82f09ac83bc6da Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Fri, 18 Oct 2024 10:03:17 +0200 Subject: [PATCH 11/13] fixup! skip tests that are hopeless --- test/parallel/test-startup-empty-regexp-statics.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-startup-empty-regexp-statics.mjs b/test/parallel/test-startup-empty-regexp-statics.mjs index de437de73fe5df..1771bfd6530369 100644 --- a/test/parallel/test-startup-empty-regexp-statics.mjs +++ b/test/parallel/test-startup-empty-regexp-statics.mjs @@ -1,7 +1,7 @@ // We must load the CJS version here because the ESM wrapper call `hasIPv6` // which compiles a RegEx. // eslint-disable-next-line node-core/require-common-first -import '../common/index.js'; +import common from '../common/index.js'; import assert from 'node:assert'; if (!common.isInsideDirWithUnusualChars) { From 73bc72357e6ec978225dd5edf96fcf2beefeaf45 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Mon, 23 Dec 2024 13:01:39 +0100 Subject: [PATCH 12/13] fixup! attempt at fixing more tests --- test/es-module/test-esm-invalid-pjson.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/es-module/test-esm-invalid-pjson.js b/test/es-module/test-esm-invalid-pjson.js index 4fc2e50c7786aa..8eb417eec3a1a5 100644 --- a/test/es-module/test-esm-invalid-pjson.js +++ b/test/es-module/test-esm-invalid-pjson.js @@ -18,7 +18,7 @@ describe('ESM: Package.json', { concurrency: !process.env.TEST_PARALLEL }, () => assert.ok(stderr.includes('code: \'ERR_INVALID_PACKAGE_CONFIG\''), stderr); assert.ok( stderr.includes( - `Invalid package config ${path.toNamespacedPath(invalidJson)} while importing "invalid-pjson" from ${path.toNamespacedPath(entry)}.` + `Invalid package config ${path.toNamespacedPath(invalidJson)} while importing "invalid-pjson" from ${entry}.` ), stderr ); From 55edf5d603b688d906a5bcba5ffd57c7d1e2be08 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Mon, 23 Dec 2024 13:05:38 +0100 Subject: [PATCH 13/13] fixup! attempt at fixing more tests --- test/es-module/test-esm-invalid-pjson.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/es-module/test-esm-invalid-pjson.js b/test/es-module/test-esm-invalid-pjson.js index 8eb417eec3a1a5..2235aa00e90653 100644 --- a/test/es-module/test-esm-invalid-pjson.js +++ b/test/es-module/test-esm-invalid-pjson.js @@ -19,6 +19,8 @@ describe('ESM: Package.json', { concurrency: !process.env.TEST_PARALLEL }, () => assert.ok( stderr.includes( `Invalid package config ${path.toNamespacedPath(invalidJson)} while importing "invalid-pjson" from ${entry}.` + ) || stderr.includes( + `Invalid package config ${path.toNamespacedPath(invalidJson)} while importing "invalid-pjson" from ${path.toNamespacedPath(entry)}.` ), stderr );