karma-runner / karma

Spectacular Test Runner for JavaScript
http://karma-runner.github.io
MIT License
11.96k stars 1.71k forks source link

Autowatch with wildcards doesn't work #1249

Closed y-lohse closed 9 years ago

y-lohse commented 9 years ago

Hi, In my karma config, I am watching some files directly, and some via wildcards. autowatch is set to true and works fine for directly referenced files, but not for those who should be matched by wildcards.

I don't think this is related to #895. I tried using diferent text editors and setting usePolling to true but to no effect.

I'm using:

I'm attaching the watcher logs below. Sorry for the formatting... you know, windows "terminal" :unamused:

DEBUG [watcher]: Resolved files:
        c:/Users/caldera/Documents/GitHub/Kerouac/node_modules/karma-jasmine/lib
/jasmine.js
        c:/Users/caldera/Documents/GitHub/Kerouac/node_modules/karma-jasmine/lib
/boot.js
        c:/Users/caldera/Documents/GitHub/Kerouac/node_modules/karma-jasmine/lib
/adapter.js
        C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/jquery-custom/jquery.mi
n.js
        C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/slip/slip.js
        C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/composer/composer.js
        C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/mousetrap/mousetrap.js
        C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/moment-custom/moment-wi
th-langs.js
        C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angular/angular.js
        C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angular-route/angular-r
oute.min.js
        C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angular-touch/angular-t
ouch.min.js
        C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angular-animate/angular
-animate.min.js
        C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/ng-file-upload/angular-
file-upload.min.js
        C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angular-filesystem/angu
lar-filesystem.js
        C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angular-md5/angular-md5
.js
        C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angular-scroll/angular-
scroll.js
        C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angular-websocket/angul
ar-websocket.js
        C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angular-gestures/gestur
es.js
        C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angular-translate/angul
ar-translate.js
        C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angular-translate-loade
r-static-files/angular-translate-loader-static-files.js
        C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angular-sanitize/angula
r-sanitize.js
        C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angular-moment/angular-
moment.js
        C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angular-mocks/angular-m
ocks.js
        C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angular-cookies/angular
-cookies.js
        C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/storage/Storage.js
        C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/ChromeProvider/ChromePr
ovider.js
        C:/Users/caldera/Documents/GitHub/Kerouac/js/app/app.js
        C:/Users/caldera/Documents/GitHub/Kerouac/js/app/controllers.js
        C:/Users/caldera/Documents/GitHub/Kerouac/js/app/directives.js
        C:/Users/caldera/Documents/GitHub/Kerouac/js/app/filters.js
        C:/Users/caldera/Documents/GitHub/Kerouac/js/app/services.js
        C:/Users/caldera/Documents/GitHub/Kerouac/test/mock/MockData.js
        C:/Users/caldera/Documents/GitHub/Kerouac/test/unit/controllers/IndexSpe
c.js
        C:/Users/caldera/Documents/GitHub/Kerouac/test/unit/controllers/SpoolerS
pec.js
        C:/Users/caldera/Documents/GitHub/Kerouac/test/unit/controllers/ModesSpe
c.js
        C:/Users/caldera/Documents/GitHub/Kerouac/test/unit/controllers/Explorer
Spec.js
        C:/Users/caldera/Documents/GitHub/Kerouac/test/unit/controllers/Settings
Spec.js
        C:/Users/caldera/Documents/GitHub/Kerouac/test/unit/filters/FiltersSpec.
