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

coverage folder is not being excluded on nyc@10.2.0 #557

Closed
astorije opened this issue Apr 20, 2017 · 5 comments
Closed

coverage folder is not being excluded on nyc@10.2.0 #557

astorije opened this issue Apr 20, 2017 · 5 comments
Labels

Comments

@astorije
Copy link

Expected Behavior

coverage/ folder being excluded even when not present from the exclude list.

Observed Behavior

screen shot 2017-04-19 at 01 22 12

See comment made at #502 (comment).

Bonus Points! Code (or Repository) that Reproduces Issue

Look at https://github.com/thelounge/lounge/blob/master/.nycrc (that gets run with npm run coverage). We removed coverage/ from the exclude list of The Lounge here but I have just noticed that it is not ignored anymore.

Forensic Information

Operating System: macOS 10.11.6
Environment Information: Result of sh -c 'node --version; npm --version; npm ls'

@bcoe
Copy link
Member

bcoe commented May 14, 2017

@astorije I believe the underlying issue might be that the coverage folder looks to be nested under the lounge folder -- this is a bit strange (I think I might only add the top level ./coverage to test-exclude).

Should we be excluding it at all levels?

@astorije
Copy link
Author

astorije commented May 14, 2017

I'm not sure what you mean by that, @bcoe.

$ npm run coverage
...
$ ls -la
...
drwxr-xr-x    5 jeremie  staff   170B May 13 20:47 .nyc_output/
-rw-r--r--    1 jeremie  staff   200B Apr 28 14:23 .nycrc
...
drwxr-xr-x    5 jeremie  staff   170B Apr 17 23:29 coverage/
...

The lounge folder on my screenshot is the top-level folder, i.e. what you get when you run git clone https://github.com/thelounge/lounge.

@bcoe
Copy link
Member

bcoe commented May 14, 2017

@astorije are you running an lcov report in the above example? I would expect the top level to look more like this:

screen shot 2017-05-13 at 7 00 21 pm

I ran the above report with JavaScript in the coverage folder, and it doesn't show up in the report -- it seems almost as though nyc thinks tests are being run one level above the root folder is all I can think of.

@astorije
Copy link
Author

I'm only running npm run coverage, which in turn runs nyc mocha with this .nycrc file (where there is the lcov reporter indeed).
Sorry I'm not helping much, we don't make an extensive use of nyc/istanbul in the project yet so experience is limited.

@bcoe
Copy link
Member

bcoe commented Jul 30, 2017

@astorije took the time to look into things a little bit for you, sorry for the slow reply.

If you add this to your exclude, **/coverage/**, then things should work as expected. The problem is that something in your testing configuration is changing the root folder, so that file paths are reported as lounge/coverage/foo.js rather than the expected coverage/foo.js -- not quite sure what's munging your file paths (nothing immediately jumped out at me in the project). But adding that additional exclude rule should at least work around the problem.

@bcoe bcoe closed this as completed Jul 30, 2017
@bcoe bcoe added the triaged label Jul 30, 2017
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