Back to godoc.org
agola.io/agola / internal / testutil

Package testutil

v0.5.0
Latest Go to latest

The latest major version is .

Published: Feb 18, 2020 | License: Apache-2.0 | Module: agola.io/agola

Index

Constants

const (
	MinPort = 2048
	MaxPort = 16384
)

func GetFreePort

func GetFreePort(tcp bool, udp bool) (string, string, error)

Hack to find a free tcp and udp port

func ParseEnv

func ParseEnv(envvar string) (string, string, error)

func ParseEnvs

func ParseEnvs(r io.Reader) (map[string]string, error)

func Wait

func Wait(timeout time.Duration, f CheckFunc) error

type CheckFunc

type CheckFunc func() (bool, error)

type GiteaConfig

type GiteaConfig struct {
	Data              string
	User              string
	HTTPListenAddress string
	HTTPPort          string
	SSHListenAddress  string
	SSHPort           string
}

type Process

type Process struct {
	Cmd *gexpect.ExpectSubprocess
	// contains filtered or unexported fields
}

func (*Process) Kill

func (p *Process) Kill()

func (*Process) Signal

func (p *Process) Signal(sig os.Signal) error

func (*Process) Start

func (p *Process) Start() error

func (*Process) StartExpect

func (p *Process) StartExpect() error

func (*Process) Stop

func (p *Process) Stop()

func (*Process) Wait

func (p *Process) Wait(timeout time.Duration) error

type TestEmbeddedEtcd

type TestEmbeddedEtcd struct {
	*TestEtcd
	Etcd          *embed.Etcd
	Endpoint      string
	ListenAddress string
	Port          string
	// contains filtered or unexported fields
}

func NewTestEmbeddedEtcd

func NewTestEmbeddedEtcd(t *testing.T, logger *zap.Logger, dir string, a ...string) (*TestEmbeddedEtcd, error)

func (*TestEmbeddedEtcd) Kill

func (te *TestEmbeddedEtcd) Kill() error

func (*TestEmbeddedEtcd) Start

func (te *TestEmbeddedEtcd) Start() error

func (*TestEmbeddedEtcd) Stop

func (te *TestEmbeddedEtcd) Stop() error

type TestEtcd

type TestEtcd struct {
	*etcd.Store
	// contains filtered or unexported fields
}

func (*TestEtcd) Compact

func (te *TestEtcd) Compact() error

func (*TestEtcd) WaitDown

func (te *TestEtcd) WaitDown(timeout time.Duration) error

func (*TestEtcd) WaitUp

func (te *TestEtcd) WaitUp(timeout time.Duration) error

type TestExternalEtcd

type TestExternalEtcd struct {
	*TestEtcd
	Process
	Endpoint      string
	ListenAddress string
	Port          string
	// contains filtered or unexported fields
}

func NewTestExternalEtcd

func NewTestExternalEtcd(t *testing.T, logger *zap.Logger, dir string, a ...string) (*TestExternalEtcd, error)

type TestGitea

type TestGitea struct {
	Process

	GiteaPath         string
	ConfigPath        string
	HTTPListenAddress string
	HTTPPort          string
	SSHListenAddress  string
	SSHPort           string
}

func NewTestGitea

func NewTestGitea(t *testing.T, dir, dockerBridgeAddress string, a ...string) (*TestGitea, error)

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier