jtesting

package
v0.0.0-...-a92fb97 Latest Latest
Warning

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

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

Documentation

Overview

Package jtesting contains test helpers for JSSO. (It's called jtesting so you don't have to alias an import.)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(t *testing.T, name string, r R, f func(t *testing.T, e *E))

Run runs the provided test function as a subtest with the desired Extras available.

Types

type Config

type Config struct {
	SuperuserDSN string // The DSN to use to create databases.
}

Config contains test-specific configuration.

type E

type E struct {
	Context    context.Context
	Logger     *zap.Logger
	Config     *Config
	DSN        string
	DB         *sql.DB
	ClientConn *grpc.ClientConn
}

E holds per-test "extras".

type R

type R struct {
	Timeout           time.Duration
	Logger            bool
	Database          bool
	DatabaseReady     func(t *testing.T, e *E)
	GRPC              func(t *testing.T, e *E, s *grpc.Server)
	GRPCOptions       func(e *E) []grpc.ServerOption
	GRPCClientOptions func(e *E) []grpc.DialOption
}

R requests specific extras during a test run.

Jump to

Keyboard shortcuts

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