integration

package
v3.63.1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package integration defines a series of integration tests for the job executor.

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 ExecutorTester

type ExecutorTester 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
}

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

func NewBootstrapTester

func NewBootstrapTester(ctx context.Context) (*ExecutorTester, error)

func (*ExecutorTester) Cancel

func (e *ExecutorTester) Cancel() error

func (*ExecutorTester) CheckMocks

func (e *ExecutorTester) CheckMocks(t *testing.T)

func (*ExecutorTester) CheckoutDir

func (e *ExecutorTester) CheckoutDir() string

func (*ExecutorTester) Close

func (e *ExecutorTester) Close() error

Close the tester, delete all the directories and mocks

func (*ExecutorTester) EnableGitMirrors

func (e *ExecutorTester) EnableGitMirrors() error

func (*ExecutorTester) ExpectGlobalHook

func (e *ExecutorTester) 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 (*ExecutorTester) ExpectLocalHook

func (e *ExecutorTester) 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 (*ExecutorTester) HasMock

func (e *ExecutorTester) HasMock(name string) bool

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

func (*ExecutorTester) Mock

func (e *ExecutorTester) Mock(name string) (*bintest.Mock, error)

Mock creates a mock for a binary using bintest

func (*ExecutorTester) MockAgent

func (e *ExecutorTester) MockAgent(t *testing.T) *bintest.Mock

MockAgent creates a mock for the buildkite-agent binary

func (*ExecutorTester) MustMock

func (e *ExecutorTester) MustMock(t *testing.T, name string) *bintest.Mock

MustMock will fail the test if creating the mock fails

func (*ExecutorTester) ReadEnvFromOutput

func (e *ExecutorTester) ReadEnvFromOutput(key string) (string, bool)

func (*ExecutorTester) Run

func (e *ExecutorTester) Run(t *testing.T, env ...string) error

Run the bootstrap and return any errors

func (*ExecutorTester) RunAndCheck

func (e *ExecutorTester) RunAndCheck(t *testing.T, env ...string)

Run the bootstrap and then check the mocks

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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