-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Scan for test helpers causes error when non-accessible folders present #1793
Comments
Sorry you're running into this @maritz. We do need to change how we select files but it's a larger change. I haven't been able to focus on that part of the project unfortunately. Ignoring I've done a lot of thinking on this previously, but then didn't get round to implementing anything. Regardless of where we end up eventually, I think it should be possible to disable helper compilation altogether. That is something we could add now. What do you think? Setting |
It would fix my specific issue, for sure. Not sure it's the best long-term solution for everyone though. I am curious though: Why would printing an error and ignoring potentially cause breakage in your opinion? |
It's not, but it's a feature we'll end up having anyway, and it fixes some problems now.
I assume the error will mean we don't find any helper files. So one day AVA compiles your helpers, and the next it doesn't, because there's a directory it can't traverse. Know you're left wondering why helper compilation stopped working. |
Well, it would log out a warning about the inaccessible directories. But if the user makes the directory that contains his helpers inaccessible (or something else does), it's not gonna work anymore anyways, right?! |
We only get all glob results or an error, so we can't warn. Long term we'd want to exit with an error and have users exclude those directories from the |
Oh. that makes sense. 👍 |
Description
When there is a directory in your project that is unaccessible by the user runnig the tests, ava runs into an error during startup and exits.
In my case this is a volume created by the postgresql docker image and it resets the directory permissions on every start.
The problem is that the defaultHelperPatterns are set in a way that tries to read all directories and cannot be changed afaict.
Error Message & Stack Trace
Making it work locally
When going manually into
ava/lib/ava-files.js
Line 90 in a84c96f
Fix options?
I see two ways to properly fix this (aside from removing inaccessible directories):
or
The text was updated successfully, but these errors were encountered: