Documentation ¶
Overview ¶
Package testutil contains common util functions to facilitate tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DiffErrString ¶
DiffErrString returns an empty diff string if the 'got' error message contains the 'want' string. Otherwise returns a diff string.
func FakeGRPCServer ¶
func FakeGRPCServer(tb testing.TB, registerFunc RegisterFunc) (string, *grpc.ClientConn)
FakeGRPCServer creates and registers a fake grpc server for testing. It returns the bound address and a connected client. It ensures the server is stopped when tests finish. It returns an error if the connection does not establish.
func IsIntegration ¶ added in v0.1.2
IsIntegration checks env var TEST_INTEGRATION and consider that we're in an integration test if it's set to true.
func SkipIfNotIntegration ¶ added in v0.1.2
SkipIfNotIntegration skips the test if IsIntegration returns false.
Types ¶
type RegisterFunc ¶
RegisterFunc is the callback to register a fake gRPC service to the given server.