From 2769eebc854027552e8218a89494fd219be87637 Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Thu, 16 Oct 2025 21:23:27 +0200 Subject: [PATCH 1/2] test: fix status when compiled without inspector --- test/common/index.js | 4 +++- test/common/index.mjs | 2 ++ test/common/wpt.js | 6 ++++++ test/parallel/test-process-get-builtin.mjs | 6 +++++- test/wpt/status/console.json | 2 +- 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/test/common/index.js b/test/common/index.js index 61b82e28f53064..83166076e16405 100755 --- a/test/common/index.js +++ b/test/common/index.js @@ -54,6 +54,7 @@ const noop = () => {}; const hasCrypto = Boolean(process.versions.openssl) && !process.env.NODE_SKIP_CRYPTO; +const hasInspector = Boolean(process.features.inspector); const hasSQLite = Boolean(process.versions.sqlite); const hasQuic = hasCrypto && !!process.features.quic; @@ -711,7 +712,7 @@ function expectsError(validator, exact) { } function skipIfInspectorDisabled() { - if (!process.features.inspector) { + if (!hasInspector) { skip('V8 inspector is disabled'); } } @@ -930,6 +931,7 @@ const common = { hasIntl, hasCrypto, hasQuic, + hasInspector, hasSQLite, invalidArgTypeHelper, isAlive, diff --git a/test/common/index.mjs b/test/common/index.mjs index 98a26e29ddad27..b535f38ae32673 100644 --- a/test/common/index.mjs +++ b/test/common/index.mjs @@ -17,6 +17,7 @@ const { getTTYfd, hasCrypto, hasQuic, + hasInspector, hasSQLite, hasIntl, hasIPv6, @@ -68,6 +69,7 @@ export { getTTYfd, hasCrypto, hasQuic, + hasInspector, hasSQLite, hasIntl, hasIPv6, diff --git a/test/common/wpt.js b/test/common/wpt.js index a21ad3363e00cb..32fe0b64b05fc4 100644 --- a/test/common/wpt.js +++ b/test/common/wpt.js @@ -412,6 +412,9 @@ class BuildRequirement { // Not using common.hasCrypto because of the global leak checks this.hasCrypto = Boolean(process.versions.openssl) && !process.env.NODE_SKIP_CRYPTO; + + // Not using common.hasInspector because of the global leak checks + this.hasInspector = Boolean(process.features.inspector); } /** @@ -429,6 +432,9 @@ class BuildRequirement { if (requires.has('crypto') && !this.hasCrypto) { return 'crypto'; } + if (requires.has('inspector') && !this.hasInspector) { + return 'inspector'; + } return false; } } diff --git a/test/parallel/test-process-get-builtin.mjs b/test/parallel/test-process-get-builtin.mjs index 8131a470281c6a..de863ff3597641 100644 --- a/test/parallel/test-process-get-builtin.mjs +++ b/test/parallel/test-process-get-builtin.mjs @@ -1,4 +1,4 @@ -import { hasCrypto, hasIntl, hasSQLite } from '../common/index.mjs'; +import { hasCrypto, hasIntl, hasInspector, hasSQLite } from '../common/index.mjs'; import assert from 'node:assert'; import { builtinModules } from 'node:module'; import { isMainThread } from 'node:worker_threads'; @@ -39,6 +39,10 @@ if (!hasIntl) { // TODO(@jasnell): Remove this once node:quic graduates from unflagged. publicBuiltins.delete('node:quic'); +if (!hasInspector) { + publicBuiltins.delete('inspector'); + publicBuiltins.delete('inspector/promises'); +} if (!hasSQLite) { publicBuiltins.delete('node:sqlite'); } diff --git a/test/wpt/status/console.json b/test/wpt/status/console.json index 7c9dadf0cc4465..ba74911d66fdd2 100644 --- a/test/wpt/status/console.json +++ b/test/wpt/status/console.json @@ -1,7 +1,7 @@ { "idlharness.any.js": { "note": "https://github.com/nodejs/node/issues/44185", - "requires": ["crypto", "small-icu"] + "requires": ["crypto", "inspector", "small-icu"] }, "idlharness-shadowrealm.window.js": { "skip": "ShadowRealm support is not enabled" From ef9ab9927158cbfa874d769d4f5acc9baa5eb75a Mon Sep 17 00:00:00 2001 From: Antoine du Hamel Date: Fri, 17 Oct 2025 12:38:50 +0200 Subject: [PATCH 2/2] fixup! test: fix status when compiled without inspector --- test/common/wpt.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/common/wpt.js b/test/common/wpt.js index 32fe0b64b05fc4..6c9a75e4e4cc53 100644 --- a/test/common/wpt.js +++ b/test/common/wpt.js @@ -412,7 +412,7 @@ class BuildRequirement { // Not using common.hasCrypto because of the global leak checks this.hasCrypto = Boolean(process.versions.openssl) && !process.env.NODE_SKIP_CRYPTO; - + // Not using common.hasInspector because of the global leak checks this.hasInspector = Boolean(process.features.inspector); }