Skip to content

Guides

How to run only the tests affected by a change

Every push runs the whole test suite regardless of what changed.

6 min read

Every push runs the whole test suite regardless of what changed.

Why it happens

There is no mapping from changed files to affected tests, so CI has to assume everything is affected.

How to fix it

  1. Adopt a build system with affected-target analysis (Nx, Turborepo, Bazel, Pants)
  2. Fetch full git history so the base comparison is correct
  3. Keep a full-suite run on main so nothing hides behind a bad dependency graph
  4. Start with coarse path filters if a full task graph is too large a change

Your next build could be twice as fast, at half the price

Start free. Migrating away is the same one line, and we publish that diff too.