Documentation ¶
Index ¶
- type BootstrapTester
- func (b *BootstrapTester) Cancel() error
- func (b *BootstrapTester) CheckMocks(t *testing.T)
- func (b *BootstrapTester) CheckoutDir() string
- func (b *BootstrapTester) Close() error
- func (b *BootstrapTester) ExpectGlobalHook(name string) *bintest.Expectation
- func (b *BootstrapTester) ExpectLocalHook(name string) *bintest.Expectation
- func (b *BootstrapTester) HasMock(name string) bool
- func (b *BootstrapTester) Mock(name string) (*bintest.Mock, error)
- func (b *BootstrapTester) MustMock(t *testing.T, name string) *bintest.Mock
- func (b *BootstrapTester) ReadEnvFromOutput(key string) (string, bool)
- func (b *BootstrapTester) Run(t *testing.T, env ...string) error
- func (b *BootstrapTester) RunAndCheck(t *testing.T, env ...string)
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 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) 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