Tuner has a GitHub Action. Every other CI tool runs the Tuner CLI directly and passes or fails the build on its exit code. These tools get no pull request comment and no job summary. Before you start, you need:
- A Linux or macOS runner with Node.js 22 or later.
- A Tuner API key, stored as a secret in your CI tool.
- The agent’s Agent Remote ID.
- Inbound or outbound simulation set up for the agent.
- Scenarios with a shared tag, such as
smoke, in the Scenario Library.
Deploy first, then test
Deploy the change to a staging agent first, then run Tuner after the deploy job, because a simulation calls your agent as it is deployed at that moment. See Deploy first, then test.Exit codes
Any non-zero exit code fails the build. See Exit codes for what each code means. Exit3 means Tuner couldn’t finish the run. The GitHub Action passes the build on 3 with a warning, and you can do the same by accepting it in your command:
|| [ $? -eq 3 ] to fail the build on 3 as well.
Send the commit and branch
Pass--meta so each run shows which change it tested. See Add run metadata and See which commit a run tested.
Use the variables your CI tool sets:
A tool doesn’t set every variable in every pipeline. The examples add a
--meta pair only when its variable has a value, with ${VARIABLE:+...}.
Examples
Each example deploys first and then runs the simulations. It passes the build on exit3 and sends run metadata.
Replace the deploy step and the agent ID with your own, and keep the job’s timeout above --timeout. The examples run the CLI with npx. To pin a version, add @x.y.z to the package name.
- GitLab CI
- CircleCI
- Jenkins
- Shell script
Add the key in your project under Settings > CI/CD > Variables > Add variable. Name it The
TUNER_API_KEY and set Visibility to Masked.allow_failure block passes the pipeline when the CLI exits 3.Read the result
The job log shows each Scenario’s result, a summary line and a link to the run. See Read the results. To keep the result as a file, add--output json and save stdout. Store tuner-result.json as a job artifact in your CI tool. See Use the results in scripts.
Cancel and time out
Set--timeout below your job’s own timeout, as the examples do. When the timeout runs out, the CLI cancels the run and the agent is free for the next one.
When someone cancels a job, the CLI cancels the run only if the CI tool sends it a stop signal. GitLab, CircleCI and Jenkins don’t document a stop signal for a canceled job, so don’t rely on it. If a run is left behind, see Cancel a run.
Troubleshooting
No API key or No agent
No API key or No agent
The CLI found no
TUNER_API_KEY or TUNER_AGENT_ID. Check the secret’s name and that the job can read it. Some tools hide secrets from pipelines on unprotected branches or from forks.The agent already has a run in progress
The agent already has a run in progress
Another job is testing the same agent. Run one Tuner job at a time for each agent, or cancel the other run. See Cancel a run.
The step stops with no output
The step stops with no output
Your CI tool has a limit on a step that prints nothing. Raise it above
--timeout. In CircleCI, that is no_output_timeout.The commit isn't a link in Tuner
The commit isn't a link in Tuner
Tuner links the commit and branch only when
repo_url starts with https://. A Git URL that starts with git@ shows as plain text.Limits
Next steps
GitHub Actions
A pass/fail check, a pull request comment and a job summary on GitHub.
CLI
Every command, the exit codes and the JSON output.