From 38848c5bf77b2fa62b3dddecfe1aecba8d4ae48f Mon Sep 17 00:00:00 2001 From: Shelley Vohr Date: Tue, 19 Jul 2022 12:14:21 +0200 Subject: [PATCH] test: optionally validate disabled Node.js specs (#34899) --- script/node-disabled-tests.json | 6 ++---- script/node-spec-runner.js | 21 ++++++++++++++++++--- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/script/node-disabled-tests.json b/script/node-disabled-tests.json index 8870c8fe84..1cec1b9e23 100644 --- a/script/node-disabled-tests.json +++ b/script/node-disabled-tests.json @@ -13,7 +13,6 @@ "parallel/test-crypto-des3-wrap", "parallel/test-crypto-dh-stateless", "parallel/test-crypto-ecb", - "parallel/test-crypto-engine", "parallel/test-crypto-fips", "parallel/test-crypto-keygen", "parallel/test-crypto-keygen-deprecation", @@ -21,7 +20,7 @@ "parallel/test-crypto-padding-aes256", "parallel/test-crypto-secure-heap", "parallel/test-fs-utimes-y2K38", - "parallel/test-heapsnapshot-near-heap-limit-worker.js", + "parallel/test-heapsnapshot-near-heap-limit-worker", "parallel/test-http2-clean-output", "parallel/test-https-agent-session-reuse", "parallel/test-https-options-boolean-check", @@ -96,7 +95,6 @@ "parallel/test-trace-events-fs-sync", "parallel/test-trace-events-metadata", "parallel/test-trace-events-none", - "parallel/test-trace-events-perf", "parallel/test-trace-events-process-exit", "parallel/test-trace-events-promises", "parallel/test-trace-events-v8", @@ -125,7 +123,7 @@ "report/test-report-writereport", "sequential/test-cpu-prof-kill", "sequential/test-diagnostic-dir-cpu-prof", - "sequential/test-cpu-prof-drained.js", + "sequential/test-cpu-prof-drained", "sequential/test-tls-connect", "wpt/test-webcrypto" ] diff --git a/script/node-spec-runner.js b/script/node-spec-runner.js index 3454843c86..570a4d00df 100644 --- a/script/node-spec-runner.js +++ b/script/node-spec-runner.js @@ -3,7 +3,7 @@ const fs = require('fs'); const path = require('path'); const args = require('minimist')(process.argv.slice(2), { - boolean: ['default'], + boolean: ['default', 'validateDisabled'], string: ['jUnitDir'] }); @@ -43,8 +43,7 @@ const getCustomOptions = () => { customOptions = customOptions.concat(extra); } - // We need this unilaterally or Node.js will try - // to run from out/Release/node. + // Necessary or Node.js will try to run from out/Release/node. customOptions = customOptions.concat([ '--shell', utils.getAbsoluteElectronExec() @@ -54,6 +53,22 @@ const getCustomOptions = () => { }; async function main () { + // Optionally validate that all disabled specs still exist. + if (args.validateDisabled) { + const missing = []; + for (const test of DISABLED_TESTS) { + const testName = test.endsWith('.js') ? test : `${test}.js`; + if (!fs.existsSync(path.join(NODE_DIR, 'test', testName))) { + missing.push(test); + } + } + + if (missing.length > 0) { + console.error(`Found ${missing.length} missing disabled specs: \n${missing.join('\n')}`); + process.exit(1); + } + } + const options = args.default ? defaultOptions : getCustomOptions(); const testChild = cp.spawn('python3', options, {