testing

package
v0.0.0-...-c04e39c Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package testing aims to provide simple "helper" methods to ease the use of compose (through libcompose) in (integration) tests using built-in testing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Project

type Project struct {
	// contains filtered or unexported fields
}

Project holds compose related project attributes

func CreateProject

func CreateProject(t *testing.T, name string, composeFiles ...string) *Project

CreateProject creates a compose project with the given name based on the specified compose files

func (*Project) Container

func (p *Project) Container(t *testing.T, service string) types.ContainerJSON

Container return the one and only container for a given services. It fails if there is more than one container for the service.

func (*Project) Containers

func (p *Project) Containers(t *testing.T, service string) []types.ContainerJSON

Containers lists containers for a given services.

func (*Project) NoContainer

func (p *Project) NoContainer(t *testing.T, service string)

NoContainer check is there is no container for the service given It fails if there one or more containers or if the error returned does not indicate an empty container list

func (*Project) Scale

func (p *Project) Scale(t *testing.T, service string, count int)

Scale scale a service up

func (*Project) Start

func (p *Project) Start(t *testing.T, services ...string)

Start creates and starts the compose project.

func (*Project) Stop

func (p *Project) Stop(t *testing.T, services ...string)

Stop shuts down and clean the project

Jump to

Keyboard shortcuts

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