testutils

package
v0.0.0-...-223fbb0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateContainer

func CreateContainer(
	ctx context.Context,
	t *testing.T,
	image string,
	opts ...ContainerOptionFn,
) testcontainers.Container

func CreateNetwork

func CreateNetwork(ctx context.Context, t *testing.T, name string) testcontainers.Network

func GetContainerAddress

func GetContainerAddress(
	ctx context.Context,
	t *testing.T,
	container testcontainers.Container,
	port nat.Port,
) string

func ReadText

func ReadText(t *testing.T, path string) string

func RemoveNetwork

func RemoveNetwork(ctx context.Context, t *testing.T, network testcontainers.Network)

func TerminateContainer

func TerminateContainer(ctx context.Context, t *testing.T, container testcontainers.Container)

func WaitUntilHealthy

func WaitUntilHealthy(ctx context.Context, t *testing.T, url string, maxElapsedTime time.Duration)

func WriteText

func WriteText(t *testing.T, path string, content string)

Types

type ContainerOptionFn

type ContainerOptionFn func(*testcontainers.ContainerRequest)

func WithEnv

func WithEnv(env map[string]string) ContainerOptionFn

func WithNetworks

func WithNetworks(networks []string) ContainerOptionFn

func WithPorts

func WithPorts(ports []string) ContainerOptionFn

func WithWaitStrategy

func WithWaitStrategy(strategy wait.Strategy) ContainerOptionFn

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL