testhelpers

package
v0.0.0-...-e0bd98a Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTestImage

func GetTestImage(defaultImage string) string

GetTestImage returns the image to test from TEST_IMAGE env var or falls back to the default

func TestCommandSucceeds

func TestCommandSucceeds(t *testing.T, ctx context.Context, image string, config *ContainerConfig, entrypoint string, args ...string)

TestCommandSucceeds tests that a command runs successfully in the container (exit code 0)

func TestFileExists

func TestFileExists(t *testing.T, ctx context.Context, image string, filePath string, config *ContainerConfig)

TestFileExists tests that a file exists in the container

func TestHTTPEndpoint

func TestHTTPEndpoint(t *testing.T, ctx context.Context, image string, httpConfig HTTPTestConfig, containerConfig *ContainerConfig)

TestHTTPEndpoint tests that an HTTP endpoint is accessible and returns the expected status code

Types

type ContainerConfig

type ContainerConfig struct {
	Env map[string]string // Environment variables to set in the container
}

ContainerConfig holds optional container configuration

type HTTPTestConfig

type HTTPTestConfig struct {
	Port       string
	Path       string
	StatusCode int
}

HTTPTestConfig holds the configuration for HTTP endpoint tests

Jump to

Keyboard shortcuts

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