Issues getting tests running through

I’ve got the task of getting existing tests in a moderately sized ember app running and passing. I’m pretty much brand new to ember right now. I’m running into a number of frustrating issues, and looking for some ideas on things to investigate and try. We’re running ember-cli 1.13.8 on windows.

First of all, ‘ember test’ is running extremely slowly. There’s several hundred tests in place (90% of them are the boiler place ‘it exists’ and ‘should pass jshint’), and are taking many minutes to finish. The first ~150 run in 30 seconds, then from then on they run in bursts, maybe around 5 per minute. This is as a process running as admin. What could be taking this much time in these simple tests? What can I pull apart to try to investigate more? I haven’t quite worked out yet how to run from a lower level (like PhantomJS directly perhaps?)

There’s very little CPU activity whle everything is hanging, so it seems to be some sort of wait.

To cut down on the sheer number of tests, can’t I just get rid of the endless JSHint tests and just run this as a build step? I’m thinking this may be useful to deal with the performance issues.

When tests are run via the browser, I’m affected by this issue in all of the integration tests in place today. I haven’t been able to get all tests to run on the command line because of the performance issue, so not sure if they are passing here. Any ideas on what the resolution might be for that issue? Also, any suggestions on the guts of how imports are actually resolved in this piece would be useful to try to drill into it further myself.

Apologies for including several issues here, maybe I should create a seperate post for the hbs issue so I can include my package.json etc. Any thoughts on helping with these issues would be much appreciated.

I’ve been able to use the PhantomJS debugger to set and catch a debugger statement in the first test that runs slow, after the first ~160 instantaneous tests finish. It does seem to be failing with a test timeout, although:

  • The test code itself appears to step through without any delays
  • No timeout errors are reported via testem/ember test

It seems like one of the runner layers (phantom, testem, ember) is waiting before it starts to run these failing tests.

After some more trial and error, I think I’ve found a reason for tests hanging. By bringing tests in and out, I’ve found unit tests take a long time to fail if they are trying to test something that doesn’t exist. They fail with an error like:

message: > beforeEach failed on it renders: Attempting to register an unknown factory: component:link-li

Has anyone come across this before, or have a theory on it? If it’s a bug, it probably needs an issue over on github right?