js
DEBUG [watcher]: Watching "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/jque
ry-custom/jquery.min.js"
DEBUG [watcher]: Watching "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/slip
/slip.js"
DEBUG [watcher]: Watching "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/comp
oser/composer.js"
DEBUG [watcher]: Watching "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/mous
etrap/mousetrap.js"
DEBUG [watcher]: Watching "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/mome
nt-custom/moment-with-langs.js"
DEBUG [watcher]: Watching "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angu
lar/angular.js"
DEBUG [watcher]: Watching "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angu
lar-route/angular-route.min.js"
DEBUG [watcher]: Watching "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angu
lar-touch/angular-touch.min.js"
DEBUG [watcher]: Watching "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angu
lar-animate/angular-animate.min.js"
DEBUG [watcher]: Watching "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/ng-f
ile-upload/angular-file-upload.min.js"
DEBUG [watcher]: Watching "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angu
lar-filesystem/angular-filesystem.js"
DEBUG [watcher]: Watching "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angu
lar-md5/angular-md5.js"
DEBUG [watcher]: Watching "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angu
lar-scroll/angular-scroll.js"
DEBUG [watcher]: Watching "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angu
lar-websocket/angular-websocket.js"
DEBUG [watcher]: Watching "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angu
lar-gestures/gestures.js"
DEBUG [watcher]: Watching "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angu
lar-translate/angular-translate.js"
DEBUG [watcher]: Watching "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angu
lar-translate-loader-static-files/angular-translate-loader-static-files.js"
DEBUG [watcher]: Watching "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angu
lar-sanitize/angular-sanitize.js"
DEBUG [watcher]: Watching "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angu
lar-moment/angular-moment.js"
DEBUG [watcher]: Watching "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angu
lar-mocks/angular-mocks.js"
DEBUG [watcher]: Watching "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angu
lar-cookies/angular-cookies.js"
DEBUG [watcher]: Watching "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/stor
age/Storage.js"
DEBUG [watcher]: Watching "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/Chro
meProvider/ChromeProvider.js"
DEBUG [watcher]: Watching "C:/Users/caldera/Documents/GitHub/Kerouac/js/app"
DEBUG [watcher]: Watching "C:/Users/caldera/Documents/GitHub/Kerouac/test/mock"
DEBUG [watcher]: Watching "C:/Users/caldera/Documents/GitHub/Kerouac/test/unit/c
ontrollers/IndexSpec.js"
DEBUG [watcher]: Watching "C:/Users/caldera/Documents/GitHub/Kerouac/test/unit/c
ontrollers/SpoolerSpec.js"
DEBUG [watcher]: Watching "C:/Users/caldera/Documents/GitHub/Kerouac/test/unit/c
ontrollers/ModesSpec.js"
DEBUG [watcher]: Watching "C:/Users/caldera/Documents/GitHub/Kerouac/test/unit/c
ontrollers/ExplorerSpec.js"
DEBUG [watcher]: Watching "C:/Users/caldera/Documents/GitHub/Kerouac/test/unit/c
ontrollers/SettingsSpec.js"
DEBUG [watcher]: Watching "C:/Users/caldera/Documents/GitHub/Kerouac/test/unit/f
ilters/FiltersSpec.js"
DEBUG [watcher]: Add file "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/mome
nt-custom/moment-with-langs.js" ignored. Already in the list.
DEBUG [watcher]: Add file "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/mous
etrap/mousetrap.js" ignored. Already in the list.
DEBUG [watcher]: Add file "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angu
lar-touch/angular-touch.min.js" ignored. Already in the list.
DEBUG [watcher]: Add file "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angu
lar-route/angular-route.min.js" ignored. Already in the list.
DEBUG [watcher]: Add file "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/slip
/slip.js" ignored. Already in the list.
DEBUG [watcher]: Add file "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angu
lar-animate/angular-animate.min.js" ignored. Already in the list.
DEBUG [watcher]: Add file "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/comp
oser/composer.js" ignored. Already in the list.
DEBUG [watcher]: Add file "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/ng-f
ile-upload/angular-file-upload.min.js" ignored. Already in the list.
DEBUG [watcher]: Add file "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angu
lar/angular.js" ignored. Already in the list.
DEBUG [watcher]: Add file "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angu
lar-filesystem/angular-filesystem.js" ignored. Already in the list.
DEBUG [watcher]: Add file "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angu
lar-scroll/angular-scroll.js" ignored. Already in the list.
DEBUG [watcher]: Add file "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angu
lar-websocket/angular-websocket.js" ignored. Already in the list.
DEBUG [watcher]: Add file "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angu
lar-md5/angular-md5.js" ignored. Already in the list.
DEBUG [watcher]: Add file "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angu
lar-translate/angular-translate.js" ignored. Already in the list.
DEBUG [watcher]: Add file "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angu
lar-translate-loader-static-files/angular-translate-loader-static-files.js" igno
red. Already in the list.
DEBUG [watcher]: Add file "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angu
lar-moment/angular-moment.js" ignored. Already in the list.
DEBUG [watcher]: Add file "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angu
lar-sanitize/angular-sanitize.js" ignored. Already in the list.
DEBUG [watcher]: Add file "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angu
lar-gestures/gestures.js" ignored. Already in the list.
DEBUG [watcher]: Add file "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angu
lar-mocks/angular-mocks.js" ignored. Already in the list.
DEBUG [watcher]: Add file "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/angu
lar-cookies/angular-cookies.js" ignored. Already in the list.
DEBUG [watcher]: Add file "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/stor
age/Storage.js" ignored. Already in the list.
DEBUG [watcher]: Add file "C:/Users/caldera/Documents/GitHub/Kerouac/js/lib/Chro
meProvider/ChromeProvider.js" ignored. Already in the list.
DEBUG [watcher]: Add file "C:/Users/caldera/Documents/GitHub/Kerouac/test/unit/c
ontrollers/ModesSpec.js" ignored. Already in the list.
DEBUG [watcher]: Add file "C:/Users/caldera/Documents/GitHub/Kerouac/test/unit/f
ilters/FiltersSpec.js" ignored. Already in the list.
DEBUG [watcher]: Add file "C:/Users/caldera/Documents/GitHub/Kerouac/test/unit/c
ontrollers/ExplorerSpec.js" ignored. Already in the list.
DEBUG [watcher]: Add file "C:/Users/caldera/Documents/GitHub/Kerouac/test/unit/c
ontrollers/SpoolerSpec.js" ignored. Already in the list.
DEBUG [watcher]: Add file "C:/Users/caldera/Documents/GitHub/Kerouac/test/unit/c
ontrollers/SettingsSpec.js" ignored. Already in the list.
DEBUG [watcher]: Add file "C:/Users/caldera/Documents/GitHub/Kerouac/test/unit/c
ontrollers/IndexSpec.js" ignored. Already in the list.

i can attach my karma conf if it helps but it's pretty standard. The files watched via wildcards are resolved in the logs above, but changes have no effect.

maksimr commented 9 years ago

@y-lohse can you create small(small as possible) gist which reproduce this problem. Thanks!

y-lohse commented 9 years ago

Yup, there you go: https://gist.github.com/y-lohse/4b09cdf3a2fae560a65f

maksimr commented 9 years ago

@y-lohse Thanks!

JetFault commented 9 years ago

@maksimr Is there a reason watcher doesn't use node-glob after https://github.com/karma-runner/karma/blob/master/lib/watcher.js#L23

maksimr commented 9 years ago

@JetFault yup see comment

JetFault commented 9 years ago

@maksimr Maybe use minimatch's implementation for brace expansion?

maksimr commented 9 years ago

@JetFault maybe. Pull request are welcome :) Thanks!

maksimr commented 9 years ago

Fix in canary branch