chore: add memory debugging to mocha runner (#11722)

This commit is contained in:
Alex Rudenko
2024-01-23 14:26:57 +01:00
committed by GitHub
parent d17a9df027
commit afa3fd4c34
2 changed files with 24 additions and 0 deletions

View File

@@ -46,6 +46,7 @@ const {
minTests,
shard,
reporter,
printMemory,
} = yargs(hideBin(process.argv))
.parserConfiguration({'unknown-options-as-args': true})
.scriptName('@puppeteer/mocha-runner')
@@ -82,6 +83,10 @@ const {
string: true,
requiresArg: true,
})
.option('print-memory', {
boolean: true,
default: false,
})
.parseSync();
function getApplicableTestSuites(
@@ -197,6 +202,10 @@ async function main() {
'trace-warnings',
];
if (printMemory) {
args.push('-n', 'expose-gc');
}
const specPattern = 'test/build/**/*.spec.js';
const specs = globSync(specPattern, {
ignore: !includeCdpTests ? 'test/build/cdp/**/*.spec.js' : undefined,