Documentation
¶
Overview ¶
Package dockertest decides whether a test that needs a Linux docker daemon runs, skips or fails on the current host (D-0286).
A test that starts containers calls Require first. On a GitHub Actions Linux runner docker ships in the image, so an unusable daemon there is a broken runner and the test fails. Everywhere else (a laptop with Colima stopped, the cam CI host whose cam-ci user cannot open the socket, macOS and Windows runners) an unusable daemon skips the test with the reason.
Layer: L0. Imports the standard library only. Lives under internal/docker so its `docker info` probe stays inside the docker funnel (repoqa TestDockerFunnel).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Require ¶
Require skips t when no usable Linux docker daemon is reachable, and fails t instead when Strict reports a GitHub Actions Linux runner. It returns only when `docker info` answers with a Linux daemon.
func RuntimeFailure ¶ added in v1.4.15
RuntimeFailure is for a test whose `docker run` itself failed. When the error text shows the host cannot start containers it skips t (or fails on a GitHub Linux runner, like Require, and under INTEGRATION=1) and returns true; otherwise it returns false and the caller reports the failure as a real one. Matching is case-insensitive.
Types ¶
This section is empty.