Test files
A test file declares one test: which pool runs it, when it starts, and the jobs with their steps. Reoclo reads each file from your repository and runs it on test servers.
Where the file lives
Section titled “Where the file lives”Put one file per test in ci/reoclo/tests/:
ci/reoclo/tests/<name>.ymlThe file name is the test’s name. A name starts with a lowercase letter or digit and uses lowercase letters, digits and dashes, up to 63 characters. Reoclo reads the file at the commit under test.
A test file is separate from the application files in ci/reoclo/. A test often covers a whole system, has its own triggers and can run for hours, so it never holds an application’s deploy.
Never put a secret value in a test file. Anyone with read access to your repository can read it. Set secrets as variables on the test pool instead.
Example
Section titled “Example”version: 1pool: loadteston: push: branches: [main, "release/*"] pull_request: branches: [main] manual: truecancel_superseded: trueenv: LOG_LEVEL: infojobs: smoke: image: node:22 paths: ["src/**", "package.json", "package-lock.json"] steps: - run: npm ci - name: Unit tests run: npm test -- --runInBand load: needs: [smoke] image: grafana/k6:latest timeout_minutes: 720 env: BASE_URL: https://staging.example.com steps: - name: Run the load test run: k6 run load/checkout.js| Key | Type | Default | Notes |
|---|---|---|---|
version | 1 | 1 | The file format version. |
pool | string | required | The slug of the test pool that runs the jobs. A job can override it with jobs.<id>.pool. |
on.push.branches | list of branch names or globs | not set | A push to a matching branch starts a run. Globs use *, as in release/*. |
on.pull_request.branches | list of branch names or globs | not set | A pull request whose target branch matches starts a run when it is opened, gets new commits or is reopened. See Pull requests. |
on.manual | boolean or mapping | true | Allows runs started from the dashboard, the CLI and the API. A mapping with inputs also declares the values a manual run takes. See Manual run inputs. |
on.manual.inputs.<name>.description | string, up to 300 characters | empty | Help text shown next to the field when you start a run. |
on.manual.inputs.<name>.required | boolean | false | A manual run must give the input a value, unless it has a default. |
on.manual.inputs.<name>.default | string, up to 2,048 characters | not set | The value a run uses when none is given. Push and pull request runs always use it. |
on.manual.inputs.<name>.secret | boolean | false | Hides the value everywhere and masks it in job output. |
cancel_superseded | boolean | true | A newer run of the same test on the same branch or pull request cancels the older unfinished runs. See Cancelling superseded runs. |
paths | list of globs | empty | Jobs without their own paths run only when a changed file matches. See Path filters. |
env | map of strings | empty | Plain values for every job. Secrets come from the pool’s variables. |
checkout.submodules | boolean | false | Runs git submodule update --init --recursive after the checkout, for every job. See Submodules. |
jobs.<id>.image | image reference | required | The container image the steps run in. The repository is mounted at the working directory. It can be a private image when the pool has a registry credential for its registry. See Private images. |
jobs.<id>.pool | string | the file’s pool | Runs this job on a different pool. |
jobs.<id>.needs | list of job IDs | empty | Jobs that must pass before this one starts. Reoclo rejects a cycle. |
jobs.<id>.paths | list of globs | the file’s paths | This job runs only when a changed file matches. Replaces the file’s paths for this job. |
jobs.<id>.steps | list | required | The commands to run, in order. |
jobs.<id>.steps[].run | shell command | required | Runs with sh -e, so a failing command stops the step. |
jobs.<id>.steps[].name | string | the command | The label shown on the run page. |
jobs.<id>.steps[].when | always, success or failure | success | Whether the step runs after an earlier step failed. See Steps after a failure. |
jobs.<id>.timeout_minutes | integer, 1 to 7,200 | 60 | The pool’s job time limit caps this value. |
jobs.<id>.env | map of strings | empty | Merged over the file’s env for this job. |
jobs.<id>.docker | boolean | false | Gives the job the Docker of its machine. See Docker in a job. |
jobs.<id>.cache.key | string, 1 to 200 characters | required with cache | Names the cache. See Cache. |
jobs.<id>.cache.key_files | list of paths, up to 10 | empty | Repository files, such as lockfiles, whose content is part of the cache’s identity. |
jobs.<id>.cache.paths | list of paths, 1 to 20 | required with cache | Files and folders in the checkout to restore before the first step and save after the last. |
jobs.<id>.artifacts.paths | list of paths, 1 to 20 | required with artifacts | Files and folders in the checkout to upload after the steps. See Artifacts. |
jobs.<id>.artifacts.when | always, success or failure | always | Which results upload the artifacts. |
Triggers
Section titled “Triggers”on.push.branches decides which pushes start a run. Reoclo reads this key from the copy of the file on your repository’s default branch. A pushed branch cannot add itself to the list by editing its own copy of the file.
on.pull_request.branches decides which pull requests start a run. It lists target branches, the branch a pull request merges into. A pull request opened, updated with new commits or reopened against a matching branch starts a run at the pull request’s head commit. See Pull requests for the rules.
on.manual controls runs started from the dashboard, the CLI and the API. A manual run uses the head of the branch you enter. To pass a value to a manual run, such as a link to the system under test, declare it as an input. See Manual run inputs.
Tests run only when an organization admin has enabled tests for the repository. See Enable tests on a repository.
Pull requests
Section titled “Pull requests”pool: cion: pull_request: branches: [main, "release/*"]jobs: unit: image: node:22 steps: - run: npm ci - run: npm testA run for a pull request follows these rules:
- Tests must be enabled for the repository.
- The default branch decides whether a test runs on pull requests and for which target branches. Adding
on.pull_requestin a pull request’s own copy of the file does nothing until that change is on the default branch. - The steps come from the pull request’s head commit, so a pull request can change what its own run does.
- A pull request from a fork never starts a run. Only pull requests whose head branch is in the same repository run.
- Reoclo posts the
reoclo/test/<name>status on the head commit of the pull request. - If the branch also matches
on.push.branches, a push to it starts a separate run for the push.
Pull request triggers work with GitHub repositories. Gitea repositories run tests on push and by hand.
Cancelling superseded runs
Section titled “Cancelling superseded runs”When a new run starts, Reoclo cancels the older runs of the same test that have not finished:
- A new push run cancels older unfinished runs for the same branch.
- A new pull request run cancels older unfinished runs for the same pull request.
The cancelled run shows the reason Superseded by run #N, stops its jobs, deletes its machines and updates its commit status. Runs you start by hand are never cancelled this way, and they do not cancel other runs.
To keep every run, set cancel_superseded: false in the test file. Reoclo reads the setting from the file at the commit of the newer run.
Closing a pull request
Section titled “Closing a pull request”When a pull request is merged or closed, Reoclo cancels the unfinished runs that the pull request started. The cancelled run shows the reason Pull request #N was merged or Pull request #N was closed, stops its jobs, deletes its machines and updates its commit status. This applies even when cancel_superseded is false. Push runs and runs you start by hand are not affected, and neither are runs that already finished.
Path filters
Section titled “Path filters”pool: cion: pull_request: branches: [main]paths: ["src/**", "package.json"]jobs: unit: image: node:22 steps: - run: npm test docs: image: node:22 paths: ["docs/**", "*.md"] steps: - run: npm run docs:checkA paths list holds globs relative to the repository root. * matches within one directory, ** matches across directories and ? matches one character. A glob cannot start with / or contain ... A list holds up to 50 globs of up to 200 characters.
- A job’s own
pathsreplace the file’spathsfor that job. A job with no paths of its own uses the file’s. A job with no paths at all always runs. - A job whose paths match none of the changed files is skipped. Its card on the run page says that no changed file matches its paths.
- A job that needs a skipped job is skipped too.
- A run passes when no job failed, so a run where every job was skipped passes.
The changed files come from your git provider: for a push, the files between the branch’s previous head and the new head, and for a pull request, the files the pull request changes. If Reoclo cannot get the list, every job runs. That happens when the provider does not answer, when a branch is new, and when the list may be cut short (300 or more files in a push, 1,000 or more in a pull request). Manual runs ignore path filters and run every job.
Manual run inputs
Section titled “Manual run inputs”Inputs let a manual run take values you choose each time, such as a link to the system under test:
version: 1pool: loadteston: manual: inputs: room_link: description: Link to the room to load required: true users: description: Number of simulated users default: 200 api_token: description: Token for the room API secret: truejobs: load: image: grafana/k6:latest steps: - run: k6 run --vus "$INPUT_USERS" -e ROOM_LINK="$INPUT_ROOM_LINK" load/room.jsSteps read each input as an environment variable named INPUT_ followed by the input’s name in upper case, so room_link is INPUT_ROOM_LINK. An input wins over a file env key or a pool variable with the same name.
- An input name starts with a lowercase letter and uses lowercase letters, digits and underscores, up to 40 characters. A file declares up to 20 inputs, and a value is up to 2,048 characters. Values are text, so
default: 200becomes the string200. - When you start a manual run, Reoclo checks the values against the file at the commit being tested. A name the file does not declare, or a required input with no value and no default, is refused and the message names each one. A required input cannot be empty. An optional input with no value and no default is an empty string.
- Push and pull request runs have nobody to type a value, so they use each input’s
default. A file that also runs on push or pull requests is invalid when a required input has no default. Give the input a default or removerequired. - You can supply values in the dashboard, where the Run dialog shows one field for each input of the file at the branch you enter, with
reoclo tests run --input, and through the API. - A re-run of a manual run uses the same input values as the run it repeats.
Secret inputs are for values you would not paste into a ticket. Reoclo stores a secret value encrypted, never shows it on the run page or returns it from the API, and masks it in job output (values of 4 or more characters). The run page lists the secret inputs by name only. A non-secret input is shown with its value on the run page.
A default is part of the test file, so anyone who can read your repository can read it, even for a secret input. Use a default only for a harmless fallback. Never put a real secret in one.
Docker in a job
Section titled “Docker in a job”By default a job’s container has no access to Docker. Set docker: true on a job to let its steps start containers, build images, run docker compose and use Testcontainers:
jobs: integration: image: node:22 docker: true steps: - run: npm run test:integrationWith docker: true, Reoclo mounts the Docker socket of the job’s machine into the job’s container and sets these variables there:
| Variable | Value |
|---|---|
DOCKER_HOST | The mounted socket. |
TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE | The same socket path, so the helper container Testcontainers starts to clean up after a run mounts the real socket. |
TESTCONTAINERS_HOST_OVERRIDE | 127.0.0.1. The job shares the machine’s network, so a service you start, such as a database on a published port, is reached on 127.0.0.1. |
When the pool has registry credentials, Reoclo also sets DOCKER_CONFIG to a read-only folder that holds those logins.
Reoclo sets these after your own variables, so a variable with the same name in the file or on the pool does not replace them.
Reach published ports at 127.0.0.1, not localhost. Docker on test machines publishes ports on IPv4 only, and inside a job localhost resolves to the IPv6 address ::1 first, so a client that tries only the first address, such as wget in Alpine images, is refused.
Things to know:
- The job controls that machine’s Docker. It can start and stop every container on the machine, pull any image and mount the machine’s files into containers it starts. This is acceptable because each job runs on a machine created for it in your cloud account and deleted when the job ends, but only turn it on for code you trust. Containers and images the job leaves behind go away with the machine.
- Bind mounts from the checkout work. Docker resolves the source of a bind mount on the machine, not inside your job’s container, so Reoclo mounts the checkout at its real path on the machine as well and runs your steps from there. Use relative paths or
$PWD, such as./init.sql:/docker-entrypoint-initdb.d/init.sqlin a compose file ordocker run -v "$PWD/conf:/conf". Do not use/workspaceas a bind mount source: that path exists only inside the job’s container, so the daemon cannot find it and the service gets an empty directory. - Testcontainers talks to the socket directly, so the image does not need a Docker client. A step that runs
dockerordocker composedoes: use an image that has them, such asdocker:cli. - A
docker: truejob can pull private images for the containers it starts. See Private images. - Reoclo never runs a
docker: truejob without Docker. If the machine has no Docker socket the job errors before it starts, with a message that says so. A machine whose runner is older than 1.48.0 does not support the key and the job errors with a message that names the version. dockermust betrueorfalse. A job without it does not get Docker.
Private images
Section titled “Private images”The image of a job can be in a private registry. Credentials are not set in the test file, because anyone who can read the repository can read it. They are set on the test pool: pick the registry credentials the pool should use, and every job in the pool logs in to those registries before it pulls its image. See Private images for what a pool accepts and how the logins are handled.
jobs: integration: image: ghcr.io/acme/test-runner:1 docker: true steps: - run: docker compose -f compose.e2e.yml up -dIf the pool has a credential for ghcr.io, this job pulls its own image with it. Because the job sets docker: true, docker compose can pull private images from ghcr.io as well: Reoclo mounts the logins read-only in the container and points DOCKER_CONFIG at them. A job without docker: true uses the logins only for its own image pull.
A job that uses registry credentials needs a machine with runner 1.49.0 or later. A job on an older runner errors before it starts, with a message that names the version.
Submodules
Section titled “Submodules”Set checkout.submodules to true when the repository has git submodules:
version: 1pool: cicheckout: submodules: truejobs: build: image: node:22 steps: - run: npm ciAfter the checkout, Reoclo runs git submodule update --init --recursive on each job’s machine with the same short-lived token it used to clone the repository. The token can read only the repositories your git provider connection can access, so give the connection access to every submodule’s repository.
Only submodules on the same host as your repository, over https, are supported. Use either a full https:// URL on that host or a relative path such as ../shared-lib.git. A submodule that uses SSH ([email protected]:acme/lib.git), plain http, or another host fails the job before any step runs, and the error names the submodule. Change its URL in .gitmodules to fix it.
Every job starts on a fresh machine, so by default it starts with no cache. Give a job a cache to keep files such as installed dependencies between runs:
pool: cijobs: unit: image: node:22 cache: key: pnpm key_files: [pnpm-lock.yaml] paths: [.pnpm-store] steps: - run: pnpm install --frozen-lockfile --store-dir .pnpm-store - run: pnpm testA cache lives in the storage bucket of the job’s pool, in your own cloud account. The pool needs a bucket before a job can use a cache: see Storage bucket. A run whose job asks for a cache on a pool without a bucket errors with a message that says so, and no job starts.
How a cache is found and kept:
- Identity. A cache belongs to one test and one job. Its identity also holds the
keystring and the content of every file inkey_filesat the commit under test. Change the key string, or change a lockfile, and the job looks for a different cache. - Restore. Before the first step, Reoclo restores the exact cache: the one with the same test, job, key string and key file contents. If there is none, it restores the most recent cache for the same test, job and key string. A changed lockfile then starts from a mostly warm cache instead of an empty one.
- Save. After the last step, Reoclo saves the cache only when the exact cache did not exist and every step passed. A failed run never saves, and a run that restored its exact cache does not save it again.
- Shared across branches. The same test and job on any branch or pull request uses the same caches. Do not cache secrets or files that differ between branches.
- Retention. A sweep deletes caches older than the pool’s cache retention, 7 days by default.
key_files and paths are plain paths relative to the checkout root, such as pnpm-lock.yaml or node_modules. A leading ./ and a trailing / are ignored. A path cannot be absolute, contain .. or point into .git, and there are no wildcards. A path that does not exist after the steps is skipped. Only files below your paths are ever restored.
Because paths must be inside the checkout, point your package manager’s store into the checkout and add that folder to .gitignore:
| Tool | How |
|---|---|
| pnpm | pnpm install --store-dir .pnpm-store, or pnpm config set store-dir .pnpm-store |
| npm | npm ci --cache .npm-cache |
| Yarn | yarn config set cacheFolder .yarn-cache |
| pip | PIP_CACHE_DIR=.pip-cache |
| Cargo | CARGO_HOME=$PWD/.cargo-home |
| Go | GOMODCACHE=$PWD/.gomodcache and GOCACHE=$PWD/.gocache |
The job log shows each step as a setup line, with sizes and times, for example [setup] cache: restored 412 MB from the exact key in 6.2s. A cache that cannot be restored is a warning and the job runs without it. A cache that cannot be saved is also a warning, and it never fails the job. A cache archive above 2 GiB is not saved, and the log says so.
Artifacts
Section titled “Artifacts”A job cannot keep files after it ends, so give it artifacts to upload the ones you need, such as a test report:
pool: cijobs: e2e: image: mcr.microsoft.com/playwright:v1.49.0-noble artifacts: paths: [playwright-report, test-results] when: always steps: - run: npm ci - run: npx playwright testAfter the steps, Reoclo packs the paths that exist into one .tar.gz archive per job and uploads it to the pool’s storage bucket. Paths follow the same rules as cache paths. If none of them exist, nothing is uploaded and the log says so.
when: alwaysuploads whether the job passed or failed.successuploads only when every step passed.failureuploads only when a step failed.- A job that was cancelled or timed out uploads nothing.
- The run page lists each job’s artifact with its size and a download link. The link is generated when you click it and works for a minute. Anyone who can view the run can download its artifacts.
- A sweep deletes artifacts older than the pool’s artifact retention, 30 days by default.
- An archive above 1 GiB is not uploaded, and the log says so. A failed upload is a warning and never fails the job.
- Like a cache, artifacts need a pool with a bucket.
Jobs with a cache or artifacts need a test machine whose runner is version 1.50.0 or later. If it is older, the job errors with a message that names the version, and nothing is sent to the machine.
Steps after a failure
Section titled “Steps after a failure”A step runs only while every earlier step has passed. Give a step when to run it after a failure too. This job stops its containers even when the integration tests fail:
pool: cijobs: integration: image: node:22 docker: true steps: - run: docker compose up -d - run: npm run test:integration - name: Stop containers run: docker compose down when: alwayswhen: always runs the step whether or not an earlier step failed. when: failure runs it only after a step failed. The default, success, runs it only while every earlier step passed.
- The job reports the first step that failed, with its exit code. A later step that fails does not replace it. When every other step passed and an
alwaysstep fails, the job fails because of that step. - A step that does not run is shown as skipped.
- A cancelled job or one that reaches its timeout stops at once.
whenapplies only after a step fails. ifis not supported. A step that sets it makes the file invalid and the message points you towhen.
A job with a when: always or when: failure step needs a test machine whose runner is version 1.56.0 or later. If it is older, the job errors with a message that names the version, and nothing is sent to the machine.
Limits
Section titled “Limits”| Limit | Value |
|---|---|
| Jobs per file | 20 |
| Steps per job | 50 |
| File size | 64 KB |
timeout_minutes | 1 to 7,200 |
Globs per paths list | 50, each up to 200 characters |
| Inputs per file | 20 |
| Input name | up to 40 characters |
| Input value or default | up to 2,048 characters |
Paths per cache.paths or artifacts.paths | 20 |
Files in cache.key_files | 10 |
| Cache archive | 2 GiB |
| Artifact archive | 1 GiB |
A file is invalid when it is over a limit, has a cycle in needs, names an unknown pool, sets docker or checkout.submodules to anything but true or false, or uses matrix or target, which are not available yet. Reoclo shows the reason next to the file on the Tests page. A push that reaches an invalid file creates an Errored run with the same reason.
How jobs behave
Section titled “How jobs behave”- A job with no
needsstarts as soon as its pool has a machine. Jobs that do not depend on each other run in parallel. - A step runs in the job’s container. The step’s working directory is the repository root.
- A job stops at its first failing step. The later steps are reported as skipped, except steps with
whenset toalwaysorfailure, which still run. - If a job fails or errors, the jobs that need it are skipped. A run passes only when no job failed, errored or was cancelled. Jobs skipped because of path filters do not count against it.
- A job that runs longer than its timeout is stopped and reported as errored.
Variables a job receives
Section titled “Variables a job receives”A job receives:
- The test file’s
env, merged with the job’s ownenv. - The variables set on the test pool.
- The run’s inputs, each as
INPUT_<NAME>. - The variables Reoclo sets for every run:
REOCLO_RUN_ID,REOCLO_COMMIT,REOCLO_REFandREOCLO_JOB. - For a pull request run only:
REOCLO_BASE_REF, the branch the pull request merges into, andREOCLO_BASE_SHA, the commit that branch pointed at when the run started. Runs started by a push or by hand do not get them.
The job runs without git credentials, so git fetch against your repository fails inside it. For a pull request run, the checkout already holds the base commit and the history behind it, so git diff --name-only "$REOCLO_BASE_SHA"...HEAD lists the files the pull request changes and git merge-base "$REOCLO_BASE_SHA" HEAD finds the common ancestor. See Run only the specs a pull request changes. If Reoclo cannot fetch the base commit, the job log shows a warning on its first lines and the job still runs.
Give a variable a different name in each place, so it is clear which value a job sees. If a pool variable and the file’s env use the same name, the pool variable wins, and an input wins over both. Secret values from the pool and secret inputs are masked in job output.