integration

package
v3.42.0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package integration defines a series of integration tests for the bootstrap.

It is intended for internal use by buildkite-agent only.

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
	GitMirrorsDir string
	HooksDir      string
	PluginsDir    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) Cancel

func (b *BootstrapTester) Cancel() 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) HasMock

func (b *BootstrapTester) HasMock(name string) bool

HasMock returns true if a mock has been created by that name

func (*BootstrapTester) Mock

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

Mock creates a mock for a binary using bintest

func (*BootstrapTester) MockAgent added in v3.39.1

func (b *BootstrapTester) MockAgent(t *testing.T) *bintest.Mock

MockAgent creates a mock for the buildkite-agent binary

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(t *testing.T, 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