1. 2

  2. 1

    We have/has a similar issued, where our test suite took about 20 minutes to run. We did similar things to shave off a couple of minutes, but the biggest improvements came from a different approach:

    Slow tests are often caused by slow code.

    Your tests are calling stuff in your codebase. If your codebase has performance problems, your tests will, too. We halved our test runtime by optimizing a few methods and fixing a quirk in our caching layer.

    1. 1

      In our case, we should less rely on the database. For example, we should test once the database scope the fetch specific data and in other tests, stub it.