testutil

package
v0.15.7 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package testutil contains helper functions for unit tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertProtoJSONEqual added in v0.9.0

func AssertProtoJSONEqual(t *testing.T, expected string, protoMsg interface{}, msgAndArgs ...interface{}) bool

AssertProtoJSONEqual asserts that a protobuf message matches the given JSON. The protoMsg can also be a slice of protobuf messages.

func ModRoot added in v0.14.0

func ModRoot() string

ModRoot returns the directory containing the go.mod file.

func RedisTLSConfig added in v0.14.0

func RedisTLSConfig() *tls.Config

RedisTLSConfig returns the TLS Config to use with redis.

func TestDataRoot added in v0.14.0

func TestDataRoot() string

TestDataRoot returns the testdata directory.

func WithTestRedis added in v0.14.0

func WithTestRedis(useTLS bool, handler func(rawURL string) error) error

WithTestRedis creates a test a test redis instance using docker.

func WithTestRedisCluster added in v0.14.0

func WithTestRedisCluster(handler func(rawURL string) error) error

WithTestRedisCluster creates a new redis cluster 3 node cluster.

func WithTestRedisSentinel added in v0.14.0

func WithTestRedisSentinel(handler func(rawURL string) error) error

WithTestRedisSentinel creates a new redis sentinel 3 node cluster.

Types

This section is empty.

Jump to

Keyboard shortcuts

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