Documentation
¶
Overview ¶
Package containers provides utilities for setting up testing containers. Currently, it includes functionality for - Postgres containers - Grafana LGTM containers
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LGTM ¶
func LGTM(t *testing.T, ctx context.Context) (ctr *grafanalgtm.GrafanaLGTMContainer, fault error)
LGTM starts a Grafana LGTM container for testing purposes.
Types ¶
type DatabaseContainer ¶
type DatabaseContainer struct {
Postgres *postgres.PostgresContainer
Database string
Username string
Password string
Host string
Port string
}
DatabaseContainer wraps the PostgresContainer with additional metadata.
func Postgres ¶
func Postgres(t *testing.T, ctx context.Context, version string) (container DatabaseContainer, fault error)
Postgres starts a Postgres container for testing purposes.
func (DatabaseContainer) Cleanup ¶
func (c DatabaseContainer) Cleanup(t testing.TB)
Cleanup terminates the Postgres container.
func (DatabaseContainer) DatabaseURL ¶
func (c DatabaseContainer) DatabaseURL() string
DatabaseURL returns the connection URL for the Postgres database.
func (DatabaseContainer) MappedPort ¶
MappedPort returns the mapped port for the given container port.
Click to show internal directories.
Click to hide internal directories.