metaphasor
Docs menu

Tests

Phasor runs a project's checks and records each result with the tree it ran on. The verification state of intent is computed from those recorded results. A passing result is evidence that a check passed on a given tree. It is not proof that the software is correct.

Check configuration

Tests are ordinary test files in the work folder, written in whatever the project uses. A check is a JSON file under .phasor/work/.checks/ that tells Phasor how to run them.

.phasor/work/.checks/unit.json
{"run": ["python", "-m", "unittest", "discover", "-s", "tests"], "inputs": ["snake/**", "tests/**"], "timeout": 60000}
FieldMeaning
runRequired. The command and its arguments, as a list. The program is found on PATH and started directly, without a shell.
inputsPath patterns that name the files the result depends on. A recorded pass is reused while those files are unchanged. Without inputs, every file counts.
timeoutA limit in milliseconds. The default is 600000, ten minutes.
envAdditional environment variables, as a list of [name, value] pairs. The values are literal text in the check file.

A check is bound to intent by a landing: the checks that land with a piece of work are bound to the intent that work covers.

Executing checks

phasor check --current
.checks/unit.json: pass
phasor check --current --json
{"appends":[{"id":"2dc423e99676","kind":"result"}],"ok":true,"results":{".checks/unit.json":"pass"},"tree":"16cbe27e6162"}

A run ends in one of three outcomes.

OutcomeMeaning
passThe command exited with status 0
failThe command exited with another status
errorThere was no exit status to judge: the command timed out, was killed, could not be started, or the check file is invalid

Execution environment

A check is not sandboxed. The command runs as your user account. It can read any file that account can read, your home folder and your Phasor home included. It can use the network, and it can write outside its folder. Treat a check file as code that you run, and read one that came from somewhere else before you run it.

Verification and intent state

A result is a signed record of one run: the check and its version, the tree it ran on, the outcome, and the output. It establishes that this check ended with this outcome on this tree. It does not establish that the tests are complete or correct, or that code the check does not exercise works.

Phasor counts a result only when it ran the check itself, the run did not end in error, and the result carries the project owner's signature. It does not attest which machine or process ran the command, so a result is as trustworthy as the environment that holds the owner's key.

The states are defined under Intent states.

Reproducing historical results