angular / angular-cli

CLI tool for Angular
https://cli.angular.io
MIT License
26.72k stars 11.98k forks source link

In `ng test` Reduce 5 second pause between saving a file and running tests #2338

Closed petebacondarwin closed 7 years ago

petebacondarwin commented 7 years ago

Please provide us with the following information:

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

Macbook Air: OSX (El Capitan) 10.11.6

  1. Versions. Please run ng --version. If there's nothing outputted, please run in a Terminal: node --version and paste the result here:

angular-cli: 1.0.0-beta.15 node: 6.5.0 os: darwin x64

  1. Repro steps. Was this an app that wasn't created using the CLI? What change did you do on your code? etc.
  2. The log given by the failure. Normally this include a stack trace and some more information.
  3. Mention any other details that might be useful.

This is becoming very frustrating for doing any kind of TDD since it breaks your focus waiting for a change to be tested. Even some logging indicator that something is happening would help psychologically. (Discussed with Filipe on Slack)


Thanks! We'll be in touch soon.

ValeryVS commented 7 years ago

Are browser remain launched while watching for changes? May be browser is closed after test finish and restarted after file saving for some reason (on OSX)? On Ubuntu, it takes ~5 sec before first test (browsers are launching), but next time runs immediately.

catull commented 7 years ago

With Angular CLI 1.0.0.beta.30, I do not experience 5 seconds "grace period". I either change the spec or source TS file, and the tests are performed right away.

hccampos commented 7 years ago

I think it has to do with the number of modules (and especially connected modules) that you have in a project. Large projects take a long time to recompile and re-run the tests. At Pix4d our project is growing larger each day and our waiting period is now between 5,5s and 15s depending on which file gets touched. I've even experienced over 20s when touching certain files that depend on a lot of stuff, although that is not so common.

Unfortunately I don't think there is a lot that can be done (would love to be wrong about this), especially in the CLI. Or maybe there could be a way of including certain files for testing by looking for "fdescribe"?

filipesilva commented 7 years ago

@petebacondarwin do you still these delays?

petebacondarwin commented 7 years ago

I haven't noticed it recently but I have not been running large test suites either.

filipesilva commented 7 years ago

I'll closed as fixed for now, but will reopen if it comes up again.

angular-automatic-lock-bot[bot] commented 5 years ago

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.