Skip to content

Test ordering

Whether or not test selection is on, Selective orders the queue so a failure shows up as early as possible.

  1. Tests that exercise the changed files. The runner works out the change by diffing the head commit against the base commit or target branch (SELECTIVE_BASE_SHA, or SELECTIVE_TARGET_BRANCH, both set automatically on detected providers). Tests whose files are in that diff go to the front.
  2. Tests for files that change together. From recent history on the target branch, Selective knows which files tend to be committed alongside the changed ones, and pulls their tests forward too.
  3. Everything else.

Because results stream back as tests finish, a change that breaks its own tests usually produces a red result in the dashboard or in selective tail within seconds of the run starting, while the rest of the suite is still running.

Ordering needs the base commit or target branch. Without either, Selective only knows the head commit and falls back to plain distribution.