testutils

package
v0.0.0-...-b45d6de Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExecuteUntil

func ExecuteUntil(ctx context.Context, t *testing.T, f func())

func ExecuteWithTimeout

func ExecuteWithTimeout(t *testing.T, timeout time.Duration, f func())

func KeysFromGetResponse

func KeysFromGetResponse(resp *clientv3.GetResponse) (kvs []string)

func MustAbsPath

func MustAbsPath(path string) string

func MustClient

func MustClient(c intf.Client, err error) intf.Client

Types

type KV

type KV struct {
	Key, Val string
}

func KeyValuesFromGetResponse

func KeyValuesFromGetResponse(resp *clientv3.GetResponse) (kvs []KV)

func KeyValuesFromWatchChan

func KeyValuesFromWatchChan(wch clientv3.WatchChan, wantedLen int, timeout time.Duration) (kvs []KV, err error)

func KeyValuesFromWatchResponse

func KeyValuesFromWatchResponse(resp clientv3.WatchResponse) (kvs []KV)

type LogObserver

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

func NewLogObserver

func NewLogObserver(level zapcore.LevelEnabler) (zapcore.Core, *LogObserver)

func (*LogObserver) Expect

func (logOb *LogObserver) Expect(ctx context.Context, s string, count int) ([]string, error)

Expect returns the first N lines containing the given string.

func (*LogObserver) ExpectFunc

func (logOb *LogObserver) ExpectFunc(ctx context.Context, filter func(string) bool, count int) ([]string, error)

ExpectFunc returns the first N line satisfying the function f.

Jump to

Keyboard shortcuts

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