testcfg

package
v16.1.1 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const UnconfiguredSocketPath = "it is a stub to bypass Validate method"

UnconfiguredSocketPath is used to bypass config validation errors when building the configuration. The socket path is now known yet at the time of building the configuration and is substituted later when the service is actually spun up.

Variables

This section is empty.

Functions

func Build

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

Build creates a minimal configuration setup.

func BuildBinary

func BuildBinary(tb 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 BuildGitaly

func BuildGitaly(tb testing.TB, cfg config.Cfg) string

BuildGitaly builds the gitaly binary and installs it into the binary directory. The gitaly binary embeds other binaries it needs to use when servicing requests. The packed binaries are not built prior to building this gitaly binary and thus cannot be guaranteed to be from the same build.

func BuildGitalyGPG added in v16.1.0

func BuildGitalyGPG(tb testing.TB, cfg config.Cfg) string

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

func BuildGitalyGit2Go

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

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

func BuildGitalyHooks

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

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

func BuildGitalyLFSSmudge

func BuildGitalyLFSSmudge(tb testing.TB, cfg config.Cfg) string

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

func BuildGitalySSH

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

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

func BuildGitalyWrapper

func BuildGitalyWrapper(tb testing.TB, cfg config.Cfg) string

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

func BuildPraefect

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

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

func GitalyServersMetadataFromCfg

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

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

func WriteTemporaryGitalyConfigFile

func WriteTemporaryGitalyConfigFile(tb testing.TB, cfg config.Cfg) string

WriteTemporaryGitalyConfigFile writes the given Gitaly configuration into a temporary file and returns its path.

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(tb testing.TB) config.Cfg

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

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

func WithPackObjectsCacheEnabled() Option

WithPackObjectsCacheEnabled enables the pack object cache.

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