-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Closed
Labels
bugcurrent functionality does not work as desiredcurrent functionality does not work as desiredhelp wantedscope:globbing
Description
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
glob error { Error: EACCES: permission denied, scandir '/home/maritz/{redacted}/db-volume/test'
errno: -13,
code: 'EACCES',
syscall: 'scandir',
path: '/home/maritz/{redacted}/db-volume/test' }
/home/maritz/{redacted}/node_modules/ava/lib/cli.js:206
throw err;
^
Error: EACCES: permission denied, scandir '/home/maritz/{redacted}/db-volume/__tests__/helpers'
at handlePaths (/home/maritz/{redacted}node_modules/ava/lib/ava-files.js:14:18)
at AvaFiles.findTestHelpers (/home/maritz/{redacted}/node_modules/ava/lib/ava-files.js:140:10)
at Api._precompileHelpers (/home/maritz/{redacted}node_modules/ava/api.js:140:5)
at _setupPrecompiler.then (/home/maritz/{redacted}/node_modules/ava/api.js:167:21)
at <anonymous>
Making it work locally
When going manually into
Line 90 in a84c96f
| const defaultHelperPatterns = () => [ |
const defaultHelperPatterns = () => [
'src/**/__tests__/helpers/**/*.js',
'src/**/__tests__/**/_*.js',
'src/**/test/helpers/**/*.js',
'src/**/test/**/_*.js',
];Fix options?
I see two ways to properly fix this (aside from removing inaccessible directories):
- Add an option to change the defaultHelperPattern (related to Too slow in large projects #1418 (comment))
or - Catch EACCES errors and print out a warning and continue
Metadata
Metadata
Assignees
Labels
bugcurrent functionality does not work as desiredcurrent functionality does not work as desiredhelp wantedscope:globbing