Documentation
¶
Overview ¶
Package tester is a generic testing package with helpful methods for all packages
Index ¶
- Variables
- func CreatePostgresServer(port uint32) (*embeddedPostgres.EmbeddedPostgres, error)
- func GetNewRelicApp(appName string) (*newrelic.Application, error)
- func GetNewRelicCtx(t *testing.T, appName, txnName string) context.Context
- func LoadMockRedis(idleTimeout time.Duration, maxConnTime time.Duration, maxActive int, ...) (client *cache.Client, conn *redigomock.Conn)
- func LoadRealRedis(connectionURL string, idleTimeout time.Duration, maxConnTime time.Duration, ...) (client *cache.Client, conn redis.Conn, err error)
- func PaymailMockClient(domainNames []string) (paymail.ClientInterface, error)
- func RandomTablePrefix() string
- func SQLiteTestConfig(debug, shared bool) *datastore.SQLiteConfig
- type AnyGUID
- type AnyTime
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrAppNameRequired = spverrors.Newf("app name is required")
ErrAppNameRequired is when the app name is required
View Source
var ErrFailedLoadingPostgresql = spverrors.Newf("failed loading postgresql server")
ErrFailedLoadingPostgresql is when loading postgresql failed
Functions ¶
func CreatePostgresServer ¶
func CreatePostgresServer(port uint32) (*embeddedPostgres.EmbeddedPostgres, error)
CreatePostgresServer will create a new Postgresql server
func GetNewRelicApp ¶
func GetNewRelicApp(appName string) (*newrelic.Application, error)
GetNewRelicApp will return a dummy new relic app
func GetNewRelicCtx ¶
GetNewRelicCtx will return a dummy ctx
func LoadMockRedis ¶
func LoadMockRedis( idleTimeout time.Duration, maxConnTime time.Duration, maxActive int, maxIdle int, ) (client *cache.Client, conn *redigomock.Conn)
LoadMockRedis will load a mocked redis connection
func LoadRealRedis ¶
func LoadRealRedis( connectionURL string, idleTimeout time.Duration, maxConnTime time.Duration, maxActive int, maxIdle int, dependency bool, newRelic bool, ) (client *cache.Client, conn redis.Conn, err error)
LoadRealRedis will load a real redis connection
func PaymailMockClient ¶
PaymailMockClient will return a client for testing purposes
func RandomTablePrefix ¶
func RandomTablePrefix() string
RandomTablePrefix will make a random prefix (avoid same tables for parallel tests)
func SQLiteTestConfig ¶
func SQLiteTestConfig(debug, shared bool) *datastore.SQLiteConfig
SQLiteTestConfig will return a test-version of SQLite
Types ¶
Click to show internal directories.
Click to hide internal directories.