Start the affected tests after a deploy

Tell {{brand}} from your pipeline that an API was deployed, and it runs the suites the change touches.

In short

Right after your pipeline deploys an API, one command tells {{brand}}, and {{brand}} runs the suites the change touches in that environment. With --wait the command waits for them, so the pipeline step fails when a suite fails.

Before you start

Steps

  1. Install the CLI and put an access token (made in "Settings", under "Access tokens") in KAMOCORE_TOKEN, as for a run: /help/api-testing/run-in-a-pipeline#run. The token needs the scope ApiTester:write.
  2. After the deploy step, run: kamocore deploy --project <projectId> --environment <name> --deploy-id <id> --wait
  3. Give each deploy its own id for each stage, such as the build number with the stage's name. In Azure Pipelines that is $(Build.BuildId)-$(System.StageName).
  4. To check the API's contract as well, add --openapi with the file or the address of the new OpenAPI document. Add --fail-on-breaking to fail the step when the new version breaks the contract.

Result: the suites run on {{brand}}, and with --wait the command ends with their result.

Which suites run

Good to know

If something goes wrong

Related