testcfg

package
v14.8.1 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(t testing.TB, opts ...Option) config.Cfg

Build creates a minimal configuration setup with no options and returns it with cleanup function.

func BuildBinary added in v14.5.0

func BuildBinary(t testing.TB, targetDir, sourcePath string) string

BuildBinary builds a Go binary once and copies it into the target directory. The source path can either be a ".go" file or a directory containing Go files. Returns the path to the executable in the destination directory.

func BuildGitalyGit2Go added in v14.5.0

func BuildGitalyGit2Go(t testing.TB, cfg config.Cfg) string

BuildGitalyGit2Go builds the gitaly-git2go command and installs it into the binary directory.

func BuildGitalyHooks added in v14.5.0

func BuildGitalyHooks(t testing.TB, cfg config.Cfg) string

BuildGitalyHooks builds the gitaly-hooks command and installs it into the binary directory.

func BuildGitalyLFSSmudge added in v14.5.0

func BuildGitalyLFSSmudge(t *testing.T, cfg config.Cfg) string

BuildGitalyLFSSmudge builds the gitaly-lfs-smudge command and installs it into the binary directory.

func BuildGitalySSH added in v14.5.0

func BuildGitalySSH(t testing.TB, cfg config.Cfg) string

BuildGitalySSH builds the gitaly-ssh command and installs it into the binary directory.

func BuildGitalyWrapper added in v14.7.0

func BuildGitalyWrapper(t *testing.T, cfg config.Cfg) string

BuildGitalyWrapper builds the gitaly-wrapper command and installs it into the binary directory.

func BuildPraefect added in v14.5.0

func BuildPraefect(t testing.TB, cfg config.Cfg) string

BuildPraefect builds the praefect command and installs it into the binary directory.

func BuildWithRepo

func BuildWithRepo(t testing.TB, opts ...Option) (config.Cfg, *gitalypb.Repository, string)

BuildWithRepo creates a minimal configuration setup with no options. It also clones test repository at the storage and returns it with the full path to the repository.

func GitalyServersMetadataFromCfg added in v14.5.0

func GitalyServersMetadataFromCfg(t testing.TB, cfg config.Cfg) metadata.MD

GitalyServersMetadataFromCfg returns a metadata pair for gitaly-servers to be used in inter-gitaly operations.

Types

type GitalyCfgBuilder

type GitalyCfgBuilder struct {
	// contains filtered or unexported fields
}

GitalyCfgBuilder automates creation of the gitaly configuration and filesystem structure required.

func NewGitalyCfgBuilder

func NewGitalyCfgBuilder(opts ...Option) GitalyCfgBuilder

NewGitalyCfgBuilder returns gitaly configuration builder with configured set of options.

func (*GitalyCfgBuilder) Build

func (gc *GitalyCfgBuilder) Build(t testing.TB) config.Cfg

Build setups required filesystem structure, creates and returns configuration of the gitaly service.

func (*GitalyCfgBuilder) BuildWithRepoAt

func (gc *GitalyCfgBuilder) BuildWithRepoAt(t testing.TB, relativePath string) (config.Cfg, []*gitalypb.Repository)

BuildWithRepoAt setups required filesystem structure, creates and returns configuration of the gitaly service, clones test repository into each configured storage the provided relative path.

type Option

type Option func(*GitalyCfgBuilder)

Option is a configuration option for the builder.

func WithBase

func WithBase(cfg config.Cfg) Option

WithBase allows use cfg as a template for start building on top of. override parameter signals if settings of the cfg can be overridden or not (if setting has a default value it is considered "not configured" and can be set despite flag value).

func WithPackObjectsCacheEnabled added in v14.0.10

func WithPackObjectsCacheEnabled() Option

WithPackObjectsCacheEnabled enables the pack object cache.

func WithRealLinguist

func WithRealLinguist() Option

WithRealLinguist suppress stubbing of the linguist language detection.

func WithStorages

func WithStorages(name string, names ...string) Option

WithStorages allows to configure list of storages under this gitaly instance. All storages will have a test repository by default.

Jump to

Keyboard shortcuts

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