integration

package
v2.6.8+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2017 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BootstrapTester

type BootstrapTester struct {
	Name     string
	Args     []string
	Env      []string
	HomeDir  string
	PathDir  string
	BuildDir string
	HooksDir string
	Repo     *gitRepository
	Output   string
	// contains filtered or unexported fields
}

BootstrapTester invokes a buildkite-agent bootstrap script with a temporary environment

func NewBootstrapTester

func NewBootstrapTester() (*BootstrapTester, error)

func (*BootstrapTester) CheckMocks

func (b *BootstrapTester) CheckMocks(t *testing.T)

func (*BootstrapTester) CheckoutDir

func (b *BootstrapTester) CheckoutDir() string

func (*BootstrapTester) Close

func (b *BootstrapTester) Close() error

Close the tester, delete all the directories and mocks

func (*BootstrapTester) ExpectGlobalHook

func (b *BootstrapTester) ExpectGlobalHook(name string) *bintest.Expectation

ExpectGlobalHook creates a mock object and a script in the global buildkite hooks dir that proxies to the mock. This lets you set up expectations on a global hook

func (*BootstrapTester) ExpectLocalHook

func (b *BootstrapTester) ExpectLocalHook(name string) *bintest.Expectation

ExpectLocalHook creates a mock object and a script in the git repository's buildkite hooks dir that proxies to the mock. This lets you set up expectations on a local hook

func (*BootstrapTester) LinkCommonCommands

func (b *BootstrapTester) LinkCommonCommands() error

Link common commands from system path, these can be mocked as needed

func (*BootstrapTester) LinkLocalCommand

func (b *BootstrapTester) LinkLocalCommand(name string) error

LinkLocalCommand creates a symlink for commands into the tester PATH

func (*BootstrapTester) Mock

func (b *BootstrapTester) Mock(name string) (*bintest.Mock, error)

Mock creates a mock for a binary using bintest

func (*BootstrapTester) MustMock

func (b *BootstrapTester) MustMock(t *testing.T, name string) *bintest.Mock

MustMock will fail the test if creating the mock fails

func (*BootstrapTester) ReadEnvFromOutput

func (b *BootstrapTester) ReadEnvFromOutput(key string) (string, bool)

func (*BootstrapTester) Run

func (b *BootstrapTester) Run(env ...string) error

Run the bootstrap and return any errors

func (*BootstrapTester) RunAndCheck

func (b *BootstrapTester) RunAndCheck(t *testing.T, env ...string)

Run the bootstrap and then check the mocks

Jump to

Keyboard shortcuts

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