-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
perf(mocha): run tests in parallel #4374
Conversation
it's not reliable yet, unit test sometimes fail with:
|
Appears that failed tests are related with fs operation. |
nyc is currently incompatible with mocha parallel mode, can confirm in my machine. |
@curbengh We can run coverage only once, while the other tests can be still run in parallel. |
Mocha supports environment variable Edit: Apparently not... |
Currently, coverall is executed in every job. Perhaps can migrate to a dedicated job? |
+1 |
- but disable parallel mode in nyc * istanbuljs/nyc#1328 - pass command-line option via npm * https://stackoverflow.com/a/14404223
aff32b1
to
5359528
Compare
run: npm run test | ||
env: | ||
CI: true | ||
coverage: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in previous draft, this job is integrated into tester
job with if: ${{ matrix.os == 'ubuntu-latest' && matrix.node-version == '12.x' }}
, but then tester
would have one extra mocha execution which defeats the purpose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
What does it do?
A new feature of mocha@8. Consistently 3s faster in my single-core VM.
nyc (for now, v15.1.0) doesn't support mocha's parallel mode yet, so parallel mode is disabled in test coverage job.
How to test
Screenshots
Pull request tasks