ADR-0153: A caller starts the services its tests reach
Status: Accepted Date: 2026-11-15 Grows: 0151: what a caller readies besides the dependencies
Context
Some suites reach a server while they run: a database, a cache, a queue. A
test that finds no server is skipped or fails in every job of the run that
started none, and a skipped test kills nothing: every mutant only it reaches
survives, and a unit it holds (tests.holding) is never judged by it.
The gate’s own suite is one such suite. A split stream that reconnects
(splitStream.reconnect, ADR-0147) copies a MySQL, MariaDB or PostgreSQL
database at each fork, and the tests of those copiers run against a real
server of each kind. The jobs of the reusable workflow started none, so they
were skipped in the plan and in every shard.
GitHub starts a job’s service containers beside it from
jobs.<job_id>.services, which a reusable workflow cannot take from its
caller as YAML. A caller can hand it a string, which the job reads back with
fromJSON.
Decision
services, an input of the reusable workflow, holds the service containers as a JSON object, in the shapejobs.<job_id>.servicestakes: each container by its id, with its image, its environment, its ports and its options.{}, the default, starts none.- Each job that runs the project’s tests starts them:
plan,shard,survivors,survivors-reportandverdict, asservices: ${{ fromJSON(inputs.services || '{}') }}. The jobs that hold a key or a token (fetch, the deliver jobs,publish) andjudge, which runs none of the project’s code, start none. - The addresses reach the tests through
prepareor the caller’s own job. A container’s published port is fixed by its mapping, so the caller knows the address its tests read.prepare(ADR-0151) runs in each job that starts the services, before the tests, and can write the variables to$GITHUB_ENV, which every later step of the job reads. - The gate’s own CI starts MySQL 8.4, MariaDB 11.4 and PostgreSQL 17,
each image pinned by digest, in
tests and coverageand throughservicesin both of its mutation callers..github/test-services.jsonholds them once;what changedhands them on as an output, and.github/scripts/servers.pywrites the variablestests/Support/Servers.phpreads.
Settings
| Input | Values | Default | Effect |
|---|---|---|---|
services | a JSON object, as jobs.<job_id>.services takes it | {} | the service containers each job that runs the project’s tests starts beside it |
Why no verdict moves
- Nothing starts unless the caller names it. The default starts no container, and every job runs as it did.
- It only adds what the tests reach. A test that ran before runs as it did; a test that was skipped for want of its server now runs and can kill.
Alternatives considered
| Alternative | Why not |
|---|---|
A step that runs docker run in prepare | Every caller writes its own wait for the server to be ready; services wait for each container’s health check before the first step. |
| One input per kind of server | The gate would name every server a project might use; the JSON object takes any. |
| Services in the action | A composite action cannot start containers; only a job can. |
An env input of the reusable workflow | prepare already runs in each of those jobs, before the tests, and writes what they read. |
Consequences
- A job that starts services runs on a Linux runner with Docker, as GitHub’s service containers need.
- Each container adds its start and health check to each job that starts it.