base

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: Apache-2.0, MIT Imports: 6 Imported by: 0

Documentation

Overview

Package base holds utility methods common to the base tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanUpContainers

func CleanUpContainers(ctx context.Context, containers []*dockerutil.Container)

CleanUpContainers cleans up a slice of containers.

func RedisInstance

func RedisInstance(ctx context.Context, b *testing.B, machine harness.Machine) *dockerutil.Container

RedisInstance returns a Redis container and its reachable IP.

func StartServer

func StartServer(ctx context.Context, b *testing.B, args ServerArgs) (*dockerutil.Container, error)

StartServer starts a single server and cleans it up if it fails.

func StartServers

func StartServers(ctx context.Context, b *testing.B, args ServerArgs) []*dockerutil.Container

StartServers starts b.N containers defined by 'runOpts' and 'cmd' and uses 'machine' to check that each is up.

Types

type ServerArgs

type ServerArgs struct {
	Machine harness.Machine
	Port    int
	RunOpts dockerutil.RunOpts
	Cmd     []string
}

ServerArgs wraps args for startServers and runServerWorkload.

Jump to

Keyboard shortcuts

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