Documentation
¶
Overview ¶
Package testinfra is the extendable integration-test harness for a servicepack app. Its baseline builds the servicepack image from the repo Dockerfile and runs it, so a test exercises the real, containerized application with whatever services it registers, and nothing more.
Extend it with the external dependencies your services need (a database, a cache, a broker via testcontainers-go): give Infra a field, start it in Setup, wire the app container to it, and tear it down in Teardown. The DIND runner already supports this: DEV_RUN_DIND uses the host network, so testcontainers' host-published ports are reachable.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Infra ¶
type Infra struct {
App testcontainers.Container
}
Infra holds the containers a test package brought up. At the baseline that is just the application image; extend it with one field per external dependency (for example: Postgres *PostgresResource) as your services grow.