-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
file paths that includes parentheses causes base directory to be wrong #728
Comments
I don't understand this issue. Why should |
doh! my \ before *.js disappeared. Edited issue to be more clear. Previously there was a \ before *.js but I added anotherDirectory to make the example more clear. I hope this helps! |
I have run into this or a similar problem. I have a very simple karma project generating very high CPU loads, but only when the project is located in a deep directory path, including space and parantheses. Relevant Karma config: Running with --log-level debug reveals that Karma is watching lots of files in other directories on my hard drive. I am running the Karma projects in these two locations:
Number one works fine, number two gives huge CPU load. This suggests that something with the path causes the problem. My gut feeling is that the space rather than parantheses is the problem. Please tell if more details are required. edit: spelling |
Ok, I see now. Yep, the parentheses is the problem. I didn't know that just parenthesis does not mean any special glob/fnmatch pattern, so we can actually get parentheses to work. I'm working on it. |
If a file paths for items listed in files configuration section contains parentheses, the base directory for those files is incorrectly inferred.
Example:
C:\path\to\my\files\something(other thing)\anotherDirectory*.js
Base directory is inferred as:
C:\path\to\my\files\
instead of:
C:\path\to\my\files\something(other thing)\anoterDirectory\
This causes karma to watch all files in the wrong directory and may cause high CPU useage. In my case it was 80% cpu usage because it was watching 1000s of files.
Windows 7
Karma: 0.10.2
The cause is the regex in function baseDirFromPattern in watch.js
https://github.com/karma-runner/karma/blob/master/lib/watcher.js#L11
If I knew regex better or what exactly this was doing, I would attempt to fix it.
The text was updated successfully, but these errors were encountered: