container

package
v0.0.0-...-a7f85cb Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2021 License: BSD-3-Clause Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentStepImage

func CurrentStepImage(t *testing.T) string

CurrentStepImage get the tested image name based on `STEP_IMAGE` env variable

func ParseStepOutput

func ParseStepOutput(stepOutput string) (*gabs.Container, error)

ParseStepOutput parse step log output, assumes the output contains marker and is parsable JSON

Types

type ExecuteResult

type ExecuteResult struct {
	ExitCode int
	Log      string
}

execute imageName with given env variables or args, returns exit code, log, error

func Execute

func Execute(ctx context.Context, imageName string, envs map[string]string, args []string) (*ExecuteResult, error)

Execute imageName docker with `env` and `args`, wait until it exits and return exit code and output

type ServiceURL

type ServiceURL struct {
	Schema      string
	Host        string
	Port        string
	HostAndPort string
	FullURL     string
}

func NewServiceURL

func NewServiceURL(schema, host, port string) ServiceURL

type Test

type Test struct {
	// Testcase name
	Name string
	// The tested image
	Image string
	// Env variables
	Envs map[string]string
	// Arguments
	Args []string
	// Desired exit code
	WantExitCode int
	// Desired error message, can be empty
	WantError string
	// Desired output, can be empty
	WantOutput matcher.Matcher
}

func (*Test) Run

func (tc *Test) Run(t *testing.T)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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