Turnstile/Select Turnstile Merge →

Turnstile Select

Run only the tests a pull request can affect.

Set up in about ten minutes: install the GitHub App, paste one prompt into your coding agent, merge one pull request. Select starts in shadow mode, so nothing is skipped until you turn it on.

Fails safeAny error, timeout, stale map, fork PR or risky file change runs the whole suite.
No secrets to storeCI proves which repo it is with GitHub's OIDC token. Nothing to paste into settings.
Only paths leave CIThe map holds file paths and test names. No source code or coverage lines.
  1. Install Turnstile on GitHub

    Pick the repositories you want faster tests in. Turnstile reads file paths, pull request metadata and your .turnstile/select.yml. Your source code stays in your CI.

    Install on GitHub →

  2. Let your coding agent set it up recommended

    Paste it into Claude Code, Cursor or any coding agent in your repository. It runs the setup, checks it against your CI and opens the pull request, for pytest, Jest and Vitest.

    See the prompt
    Set up Turnstile Select in this repository. It skips the tests a pull request can't affect. Guide: https://select.withturnstile.com/start
    
    1. First, find this repository's GitHub ids: `gh api repos/OWNER/REPO --jq '.owner.id, .id'` (or `curl -s https://api.github.com/repos/OWNER/REPO` for a public repo), with OWNER/REPO from `git remote get-url origin`. Give me this link, with this repository already selected, and ask me to install the Turnstile GitHub App on it if I haven't: https://github.com/apps/turnstile-ci/installations/new/permissions?target_id=<owner id>&repository_ids[]=<repo id>. Carry on while I do; nothing below needs it.
    2. Look at .github/workflows to see how CI installs dependencies and runs the tests.
    3. Python with pytest: run `pip install turnstile-select && tu-select init`. It writes .github/workflows/turnstile-select-map.yml and .turnstile/select.yml, and edits each pytest job for you.
       Jest or Vitest: run `npx -y -p @withturnstile/select tu-select-js init --suite web` (use a short name for the suite if "web" doesn't fit). It writes .github/workflows/turnstile-select-map-<suite>.yml and adds its suite to .turnstile/select.yml, and edits each Jest or Vitest job for you.
       A repo with both: do both, in either order.
    4. Do anything init says it could not do, by hand.
    5. Check that the map workflow installs dependencies, starts services and sets env vars exactly like the real test job, and fix it if not. Check that the edited test jobs still run the same tests as before. If init proposed an ignore list in .turnstile/select.yml, remove any folder a test reads files from.
    6. Leave mode: shadow in .turnstile/select.yml. Change nothing else in CI. Create a branch, commit, push and open a pull request titled "Set up Turnstile Select" that explains each change in plain language, and put the install link from step 1 at the top of its description.
    7. Finally, tell me: install the app with the link from step 1 if I haven't yet, then merge the pull request. Select starts in shadow mode, so nothing is skipped until we set mode: on. Until Turnstile switches Select on for this repository, the test jobs say "not enabled for this repository" and run every test, which is expected.

    Or set it up yourself

    One command writes a workflow that builds your test map and a settings file, and sets up the test jobs it finds.

    pip install turnstile-select
    tu-select init

    That's all for pytest. It edits each pytest job in your workflows to turn Select on, and copies your test job's setup into the map workflow. Check the changes with git diff.

    npx -y -p @withturnstile/select tu-select-js init --suite web

    That's all for Jest and Vitest, with npm, pnpm, yarn or bun. It edits each test job in your workflows to turn Select on, without touching your package.json or lockfile. Check the changes with git diff.

  3. Merge the setup pull request

    Commit the new files and the job changes in one pull request and merge it. The map workflow runs on the next push to your default branch (or start it now from the Actions tab), and every run after that keeps the map fresh.

  4. Watch shadow mode shadow

    Every test still runs. Each pull request gets a Turnstile Select check showing the test files it would have skipped, and any skipped test that failed is recorded as a miss.

    Turnstile switches Select on for your repository once you've signed up. Until then, your test jobs say not enabled for this repository and run every test, which is expected.

  5. Turn it on on

    When the check has looked right for a couple of weeks, set mode: on in .turnstile/select.yml. From then on, pull requests run only the test files they can affect. Add the label turnstile: run all tests to any PR to run everything.