helpers

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2019 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FixtureGoldenFileName

func FixtureGoldenFileName(t *testing.T, name string) string

FixtureGoldenFileName returns the golden file name on fixtures path

func GetFreePort

func GetFreePort(t testing.TB) int

GetFreePort returns a free port

func GetMapKeys

func GetMapKeys(t *testing.T, m interface{}) []string

GetMapKeys returns a string slice with the map keys

func GetTestEtcd

func GetTestEtcd(t *testing.T) (*integration.ClusterV3, *clientv3.Client)

GetTestEtcd gets a test in memory etcd server

func GetTestNatsServer

func GetTestNatsServer(t *testing.T) *server.Server

GetTestNatsServer gets a test nats server

func ReadFile

func ReadFile(t *testing.T, filepath string) []byte

ReadFile test helper

func ShouldAlwaysReturn

func ShouldAlwaysReturn(t testing.TB, f interface{}, v interface{}, timeouts ...time.Duration)

ShouldAlwaysReturn asserts that the return of f should always be v, timeouts: 0 - evaluation interval, 1 - timeout

func ShouldEventuallyReceive

func ShouldEventuallyReceive(t testing.TB, c interface{}, timeouts ...time.Duration) interface{}

ShouldEventuallyReceive should asserts that eventually channel c receives a value

func ShouldEventuallyReturn

func ShouldEventuallyReturn(t testing.TB, f interface{}, v interface{}, timeouts ...time.Duration)

ShouldEventuallyReturn asserts that eventually the return of f should be v, timeouts: 0 - evaluation interval, 1 - timeout

func StartProcess

func StartProcess(t testing.TB, program string, args ...string) *exec.Cmd

StartProcess starts a process

func StartServer

func StartServer(t testing.TB, frontend bool, debug bool, svType string, port int, sdPrefix string, grpc bool) func()

StartServer starts a server

func WriteFile

func WriteFile(t *testing.T, filepath string, bytes []byte)

WriteFile test helper

Types

This section is empty.

Jump to

Keyboard shortcuts

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