Documentation
¶
Overview ¶
Command functionalrun runs the functional tier (the tests behind `//go:build functional`) inside ONE container per run, so every dependency a test starts (redis-server, postgres, a built binary) lives and dies with the container. The fixtures do not change: they start their dependencies as child processes, and here those children are inside the container.
The container runtime owns the run, never this process:
- the bound is the runtime's: `podman run --timeout` is enforced by the runtime's monitor outside the container, and it holds when this process is killed; this process also removes the container itself when the deadline passes or it is interrupted;
- the removal is the runtime's: `--rm`, and a forced removal by this process at the end whatever happened;
- a reaper removes every container of this tool whose deadline (plus a grace) has passed. It selects by this tool's label, never by name, and runs before every run and by hand (`functionalrun reap`).
Output of the tests goes to stdout and stderr unchanged, and the exit code is the container's (make's: 0 green, 2 a red test or build), except where this tool ended the run: 124 the deadline, 130 an interrupt, 125 the tool could not run the container or the container was not gone afterwards.