apptest

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package apptest allows testing of binded services within memory.

Index

Constants

View Source
const ServiceName = "test"

ServiceName is a constant used for all in memory tests.

Variables

This section is empty.

Functions

func GRPCClient

func GRPCClient(t *testing.T, cfg config.View, service string) *grpc.ClientConn

GRPCClient creates a new client which connects to the specified service. It immediately fails the test if there is an error, and will also automatically close after the test completes.

func RunInCluster

func RunInCluster(binds ...appmain.Bind) (func() error, error)

RunInCluster allows for running services during an in cluster e2e test. This is NOT for running the actual code under test, but instead allow running auxiliary services the code under test might call.

func TestApp

func TestApp(t *testing.T, cfg config.View, listeners []net.Listener, binds ...appmain.Bind)

TestApp starts an application for testing. It will automatically stop after the test completes, and immediately fail the test if there is an error starting. The caller must provide the listers to use for the app, this way the listeners can use a random port, and set the proper values on the config.

Types

This section is empty.

Jump to

Keyboard shortcuts

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