Run only the tests a change touches

Add --affected to kamocore run, and a pull request runs only the suites its changed files touch - every suite, with the reason, when it cannot tell.

In short

A small change should not wait for every suite. With --affected, the CLI reads the changed files from git, asks {{brand}} which suites of the project they touch, and runs only those. No AI is involved: it follows the Designer's code readings and the links between services, endpoints and suites.

Before you start

Steps

  1. Open the project's "Run in CI" and find "Run only what a change touches".
  2. Press "Copy command" and put it in your pipeline in place of the usual run.
  3. In a pull request, add --base with the commit to compare with, such as the merge base.

Result: the CLI prints which suites it runs and why, runs them in turn, and writes one JUnit file per suite (results.xml, results-2.xml, ...). The exit code is the worst of them.

Good to know

If something goes wrong

Related