Skip to content
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

No coverage when running with mocha --parallel mode #1328

Closed
curbengh opened this issue Jun 25, 2020 · 2 comments
Closed

No coverage when running with mocha --parallel mode #1328

curbengh opened this issue Jun 25, 2020 · 2 comments
Labels

Comments

@curbengh
Copy link

Link to bug demonstration repository

hexojs/hexo#4374

Expected Behavior

nyc --reporter=lcovonly mocha --parallel should produce "./coverage/lcov.info".
nyc --reporter=text-summary mocha --parallel should display coverage report.

Observed Behavior

nyc --reporter=lcovonly mocha --parallel generates an empty "./coverage/lcov.info".
nyc --reporter=text-summary mocha --parallel:

=============================== Coverage summary ===============================
Statements   : Unknown% ( 0/0 )
Branches     : Unknown% ( 0/0 )
Functions    : Unknown% ( 0/0 )
Lines        : Unknown% ( 0/0 )
================================================================================

Troubleshooting steps

No issue in mocha's default serial mode.

Environment Information

  System:
    OS: Linux 4.9 Solus 4.1
    CPU: (1) x64 Intel(R) Core(TM) i7-4500U CPU @ 1.80GHz
    Memory: 1.53 GB / 2.94 GB
  npmPackages:
    nyc: ^15.0.0 => 15.1.0 

".mocharc.yml"

color: true
reporter: spec
ui: bdd
full-trace: true
exit: true
require: 
  - "chai/register-should"
parallel: true
@coreyfarrell
Copy link
Member

If things work without using --parallel could you cross-post an issue to the mochajs repository so they are aware of this potential issue? I haven't had a chance to look into the mocha --parallel implementation so I'm not sure where the issue comes from. Please be sure to link that issue to this one.

I'm pretty busy currently so it might be a while before I have a chance to investigate, for now you will probably have to disable parallel for coverage testing.

curbengh added a commit to curbengh/hexo that referenced this issue Jul 17, 2020
- but disable parallel mode in nyc
  * istanbuljs/nyc#1328
- pass command-line option via npm
  * https://stackoverflow.com/a/14404223
SukkaW pushed a commit to hexojs/hexo that referenced this issue Jul 17, 2020
* perf(mocha): run tests in parallel

- but disable parallel mode in nyc
  * istanbuljs/nyc#1328
- pass command-line option via npm
  * https://stackoverflow.com/a/14404223

* ci(gh-action): run coverage job separately and only once

* chore: ignore nyc lcovonly output
@stale
Copy link

stale bot commented Jun 26, 2021

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale label Jun 26, 2021
@stale stale bot closed this as completed Jul 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants