-
-
Notifications
You must be signed in to change notification settings - Fork 359
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
--all is super broken #938
Comments
I think I'm seeing consistent results when I add I ran =============================== Coverage summary ===============================
Statements : 83.62% ( 1179/1410 )
Branches : 75.46% ( 692/917 )
Functions : 83.71% ( 221/264 )
Lines : 84.38% ( 1161/1376 )
================================================================================ from my fork: https://github.com/JaKXz/exegesis
|
my bet would be that this is order of operations of how the raw coverage data is combined across multiple processes; issues along these lines have cropped up quite a bit with TypeScript, which requires several source-map transformations to map coverage. |
No, it's not /s |
I strongly encourage the use of the nyc-config-typescript package as a base config for typescript projects! It's been mostly effective in helping people with basic problems like this! @jwalton @za-creature can you try that and let me know if you're still experiencing this isssue? |
I can confirm that @JaKXz the nyc-config-typescript package doesn't help here. It's just a base config without specifying |
@morris your package is using very old versions of almost everything. Simply upgrading everything causes the test to fail. [email protected] was just released which does fix some issues with ts + source-map + all. Please update your repository, if you are continuing to have trouble please post a new bug including all requested information. |
@morris I fixed your example repo in a couple minutes: philipbeel/example-typescript-nyc-mocha-coverage#2 The documentation for nyc-config-typescript has been updated recently. Please follow it closely. |
Thanks @JaKXz, this works :) not my repo, though - hopefully the PR is accepted for other googlers. FWIW here's the config that lead me to believe --all is bad:
When used in @JaKXz fork, and running "npm run coverage" twice without clearing .nyc_output, this gives me weird results (only on the test files). Surely a contrived example (nothing excluded etc.) but something similar happened to us in our project, and I wouldn't expect it to break. Note the ".js" extension; it's this exact combination which breaks, and only without clearing .nyc_output, so maybe not even an issue with --all. |
Not exactly sure how that is happening, unless you have modified the Correct me if I'm wrong @bcoe @coreyfarrell? |
That is correct, deleting |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I was just running into similar perplexing issues with |
Link to bug demonstration repository.
https://github.com/exegesis-js/exegesis
Expected Behavior
--all should include all files
Observed Behavior
--all does not include all files, and sometimes randomly drops files (sometimes even files with coverage), or (extra weirdly) parts of files.
If you run (and re-run)
npx nyc mocha 'test/**/*.@(ts|js)'
in the Exegesis repo, it will sometimes report:And sometimes report:
Note the total number of lines has changed. Repeated runs will always generate either 1164/1396 statements covered, or 1064/1269 covered, seemingly at random. Digging a little deeper, in the "bad case" some files have most of their lines mysteriously not counted:
And some files are just missing entirely (despite the fact that I'm using --all):
Removing the "all" option (from .nycrc in this case) seems to fix the problem, and I consistently get 1164/1396 statements covered.
Forensic Information
Operating System: MacOS 10.13.6 (High Sierra)
Environment Information: https://gist.github.com/jwalton/5107d4db159ef4dcd9f1d233b92a0f4c
(And, I tried upgrading to nyc 13.1.0 after I grabbed this output.txt - no difference.)
The text was updated successfully, but these errors were encountered: