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

Question about grunt watch #155

Closed
rmichnik opened this issue Sep 22, 2013 · 8 comments
Closed

Question about grunt watch #155

rmichnik opened this issue Sep 22, 2013 · 8 comments

Comments

@rmichnik
Copy link

When i make some changes in a .js file my grunt watch command close, it's normal?

----------- log -----------

Running "delta" task
Waiting...OK
>> File "src/app/home/home.js" changed.

Running "jshint:src" (jshint) task
>> 4 files lint free.

Running "karma:unit:run" (karma) task
[2013-09-22 18:54:19.326] [DEBUG] config - Loading config /var/www/anotherway/build/karma-unit.js
[2013-09-22 18:54:19.328] [WARN] config - config.configure() is deprecated, please use config.set() instead.
....
Chrome 29.0.1547 (Windows 8): Executed 2 of 2 SUCCESS (0.233 secs / 0.026 secs)

Chrome 29.0.1547 (Windows 8): Executed 2 of 2 SUCCESS (0.233 secs / 0.026 secs)

Done, without errors.

Running "copy:build_appjs" (copy) task
Copied 4 files

Done, without errors.
rmichnik@debian:/var/www/anotherway$
@rmichnik rmichnik reopened this Sep 22, 2013
@joshdmiller
Copy link
Member

No, that's not normal. But there's already a few bug reports: #20, #37, #150, #114, et al. Some of these have suggestions for fixes, but they're all workarounds so they haven't made it into the master yet.

See if ToucheSir's fix in #37 solves your issue.

@rmichnik
Copy link
Author

Thanks @joshdmiller, running grunt delta solved my problem by now.

@roychoo
Copy link

roychoo commented Sep 23, 2013

@joshdmiller hmm i think changing from runnerPort to port is not a workaround. what @ToucheSir say is right. This is because there is no more runnerPort config params in Karma [http://karma-runner.github.io/0.10/config/configuration-file.html], runnerPort was used in 0.8. And grunt-karma is taking the config file as the master config, thus port is actually undefined. But do correct me if i am wrong.

@ToucheSir
Copy link

@roychoo That's the impression I got from the Karma documentation. For some reason, grunt-karma seems to short-circuit when trying to run karma >= 0.9.6 tests in a background process. This seems to be due to Karma merging port and runnerport in 0.9.6 and up.

@roychoo
Copy link

roychoo commented Sep 23, 2013

@ToucheSir hmm i dun think is anything to do with grunt-karma, i think it is the config. After more digging, this is what i found under the runner.js in karma.

 var options = {
    hostname: config.hostname,
    path: config.urlRoot + 'run',
    port: config.port,
    method: 'POST',
    headers: {
      'Content-Type': 'application/json'
    }
  };

it is no longer looking for runnerPort to connect. it is actually looking for port. Did i missed out anything?

@ToucheSir
Copy link

@roychoo ...your discovery seems to solidify the fact that it's grunt-karma's problem. Like I said before, it seems like grunt-karma isn't aware of what port is being used by a karma server run in a background process unless that port is explicitly defined in the config.

My theory is that the background process tries to start a karma server at port 9018 (which is in use by karma:continuous) and is forced to use the next available port (9019) instead. However, grunt-karma and Karma are blissfully unaware of this, thus trying to run tests against the port in karma.conf.js (9018). :(

@roychoo
Copy link

roychoo commented Sep 23, 2013

Updated
@ToucheSir think i got what you mean. Thanks for your clarification.

@roychoo
Copy link

roychoo commented Sep 26, 2013

PR #153

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants