5

We are facing an issue where our tests will start failing or running extremely slow after a certain point. I have seen articles online where others too are facing issues. The primary reason for those failures are memory consumed by browsers while we deal with DOM. We are using seed project which builds our application using SystemJS. Our Current version of Angular is 2.2.3.

So, I am thinking of a work around where I can either parallel process our test runs (i.e. multiple karma server running, I did try that but it starts to consume 100% CPU) or batch processing. So, batches of small test runs which will ensure that karma is stopped and started again.

Is there a way?

Also, if we are able to achieve that, how to get a consistent coverage? We are using istanbul.

Please let me know if you have any more questions.

e.g. our service and model related tests run in 3 seconds (500+ tests) but our component tests (900+) take 15 mins.

TypeScripter
  • 879
  • 2
  • 10
  • 23
  • 1
    Our team also has an interest in a test sharding feature. There's an open issue in the Karma backlog but it's old and seems to have lost momentum. https://github.com/karma-runner/karma/issues/439 – stealththeninja May 03 '17 at 16:23
  • yes, I have seen that thread. Didn't help much. May be if this question gets enough votes, it reaches some ears. – TypeScripter May 03 '17 at 17:42

1 Answers1

0

There is pretty good plugin for Karma that allows sharding tests and executing them in parallel - https://www.npmjs.com/package/karma-parallel We have integrated it in both AngularJS & Angular 4 & 5 projects. With code-base with more than 2000 tests it is a must.

Branislav Abadjimarinov
  • 5,101
  • 3
  • 35
  • 44