spantest

package
v0.19.1 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2021 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasDocker

func HasDocker() bool

HasDocker returns true if Docker is available on the local host.

Types

type EmulatorDockerFixture

type EmulatorDockerFixture struct {
	Ctx                 context.Context
	Conn                *grpc.ClientConn
	InstanceAdminClient *instance.InstanceAdminClient
	DatabaseAdminClient *database.DatabaseAdminClient
	EmulatorHost        string
	ProjectID           string
	InstanceID          string
}

EmulatorDockerFixture is a test fixture running the Spanner emulator.

func NewEmulatorDockerFixture

func NewEmulatorDockerFixture(t *testing.T) *EmulatorDockerFixture

NewEmulatorDockerFixture creates a test fixture for a containerized Spanner emulator.

func (*EmulatorDockerFixture) NewDatabaseFromDDLFiles

func (fx *EmulatorDockerFixture) NewDatabaseFromDDLFiles(t *testing.T, glob string) *spanner.Client

NewDatabaseFromDDLFiles creates a new database with a random ID from the provided DDL file path glob.

func (*EmulatorDockerFixture) NewDatabaseFromStatements

func (fx *EmulatorDockerFixture) NewDatabaseFromStatements(t *testing.T, statements []string) *spanner.Client

NewDatabaseFromDDLFiles creates a new database with a random ID from the provided statements.

Jump to

Keyboard shortcuts

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