mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
test: migrate test.js to support concurrent test execution (#1531)
This patch migrates tests so that they can be run concurrently. - By default, tests still run in one thread. - To run tests in 4 parallel threads, run node test/test.js -j 4 or npm run unit -- -j 4 - Environment variable PPTR_PARALLEL_TESTS could be set to override default parallelization Every test gets passed in a state. State is set up in the beforeAll and beforeEach callbacks, and should be teared down in the afterAll and afterEach callbacks. By default, state has a parallelIndex variable initialized that defines the thread index that runs the execution.
This commit is contained in:
@@ -67,7 +67,7 @@ const utils = module.exports = {
|
||||
*/
|
||||
dumpFrames: function(frame, indentation) {
|
||||
indentation = indentation || '';
|
||||
let result = indentation + frame.url();
|
||||
let result = indentation + frame.url().replace(/:\d{4}\//, ':<PORT>/');
|
||||
for (const child of frame.childFrames())
|
||||
result += '\n' + utils.dumpFrames(child, ' ' + indentation);
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user