test

package
v1.1.0-beta Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assert

func Assert(t *testing.T, cond bool, param ...interface{})

Assert fails the test if cond is false, logs file, line, func of the failure location

func CheckFail

func CheckFail(err error, t Failer)

CheckFail fails the test if error is set, logs file, line, func of the failure location

func ExecSQL

func ExecSQL(db *sql.DB, t Failer, query string, param ...interface{})

ExecSQL executes SQL and logs on error.

func LoadConfig

func LoadConfig() *config.AppConfig

LoadConfig loads config for testing environment

func MySQLAvailable

func MySQLAvailable() bool

MySQLAvailable test if local MySQL instance is running

func SkipIfNoKafkaAvailable

func SkipIfNoKafkaAvailable(t Failer)

SkipIfNoKafkaAvailable tries to connect to local Kafka and if fails, then skip the test

func SkipIfNoMySQLAvailable

func SkipIfNoMySQLAvailable(t Failer)

SkipIfNoMySQLAvailable tries to connect to local MySQL and if fails, then skip the test

func WaitForNumProc

func WaitForNumProc(n int32, timeout time.Duration) bool

WaitForNumProc waits when number of running procs registered in shutdown framework becomes less or equal to the given number Returns false if the timeout expires and number of procs still above the limit

func WaitForNumProcGreater

func WaitForNumProcGreater(n int32, timeout time.Duration) bool

WaitForNumProcGreater opposite to WaitForNumProc

Types

type Failer

type Failer interface {
	FailNow()
	Skip(...interface{})
}

Failer introduced to allow both testing.T and testing.B in CheckFail call

Jump to

Keyboard shortcuts

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