testutil

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2025 License: Apache-2.0, MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFreePort

func GetFreePort(t *testing.T) int

GetFreePort asks the OS for a free port that can be used for testing. This helps avoid port conflicts when running tests in parallel.

func IsDockerAvailable added in v0.0.17

func IsDockerAvailable(t testing.TB) bool

IsDockerAvailable returns true if the docker daemon is available, useful for skipping tests when docker isn't running

func IsRunningInCI added in v0.0.17

func IsRunningInCI(t testing.TB) bool

IsRunningInCI returns true of process is running in CI environment.

func NewTestConfig added in v0.0.12

func NewTestConfig(t *testing.T, opts ...TestConfigOption) app.AppConfig

NewTestConfig creates a new test config with sensible defaults This follows the functional options pattern for easy customization

func WaitForHealthy added in v0.0.17

func WaitForHealthy(t testing.TB, url *url.URL)

WaitForHealthy waits for the URL to return HTTP 200 for up to 10 seconds.

Types

type TestConfigOption added in v0.0.12

type TestConfigOption func(*testing.T, *app.AppConfig)

TestConfigOption is a function that modifies a test config

func WithSigner added in v0.0.12

func WithSigner(signer principal.Signer) TestConfigOption

WithSigner sets the identity signer

func WithUploadServiceConfig added in v0.0.17

func WithUploadServiceConfig(id did.DID, url *url.URL) TestConfigOption

WithUploadServiceConfig sets the upload service configuration

Jump to

Keyboard shortcuts

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