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 ¶
- type ExecutorTester
- func (e *ExecutorTester) Cancel() error
- func (e *ExecutorTester) CheckMocks(t *testing.T)
- func (e *ExecutorTester) CheckoutDir() string
- func (e *ExecutorTester) Close() error
- func (e *ExecutorTester) EnableGitMirrors() error
- func (e *ExecutorTester) ExpectGlobalHook(name string) *bintest.Expectation
- func (e *ExecutorTester) ExpectLocalHook(name string) *bintest.Expectation
- func (e *ExecutorTester) HasMock(name string) bool
- func (e *ExecutorTester) Mock(name string) (*bintest.Mock, error)
- func (e *ExecutorTester) MockAgent(t *testing.T) *bintest.Mock
- func (e *ExecutorTester) MustMock(t *testing.T, name string) *bintest.Mock
- func (e *ExecutorTester) ReadEnvFromOutput(key string) (string, bool)
- func (e *ExecutorTester) Run(t *testing.T, env ...string) error
- func (e *ExecutorTester) RunAndCheck(t *testing.T, env ...string)
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 NewExecutorTester ¶ added in v3.73.1
func NewExecutorTester(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