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:
Andrey Lushnikov
2017-12-12 13:34:21 -08:00
committed by GitHub
parent 4eaf52fa1d
commit a5db6d412c
6 changed files with 888 additions and 884 deletions

View File

@@ -1,5 +1,5 @@
http://localhost:8907/frames/nested-frames.html
http://localhost:8907/frames/two-frames.html
http://localhost:8907/frames/frame.html
http://localhost:8907/frames/frame.html
http://localhost:8907/frames/frame.html
http://localhost:<PORT>/frames/nested-frames.html
http://localhost:<PORT>/frames/two-frames.html
http://localhost:<PORT>/frames/frame.html
http://localhost:<PORT>/frames/frame.html
http://localhost:<PORT>/frames/frame.html