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

config.include not respected when paths are not in cwd, namely symlinked files #472

Closed
giannic opened this issue Dec 15, 2016 · 4 comments
Closed

Comments

@giannic
Copy link

giannic commented Dec 15, 2016

Expected Behavior

config.include paths override test-exclude lib's explicit ignore of parent paths, ../

Observed Behavior

Any file not in cwd is ignored.

Bonus Points! Code (or Repository) that Reproduces Issue

https://github.com/istanbuljs/test-exclude/blob/master/index.js#L60

Forensic Information

Operating System: OSX 10.10.5
Environment Information:
The caveat comes in here: I am using bazel build system to execute nyc. Bazel achieves fast reproducible builds partly by symlinking required files from a tmp directly under /private/tmp. This means any relFile path will start with ../ for any build done in bazel.

At the moment, I forked the repo with a patch just to move forward, but I would love suggestion and happy to make acceptable changes upstream if necessary

node & npm versions:
v4.6.0
2.15.9

@bcoe
Copy link
Member

bcoe commented Dec 27, 2016

@giannic thanks for reporting this; I'd love to figure a way to better support some common edge-cases like symlinks ... while still preventing weird files from being instrumented, e.g., files outside your project ... seems like there are quite a few edge-cases that would need to be worked through.

@Wedvich
Copy link

Wedvich commented Jan 19, 2017

I have a different, though probably still not very common use case, where I use multiple test frameworks for some setup examples. Basically, I have a directory structure like this:

tap-nyc
    test
        index.spec.js
    package.json
src
    index.spec.js

Using tap-nyc as the working directory, running nyc tap ./test/**/*.spec.js passes the test, but no files are discovered by nyc since it's outside the current working directory, even if I've explicitly asked for the source files to be included using config.include.

@stale stale bot added the wontfix label Jan 6, 2019
@JaKXz
Copy link
Member

JaKXz commented Jan 8, 2019

Looks like this is related to #962

@JaKXz JaKXz removed the wontfix label Jan 8, 2019
@stale stale bot added the stale label Mar 9, 2019
@istanbuljs istanbuljs deleted a comment from stale bot Mar 9, 2019
@stale stale bot removed the stale label Mar 9, 2019
@istanbuljs istanbuljs deleted a comment from stale bot Mar 9, 2019
@stale
Copy link

stale bot commented May 8, 2019

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.

@stale stale bot added the stale label May 8, 2019
@stale stale bot closed this as completed May 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants