Review tests
Run the repository's tests and the reviewer's new tests on the base and the head of every merge request, on your own test runner.
With review tests on, each merge request review round also runs tests. The reviewer writes Go tests for the change, and your own test runner runs them, together with the repository's own tests in the changed packages, on the base commit and on the change's head, each in a throwaway environment. The review's Tests tab shows the result of every test on both sides, and a test that passes on the base and fails on the head becomes a Will break finding. Nothing runs on the portal, and nothing is pushed to your repository.
Before you start
- The repository is watched for merge requests. See Set up reviews. Branch reviews run no tests.
- Your organisation has a runner in tests mode, online. See Runners in tests mode. Without one, no tests run and the tab says how to add one.
- The repository is a Go module. This version runs Go tests only, with no services such as databases.
- The portal has a secret key set (
ENTROPIX_SECRET_KEY): the job a runner receives is sealed with it.
Set up tests for a repository
- Open Settings › Integrations, find the repository's card and choose Set up tests (it reads Tests: on once tests are approved). Reviews › Setup has a Tests step that leads to the same place.
- Choose Draft from the repository. Entropix reads the CI and language files at the default branch (at most 64 KiB of them) and writes a draft in Settings (YAML). While it works, the page says "Drafting from the repository… this page refreshes every 5 s." When no model is set up, or its answer cannot be used, the draft is the Go defaults, with a note that says so.
- Read the draft and change it if you need to. Save draft keeps it without using it. Problems are listed under Before these can be approved:, one line per field.
- Choose Approve. The page says "Approved: the next review round runs these tests on a test runner."
Only approved settings are used. Until then the status reads "Not set up: reviews of this repository run no tests" or "Draft ready: not approved yet, so reviews run no tests". Turn off, under Approved settings, stops tests for the repository and keeps the draft.
The settings
image: golang:1.26
install: go mod download
test: go test -json -count=1 {packages}
report: go-json
env:
APP_ENV: test
limits: { install: 10m, test: 15m, cpu: 4, memory: 8g }
| Field | What it is |
|---|---|
image | Required. The image every stage runs in, by name, such as golang:1.26. Images are never built, and the runner allows only the images on its own list. |
install | Optional. The command that downloads dependencies, such as go mod download. The only stage with any network. |
setup | Optional. A command run after install, before the tests. |
test | Required. The test command. {packages} is replaced by the packages Entropix picks (below); with no {packages} they are added at the end. |
report | Required: go-json. |
env | At most 50 variables, upper-case names, plain values of at most 1 KiB. Everyone in the organisation sees them: never put a secret here. |
dir | Optional. A working directory relative to the repository, for a module that is not at the root. |
limits | Optional. Lower the stage limits, CPUs or memory (below). You cannot raise them. |
Commands are one line of plain text, at most 4 KiB. The settings are a plain subset of YAML: mappings, { key: value }, lists of plain values and # comments. Anchors, tags, several documents and multi-line text are refused with the line they are on. services and report: junit are refused with "arrive in a later version".
Settings in the repository
A repository may hold the same settings in .entropix/tests.yml. When that file is at the change's head and the change is from a team member, it wins over the portal's settings, but it cannot raise their limits. A change from outside the team always runs the portal's settings. The Tests tab says which were used: "settings from the repository" or "settings from the portal".
What runs in a round
When a merge request round finishes, and the repository has approved settings and your organisation has a test runner, the round plans one test run. The review itself does not wait for it: the review page, the review comment and the status on the Git host come first, and test results arrive later.
- The repository's own tests. Entropix picks the packages that hold changed
.gofiles, with no model, and runs their tests on each side. They are listed with idsE-1,E-2, …. - The reviewer's tests. While it reviews, the reviewer writes Go tests with the
write_teststool. Each one is a new_test.gofile of at most 200 lines, in a package directory that holds a changed file or a test, with an idT-1,T-2, … and a source: a PRD criterion (AC-n), one of the nine angles, one of its findings (F-n), or the code. They run after the repository's own tests, in their packages only.
| Round | Tests the reviewer may write |
|---|---|
| A deep round | Up to 20 |
| A light round | Up to 5, for criteria and findings only |
| A requirement round | Up to 5, for its new criteria only |
| Round 2 and later | The earlier rounds' tests run again and count first, up to 20 in all |
| A review long enough to be read in parts | Written once, in a short pass after the parts are merged |
Review specialists never write tests, but their findings can be a test's source. The reviewer is offered write_tests only when the round's tests can actually run.
Each side runs in its own environment, in this order: Fetch, Install, Setup, Your tests (baseline), Test (the reviewer's tests), Clean up. A runner with two or more free slots runs the base and the head side by side.
Verdicts
| On the base | On the head | Verdict | Becomes a finding |
|---|---|---|---|
| Passes | Passes | Holds | No |
| Passes | Fails | Breaks on this change | Yes, Will break |
| Fails | Passes | Fixed by this change | No |
| Fails | Fails | Fails on both | No |
| A reviewer's test that does not build on the base | Any | Did not run on base | No |
| Missing, an error, a time-out or a skip on either side | Did not run, with the reason | No | |
If the repository's own tests fail on the base commit, the setup is not trusted: the run reads "Done" with "The repository's own tests failed on the base commit, so no regression was filed from this run.", and no test from it proves anything.
- Findings from tests are advisory. They never change the
entropix/reviewstatus and never block Approve. You decide them like any other finding. At most 10 are filed per run; the rest show on the tab only. - A test finding is filed into the round while it is still open and undecided. It reads "Test T-n passes on the base commit and fails on the change's head.", with the last 20 lines of its head output under it on the review page and a link to the test on the Tests tab. The output is never posted to the Git host or a channel.
- When a test written for a PRD criterion holds, the behaviour that proves that criterion reads Proven by test T-n in the review's evidence, with a link to the test.
- Results that arrive after the round was sent back, approved or replaced show on the Tests tab only.
The Tests tab
A finished review has a Tests tab beside Review and Data flow. Its head shows:
- The run's state: Waiting to start, Queued, Running on base or Running on head with the stage, Done, Failed, Timed out, Cancelled, Skipped, Waiting for a person or Not planned, each with its reason. With nothing to run it reads Not set up (with a link to the settings), No test runner (with a link to Settings › Runners) or No tests ran.
- The runner that ran it (on runner name), each side's duration, whose change it was (a team member's or an outside author's) and where the settings came from.
- A count per verdict, Open the run log, and the actions (below).
While a run is queued or running, the tab refreshes every 10 seconds. The tab heads with the newest run's state, but shows the tests of the newest run that has any: when a Run again failed before it was planned, the head reads, for example, "Run again failed" and a line says "These tests are from an earlier run of this round (done)."
Chips filter the list by verdict and by source; they add ?verdict= and ?source= to the address. Each test is one row you open: its title, source, verdict and each side's result and duration; then what it checks, the test's code (for a reviewer's test), the command and output of each side, a link to its finding if one was filed, and See it in the log. Each test's output keeps at most 16 KiB, from its start and its end. Output and code are data from the test run, shown as plain text.
Run again, Run and Download tests
| Action | When you see it | What it does | Who |
|---|---|---|---|
| Run again | The round is the change's current one, its run has ended, and Run again was not used yet | Runs the round's tests once more on a test runner. Once per round; it does not use the review's own re-run. | Member |
| Run | A run is Waiting for a person: an outside author's change needs private packages to install | Runs it again with the runner's registry logins for the install step only. The portal's settings are still used and the dependency cache stays read-only. | Member |
| Download tests | The reviewer wrote tests | Downloads the reviewer's tests as one patch file (review-<id>-tests.patch). Nothing is pushed to the repository. | Everyone |
The run log
Open the run log (or See it in the log on a test) opens the log of the round's latest run that a runner took, one side at a time, with a Base / Head switch. It shows:
- One line per stage with its status, command, exit code and duration. A failed stage opens by itself on its last lines. Whole log shows the rest, and Download saves that stage's log.
- Download this side's whole log, every stage in one text file.
- Environment: the image and its digest, the settings' source, each stage's network, whether the dependency cache was hit and whether it was read-only, the limits, peak CPU and memory (Docker only), the back end and whether gVisor or rootless Docker isolated it.
- Environment variables, with values that look like secrets masked.
While a side runs, the stage list updates every 3 seconds, with or without JavaScript. Each stage keeps at most 1 MiB of log, its first and last half; a cut log says so.
Changes from outside the team
A change counts as a team member's when it is not from a fork and its author has standing in the repository. Every other change is an outside author's:
- It runs the portal's settings only, never
.entropix/tests.yml. - Its install gets no registry logins, and it never writes the shared dependency cache.
- If its
go.modneeds a module that matches the runner's private patterns, it stops before install and waits for a person's Run.
Limits
| Limit | Default |
|---|---|
| Install | 10 minutes |
| Setup | 5 minutes |
| Test (each of the two test stages) | 15 minutes |
| CPU and memory per environment | 4 CPUs, 8 GiB |
| Whole run | Twice the sum of the stage limits, plus 5 minutes (69 minutes with the defaults) |
| Waiting for a free test runner | 30 minutes, then "skipped: no test runner free within 30 minutes" |
| Test runs per organisation per day (UTC) | 50, set by the operator |
- A new push to the merge request, or a new round on the same head, cancels the run in progress, and the runner stops it.
- A run whose runner stops answering, or that passes its whole-run limit, ends Timed out. If no stage had finished, it is retried once by itself; a retry of a run a person started with Run keeps that approval.
- A run that cannot be planned reads Not planned with why: the daily limit is reached, the portal has no secret key, or a test runner cannot read the repository.
For operators
| Setting | What it does | Default |
|---|---|---|
ENTROPIX_TESTS_DAILY_RUNS | Test runs each organisation may start per day (UTC). 0 is no limit. One number for every organisation. | 50 |
What you can and can't do
- Run the repository's own tests and the reviewer's tests on every merge request round, on your own machines or cluster.
- Draft the settings from your CI files, then edit and approve them.
- Keep settings in the repository for team changes.
- See each test on both sides, every stage's log and the environment it ran in.
- Download the reviewer's tests as a patch and keep the ones you want.
- Run tests on the portal: a test runner is required.
- Run Python, Node or Java tests, or start services such as databases, in this version.
- Block Approve on a test, or let tests change the
entropix/reviewstatus. - Run tests for branch reviews.
- Raise a limit above its default, or build an image.
- Put secrets in the settings. Registry logins live on the runner.
Troubleshooting
- No test runner · "Add a runner in tests mode on Settings › Runners."
- Your organisation has no runner in tests mode. See Runners in tests mode.
- "skipped: no test runner free within 30 minutes — add a test runner or more test slots on Settings › Runners"
- Every test runner was busy or offline for 30 minutes. Add one, or give yours more test slots.
- "the test runner stopped answering"
- The runner stopped polling mid-run. Check it on Settings › Runners; the run is retried once if no stage had finished.
- "not planned: the organisation's daily limit of 50 test runs is reached (ENTROPIX_TESTS_DAILY_RUNS)"
- The daily limit counts runs started today (UTC). It resets at midnight UTC, or the operator raises it.
- "not planned: this repository cannot be read by a test runner"
- The review has no change reference a runner can fetch, or the repository's Git access cannot be handed to a runner.
- Done, with "The repository's own tests failed on the base commit, so no regression was filed from this run."
- The tests already fail before the change. Open the run log for the base side to see why, and fix the settings or the tests.