3

Is it slow ?

taliking about unit tests. I have 2746 unit tests in a project (Covering around 15% of code).

It takes around 2 minutes in local (With good PC) and aroubnd 20 minutes in a pipeline to execute.

Would you people say it's slow ?

Comments
  • 4
  • 2
  • 2
    sounds like a nightmare

    I'm a fan of subdividing things into self-contained libraries
  • 3
    2748 for 15% of the code.

    100% test coverage would be then 18320 Tests.
  • 5
    My guy if you are waiting that long for 15% coverage you might as well delete them
  • 3
    2 minutes is okay local, approx 50ms per test... but 20 minutes is too long for pipeline! it's a pain to wait!

    if they're truly unit tests, you should be able to parallelize them (most runners do that automatically nowadays, but could depend on what language / framework you're using....)
  • 2
    This should depend on the pipeline runner configuration. Unit test locally uses your local compute. I.e. your ram and your processor. Your pipeline runner would have a different configuration from your local.
  • 1
    @fullstackcircus that's why in local it's so fat. 12 cores ;p In azure pipeline it only runs 2 tests at a time at most
  • 1
    @fullstackcircus the thing is, some of them are "too" testy

    For example, let's say you have a method on a controller which will check acces rights / role and than call internal service

    What you would expect in unit test : Check if service is called. That's all (Via mock)

    What's hapening : The service is actuallty called and whole code executed, even if this method has another specific unit test. Basiclly it executes a bit too much.
Add Comment