Documentation ¶
Index ¶
- func BoolPtr(b bool) *bool
- func CreateClient(t *testing.T, starterEndpoint string, serverType client.ServerType, ...) (driver.Client, error)
- func IsInterrupt(err error) bool
- func NewInterrupt() error
- func NewStarterClient(t *testing.T, endpoint string) client.API
- func SendIntrAndWait(t *testing.T, starters ...*SubProcess) bool
- func SetUniqueDataDir(t *testing.T) string
- func ShutdownStarterCall(endpoint string) callFunction
- func WaitUntilCoordinatorReadyAPI(t *testing.T, endpoint string) driver.Client
- func WaitUntilServiceReadyRetryOn503(t *testing.T, c driver.Client, check ServiceReadyCheckFunc) bool
- func WaitUntilServiceReadyRetryOnError(t *testing.T, c driver.Client, check ServiceReadyCheckFunc) bool
- func WaitUntilStarterExit(t *testing.T, timeout time.Duration, exitCode int, starter *SubProcess)
- func WaitUntilStarterGone(t *testing.T, endpoint string)
- func WaitUntilStarterReady(t *testing.T, what string, requiredGoodResults int, starters ...*SubProcess) bool
- type EnvironmentVariable
- type Interrupt
- type Logger
- type MembersConfig
- type ServiceReadyCheck
- type ServiceReadyCheckFunc
- type SubProcess
- func (sp *SubProcess) Close() error
- func (sp *SubProcess) EnsureNoMatches(ctx context.Context, timeout time.Duration, re *regexp.Regexp, id string) error
- func (sp *SubProcess) ExpectTimeout(ctx context.Context, timeout time.Duration, re *regexp.Regexp, id string) error
- func (sp *SubProcess) Kill() error
- func (sp *SubProcess) Output() []byte
- func (sp *SubProcess) SendIntr() error
- func (sp *SubProcess) Start() error
- func (sp *SubProcess) Wait() error
- func (sp *SubProcess) WaitT(t *testing.T)
- func (sp *SubProcess) WaitTimeout(timeout time.Duration) error
- type Throttle
- type TimeoutFunc
- func NewTimeoutFunc(f func() error) TimeoutFunc
- func WaitForHttpPortClosed(log Logger, throttle Throttle, url string) TimeoutFunc
- func WaitUntilServiceReady(t *testing.T, c driver.Client, checkFunc ServiceReadyCheckFunc, ...) TimeoutFunc
- func WaitUntilServiceReadyAPI(t *testing.T, c driver.Client, check ServiceReadyCheckFunc) TimeoutFunc
- func (f TimeoutFunc) Execute(timeout, interval time.Duration) error
- func (f TimeoutFunc) ExecuteT(t *testing.T, timeout, interval time.Duration)
- func (f TimeoutFunc) ExecuteTWithLog(t *testing.T, log Logger, timeout, interval time.Duration)
- func (f TimeoutFunc) ExecuteWithLog(log Logger, timeout, interval time.Duration) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateClient ¶
func CreateClient(t *testing.T, starterEndpoint string, serverType client.ServerType, auth driver.Authentication) (driver.Client, error)
CreateClient creates a client to the server of the given type based on the arangodb starter endpoint.
func IsInterrupt ¶ added in v0.17.1
func NewInterrupt ¶ added in v0.17.1
func NewInterrupt() error
func NewStarterClient ¶
NewStarterClient creates a new starter API instance for the given endpoint, failing the test on errors.
func SendIntrAndWait ¶
func SendIntrAndWait(t *testing.T, starters ...*SubProcess) bool
SendIntrAndWait stops all all given starter processes by sending a Ctrl-C into it. It then waits until the process has terminated.
func SetUniqueDataDir ¶
SetUniqueDataDir creates a temp dir and sets the DATA_DIR environment variable to it.
func ShutdownStarterCall ¶ added in v0.17.1
func ShutdownStarterCall(endpoint string) callFunction
ShutdownStarterCall returns function representation of ShutdownStarter.
func WaitUntilCoordinatorReadyAPI ¶ added in v0.17.1
WaitUntilCoordinatorReadyAPI creates client with default root/password and waits until good response. Returns client
func WaitUntilServiceReadyRetryOn503 ¶ added in v0.17.1
func WaitUntilServiceReadyRetryOn503(t *testing.T, c driver.Client, check ServiceReadyCheckFunc) bool
WaitUntilServiceReadyRetryOn503 retry on 503 code from service
func WaitUntilServiceReadyRetryOnError ¶ added in v0.17.1
func WaitUntilServiceReadyRetryOnError(t *testing.T, c driver.Client, check ServiceReadyCheckFunc) bool
WaitUntilServiceReadyRetryOnError do not allow any errors to occur
func WaitUntilStarterExit ¶ added in v0.17.1
WaitUntilStarterExit waits until given starter process will finish and checks for exit code
func WaitUntilStarterGone ¶
WaitUntilStarterGone waits until the starter at given endpoint no longer responds to queries.
func WaitUntilStarterReady ¶
func WaitUntilStarterReady(t *testing.T, what string, requiredGoodResults int, starters ...*SubProcess) bool
WaitUntilStarterReady waits until all given starter processes have reached the "Your cluster is ready state"
Types ¶
type EnvironmentVariable ¶ added in v0.17.1
type EnvironmentVariable string
func (EnvironmentVariable) Lookup ¶ added in v0.17.1
func (e EnvironmentVariable) Lookup() (string, bool)
func (EnvironmentVariable) String ¶ added in v0.17.1
func (e EnvironmentVariable) String() string
type Logger ¶ added in v0.17.1
type MembersConfig ¶ added in v0.18.11
type MembersConfig struct { ID string Port int DataDir string HasAgent *bool Process *SubProcess }
type ServiceReadyCheck ¶ added in v0.17.1
type ServiceReadyCheck func(t *testing.T, c driver.Client, check ServiceReadyCheckFunc) bool
type ServiceReadyCheckFunc ¶ added in v0.17.1
func ServiceReadyCheckDatabase ¶ added in v0.17.1
func ServiceReadyCheckDatabase(databaseName string) ServiceReadyCheckFunc
ServiceReadyCheckDatabase checks if database info can be fetched
func ServiceReadyCheckVersion ¶ added in v0.17.1
func ServiceReadyCheckVersion() ServiceReadyCheckFunc
ServiceReadyCheckVersion checks if version can be fetched
type SubProcess ¶
type SubProcess struct {
// contains filtered or unexported fields
}
func NewSubProcess ¶
func NewSubProcess(name string, arg ...string) (*SubProcess, error)
NewSubProcess creates a new process with given name and arguments. The process is not yet starter.
func Spawn ¶
func Spawn(t *testing.T, command string) *SubProcess
Spawn spawns a command and returns its process with optionally expanded envs.
func SpawnWithExpand ¶
func SpawnWithExpand(t *testing.T, command string, expand bool) *SubProcess
SpawnWithExpand spawns a command and returns its process with optionally expanded envs.
func (*SubProcess) EnsureNoMatches ¶ added in v0.17.1
func (sp *SubProcess) EnsureNoMatches(ctx context.Context, timeout time.Duration, re *regexp.Regexp, id string) error
EnsureNoMatches returns error only if matches were found
func (*SubProcess) ExpectTimeout ¶
func (sp *SubProcess) ExpectTimeout(ctx context.Context, timeout time.Duration, re *regexp.Regexp, id string) error
ExpectTimeout waits for the output of the process to match the given expression, or until a timeout occurs. If a match on the given expression is found, the process output is discard until the end of the match and nil is returned, otherwise a timeout error is returned. If the given context is canceled, nil is returned.
func (*SubProcess) Kill ¶
func (sp *SubProcess) Kill() error
Kill terminates the process the hard way.
func (*SubProcess) Output ¶ added in v0.17.1
func (sp *SubProcess) Output() []byte
Output get current output
func (*SubProcess) SendIntr ¶
func (sp *SubProcess) SendIntr() error
SendIntr sends a SIGINT to the process.
func (*SubProcess) Wait ¶
func (sp *SubProcess) Wait() error
Wait waits for the process to terminate.
func (*SubProcess) WaitT ¶ added in v0.17.1
func (sp *SubProcess) WaitT(t *testing.T)
WaitT waits for the process to terminate with require.
func (*SubProcess) WaitTimeout ¶
func (sp *SubProcess) WaitTimeout(timeout time.Duration) error
WaitTimeout waits for the process to terminate. Kill the process after the given timeout.
type Throttle ¶ added in v0.17.1
type Throttle interface {
Execute(func())
}
func NewThrottle ¶ added in v0.17.1
type TimeoutFunc ¶ added in v0.17.1
type TimeoutFunc func() error
func NewTimeoutFunc ¶ added in v0.17.1
func NewTimeoutFunc(f func() error) TimeoutFunc
func WaitForHttpPortClosed ¶ added in v0.17.1
func WaitForHttpPortClosed(log Logger, throttle Throttle, url string) TimeoutFunc
func WaitUntilServiceReady ¶ added in v0.17.1
func WaitUntilServiceReady(t *testing.T, c driver.Client, checkFunc ServiceReadyCheckFunc, checks ...ServiceReadyCheck) TimeoutFunc
WaitUntilServiceReady retry on errors from service
func WaitUntilServiceReadyAPI ¶ added in v0.17.1
func WaitUntilServiceReadyAPI(t *testing.T, c driver.Client, check ServiceReadyCheckFunc) TimeoutFunc
WaitUntilServiceReadyAPI return timeout function which waits until service is fully ready
func (TimeoutFunc) Execute ¶ added in v0.17.1
func (f TimeoutFunc) Execute(timeout, interval time.Duration) error
func (TimeoutFunc) ExecuteT ¶ added in v0.17.1
func (f TimeoutFunc) ExecuteT(t *testing.T, timeout, interval time.Duration)
func (TimeoutFunc) ExecuteTWithLog ¶ added in v0.17.1
func (TimeoutFunc) ExecuteWithLog ¶ added in v0.17.1
func (f TimeoutFunc) ExecuteWithLog(log Logger, timeout, interval time.Duration) (err error)