testutil

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorStringComparer = cmp.Comparer(func(e1, e2 error) bool {
	if e1 == nil && e2 == nil {
		return true
	}
	if e1 == nil || e2 == nil {
		return false
	}
	return e1.Error() == e2.Error()
})

ErrorStringComparer allows go-cmp to compare two errors based on their .Error() string values rather than by checking strict type equality or memory address equality.

Functions

func CleanupContainers

func CleanupContainers()

CleanupContainers terminates any globally started containers.

func GlobalMySQL

func GlobalMySQL(t *testing.T) string

GlobalMySQL returns a shared MySQL DSN for the entire test process.

func GlobalPostgres

func GlobalPostgres(t *testing.T) string

GlobalPostgres returns a shared Postgres DSN for the entire test process.

func GlobalToxiproxyPostgres

func GlobalToxiproxyPostgres(t *testing.T) (string, *toxiproxy.Proxy)

GlobalToxiproxyPostgres returns a DSN for a Postgres instance proxied through Toxiproxy.

func HasDocker

func HasDocker() bool

HasDocker check if the local system has a running Docker daemon. If it fails, tests relying on Postgres/MySQL will be skipped.

Types

This section is empty.

Jump to

Keyboard shortcuts

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