test

package
v0.64.0 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: MIT Imports: 10 Imported by: 0

README

The test folder contains two things:

  • common.go - common code shared between the tests to avoid duplication.
  • the source code for mock/spy containers for testing - one for each of config, release and terraform in folders of the same name.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckTerraformInitInitialReflectedInput

func CheckTerraformInitInitialReflectedInput(output []byte)

CheckTerraformInitInitialReflectedInput checks the debug output for the terraform init during release (panics).

func CheckTerraformInitVersionReflectedInput added in v0.57.0

func CheckTerraformInitVersionReflectedInput(output []byte)

CheckTerraformInitVersionReflectedInput checks the debug output for the terraform version check during release (panics).

func CheckTerraformWorkspaceList

func CheckTerraformWorkspaceList(line []byte)

CheckTerraformWorkspaceList checks the debug output for the terraform list workspace command during workspace selection in deployment (panics).

func CheckTerraformWorkspaceNew

func CheckTerraformWorkspaceNew(line []byte, workspaceName string)

CheckTerraformWorkspaceNew checks the debug output for the terraform workspace new command during workspace selections in deployment.

func CreateVolume

func CreateVolume(dockerCient docker.Iface) string

CreateVolume creates a volume (panics).

func DumpLines added in v0.17.3

func DumpLines(lines [][]byte) string

DumpLines outputs a set of lines with indentation.

func GetConfig

func GetConfig(name string) string

GetConfig gets a config value from the environment (panics).

func GetDockerClient added in v0.17.0

func GetDockerClient() docker.Iface

GetDockerClient returns a docker client for testing (panics).

func GetDockerClientWithDebugVolume added in v0.18.0

func GetDockerClientWithDebugVolume() (docker.Iface, string)

GetDockerClientWithDebugVolume returns a docker client and debug volume for testing.

func ReadVolume

func ReadVolume(dockerClient docker.Iface, volume string) (map[string][]byte, error)

ReadVolume reads all the files in a volume as a map of path strings to byte slices of the file contents (panics).

func RemoveVolume

func RemoveVolume(dockerClient docker.Iface, volume string)

RemoveVolume removes a docker volume - outputs a warning if it fails to avoid masking another error.

Types

type ReflectedInput

type ReflectedInput struct {
	Args  []string
	Env   map[string]string
	Input string
	Cwd   string
	File  string
}

ReflectedInput is the message format returned from the fake terraform container that reflects its inputs.

Directories

Path Synopsis
config module
release module
terraform module

Jump to

Keyboard shortcuts

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