|
testcontainers-cpp 0.2.0
Native C++20 Testcontainers over the Docker Engine API
|
Readiness conditions: the alternative types a WaitFor can hold, plus the convenience factories (below) that build them. More...
Classes | |
| struct | None |
| No readiness condition — start() returns as soon as the container is started. More... | |
| struct | LogMessage |
| Wait until a substring appears in the container's logs a number of times. More... | |
| struct | Duration |
| Wait for a fixed duration after start (a coarse fallback strategy). More... | |
| struct | Exit |
| Wait until the container stops, optionally with a specific exit code. More... | |
| struct | Healthcheck |
| Wait until the container's Docker health status becomes "healthy". More... | |
| struct | Http |
| Wait until an HTTP GET to the mapped host port returns expected_status. More... | |
| struct | Port |
| Wait until the mapped host port for port accepts a TCP connection. More... | |
| struct | Command |
| Wait until a command run inside the container (via exec) exits with code 0. More... | |
Functions | |
| WaitFor | stdout_message (std::string text, int times=1) |
| Wait for text to appear times times on stdout. | |
| WaitFor | stderr_message (std::string text, int times=1) |
| Wait for text to appear times times on stderr. | |
| WaitFor | log (std::string text, int times=1) |
| Wait for text to appear on either stream. | |
| WaitFor | seconds (int s) |
| Wait a fixed number of seconds after start. | |
| WaitFor | millis (int ms) |
| Wait a fixed number of milliseconds after start. | |
| WaitFor | exit () |
| Wait until the container stops (with any exit code). | |
| WaitFor | exit_code (std::int64_t code) |
| Wait until the container stops with the given exit code. | |
| WaitFor | healthy () |
| Wait until the container's Docker health becomes "healthy". | |
| WaitFor | http (std::string path, ContainerPort port, int status=200) |
| Wait until an HTTP GET to path on the mapped host port for port returns status. | |
| WaitFor | listening_port (ContainerPort port) |
| Wait until the mapped host port for port accepts a TCP connection. | |
| WaitFor | successful_command (std::vector< std::string > cmd) |
| Wait until cmd (argv form), run inside the container, exits with code 0, e.g. | |
| WaitFor | successful_shell_command (std::string script) |
| Wait until the shell line script, run inside the container via /bin/sh -c, exits with code 0. | |
Readiness conditions: the alternative types a WaitFor can hold, plus the convenience factories (below) that build them.
Convenience factories that build the right WaitFor alternative.
|
inline |
Wait for text to appear times times on stdout.
|
inline |
Wait for text to appear times times on stderr.
|
inline |
Wait for text to appear on either stream.
|
inline |
Wait a fixed number of seconds after start.
|
inline |
Wait a fixed number of milliseconds after start.
|
inline |
Wait until the container stops (with any exit code).
|
inline |
Wait until the container stops with the given exit code.
|
inline |
Wait until the container's Docker health becomes "healthy".
|
inline |
Wait until an HTTP GET to path on the mapped host port for port returns status.
|
inline |
Wait until the mapped host port for port accepts a TCP connection.
|
inline |
Wait until cmd (argv form), run inside the container, exits with code 0, e.g.
successful_command({"pg_isready", "-U", "test"}).
|
inline |
Wait until the shell line script, run inside the container via /bin/sh -c, exits with code 0.
Requires an image with /bin/sh; for a Windows container use successful_command with the image's shell instead (e.g. {"cmd", "/c", ...}).