test: optionally validate disabled Node.js specs (#34899)
This commit is contained in:
parent
57b02e153d
commit
38848c5bf7
2 changed files with 20 additions and 7 deletions
|
@ -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, {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue