Skip to content
trawler
Use Trawler

Trawler in CI

A CI job can ask Trawler to test a change the way the app does: the people use the product in a real browser, a fresh agent replays every defect, and only a defect the replay confirms counts. The job starts the run, waits for it, comments the result on the pull request and fails when defects are confirmed. Nobody signs in; the job holds an API token.

Three pieces make it up:

  • An API token, created under API tokens & MCP in Settings, for the workspace or for one project.
  • The Run API, three HTTP calls: start a run, read its result, and stop a run.
  • trawler-ci, a command that makes the calls for you, waits, prints the result, comments on the pull request and sets the job’s exit code. See The trawler-ci command.

A run started from CI is an ordinary run of one of the project’s plans: the same people, cap, report and run page, and it shows in the project’s Runs. It also meets the same limits as a run started with Start run: the workspace’s daily runs, its monthly budget, one run at a time on a project, and a paused project. And like Start run it tests the workspace’s model key before the run is queued.

Hosted Own runner
Where the product runs Somewhere Trawler’s runners can reach: a public address, saved in the project In the CI job, on localhost, or anywhere the job can reach
Who carries out the run Trawler’s runners A runner that trawler-ci starts inside the job
trawler-ci option --runner hosted, the default --runner own
What the job needs Node.js 24 and a checkout of Trawler to run trawler-ci, and outbound access to Trawler The same, plus Chromium, and the product started before the run
Address under test The project’s address The project’s, or --url
Accounts from the job Not possible --accounts

Use a hosted run when the product is already deployed at a public address, such as a staging site. Use an own runner to test the pull request’s own build: start the product in the job, and nothing is published. See An app started in the job.

  1. A project with a plan, set up in the app. The plan holds the people the runs use; for a pull request Trawler makes a plan of its own from them, with goals for the change, see Plans for pull requests. A product that only the job can reach, such as an app on localhost, is set up from a description you write: see A product on a private network.
  2. A first run of that project, started from the app’s start page. There you confirm that you are authorised to test the product, which a token cannot do; until the project has a run, the Run API refuses to start one with Start the first run of this project from the app, where you confirm you are authorised to test it. Runs started with a token are available after that. A product on a private network has no Start panel; on its start page, headed Run from CI, tick the box and choose Allow runs from CI instead, see A product on a private network.
  3. A model key for the workspace, or the workspace’s first run on Trawler, unused. A run started by a token pays the way Start run does.
  4. An API token, and the project’s id, the UUID in its address: app.usetrawler.com/projects/<id>. GitHub Actions shows where they go.

A person of the plan who has to sign in needs a test account on the plan, or one handed over by the job with --accounts; otherwise the run is refused.

  • The run page, app.usetrawler.com/runs/0017, with the full report.
  • On GitHub, one comment on the pull request, updated by every run, and the same Markdown in the job summary.
  • The command’s exit code: 1 when the run confirmed a defect, so the check fails; 0 otherwise. See Exit codes.

A run that ran out of its cap is not reported as clean: its comment says so, and the command prints that it is not a clean result, but it does not fail the job. Nor is a run that reached fewer than half of its goals: its comment reads Trawler could check only part of this change and lists what was not checked. When nothing in a change can be tested through the product’s UI, no run starts, and the comment says so. See The pull request comment.

A new push to a pull request stops that pull request’s earlier run, so only the latest commit is tested. Runs for different pull requests on an own runner go at the same time, up to 5 in a workspace. See Newer pushes and other pull requests.

The command stops its run when it gives up waiting, when the job is interrupted, and when it leaves for any other reason before the run ended; and Trawler stops an own-runner run that no runner picks up within 20 minutes. A job that is killed outright cannot stop its run, so Trawler stops it after 3 minutes without a question about it. See If the job ends early.

trawler-ci is not published as an npm package or a container image: every example checks Trawler out in the job and runs the command from the checkout. Only GitHub Actions has an adapter, so there is no wrapper for CircleCI, Jenkins or GitLab. In any other CI system the command still works from its environment variables, but it reads nothing about the pull request, so no plan is made for it, and it posts no comment: it prints the comment’s Markdown and sets the exit code.