helpers

package
v1.12.2 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2023 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const DOCKER_API_VERSION = "1.40"

Variables

This section is empty.

Functions

func DefaultTestLogger

func DefaultTestLogger() log.Logger

func DockerClient added in v1.0.0

func DockerClient(t TestingT) *dockerClient.Client

func Eventually

func Eventually(timeout time.Duration, f func() bool) bool

func InitSwarmEnvironment added in v0.22.0

func InitSwarmEnvironment(t *testing.T, ctx context.Context)

func LocalIP

func LocalIP() string

func LogSwarmServices added in v0.22.0

func LogSwarmServices(t *testing.T, ctx context.Context)

func PrintLog added in v0.22.0

func PrintLog(log Log, w io.Writer)

func RequireEventually added in v0.22.0

func RequireEventually(t TestingT, duration time.Duration, f func(t TestingT))

* run the test func with a testing.T -like reporter func will run eventuallyIterations times at most, but will not start later than the specified duration expects the test func to succeed at least once, at which point this function returns immediately, Otherwise, the parent test will fail with the details of the last func failure.

func SkipUnlessSwarmIsEnabled

func SkipUnlessSwarmIsEnabled(t *testing.T)

func VerifyFilesExist added in v1.7.0

func VerifyFilesExist(t TestingT, directories ...string) bool

func WithContext added in v0.22.0

func WithContext(f func(ctx context.Context))

func WithContextAndShutdown added in v0.22.0

func WithContextAndShutdown(f func(ctx context.Context) govnr.ShutdownWaiter)

Types

type HttpServer

type HttpServer interface {
	Start()
	Shutdown()
	Url() string
	Port() int
}

func CreateHttpServer

func CreateHttpServer(path string, port int, f func(writer http.ResponseWriter, request *http.Request)) HttpServer

type Log added in v0.22.0

type Log = <-chan *LogLine

func ReadAllServicesLog added in v0.22.0

func ReadAllServicesLog(ctx context.Context) (Log, error)

func ReadServiceLog added in v0.22.0

func ReadServiceLog(ctx context.Context, cli *client.Client, service swarm.Service) (Log, error)

type LogLine added in v0.22.0

type LogLine struct {
	Prefix  string
	IsError bool
	Text    string
}

type TestingT added in v0.22.0

type TestingT interface {
	require.TestingT
}

Jump to

Keyboard shortcuts

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