Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MockDefaultConfigPath ¶ added in v0.2.0
func MockDefaultConfigPath(path string) func()
MockDefaultConfigPath changes the global default config path to a user-defined location and returns a func to restore it.
Usage example in tests:
defer testutil.MockDefaultConfigPath(configPath)()
func MockRepositoryCacheDir ¶ added in v0.2.0
func MockRepositoryCacheDir(dir string) func()
MockRepositoryCacheDir changes the global repository cache dir to a temporary directory and returns a func to restore it.
Usage example in tests:
defer testutil.MockRepositoryCacheDir(t.TempDir())()
Types ¶
type ConfigFileBuilder ¶
ConfigFileBuilder is a utility to build kickoff config files in tests.
func NewConfigFileBuilder ¶
func NewConfigFileBuilder(t *testing.T) *ConfigFileBuilder
NewConfigFileBuilder creates a new *ConfigFileBuilder.
func (*ConfigFileBuilder) Create ¶
func (b *ConfigFileBuilder) Create() string
Create creates the config file in a temp dir that gets cleaned up after the current test.
func (*ConfigFileBuilder) WithProjectOwner ¶
func (b *ConfigFileBuilder) WithProjectOwner(owner string) *ConfigFileBuilder
WithProjectOwner sets the project.owner config field.
func (*ConfigFileBuilder) WithRepository ¶
func (b *ConfigFileBuilder) WithRepository(name, url string) *ConfigFileBuilder
WithRepository adds a repository with name and url to the config.
func (*ConfigFileBuilder) WithValues ¶
func (b *ConfigFileBuilder) WithValues(values template.Values) *ConfigFileBuilder
WithValues sets the values in the config.