testutil

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MinPort = 2048
	MaxPort = 16384
)

Variables

This section is empty.

Functions

func GetFreePort

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

Hack to find a free tcp and udp port

func ParseEnv added in v0.2.0

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

func ParseEnvs added in v0.2.0

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

func Wait added in v0.2.0

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

Types

type CheckFunc added in v0.2.0

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)

Jump to

Keyboard shortcuts

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