spantest

package
v0.58.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: MIT Imports: 25 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.

func IsDockerDaemonRunning added in v0.26.0

func IsDockerDaemonRunning() bool

IsDockerDaemonRunning reports if the Docker daemon is running.

Types

type EmulatorFixture added in v0.26.0

type EmulatorFixture struct {
	// contains filtered or unexported fields
}

EmulatorFixture is a test fixture running the Spanner emulator.

func (*EmulatorFixture) Context added in v0.26.0

func (fx *EmulatorFixture) Context() context.Context

func (*EmulatorFixture) NewDatabaseFromDDLFiles added in v0.26.0

func (fx *EmulatorFixture) NewDatabaseFromDDLFiles(t testing.TB, globs ...string) *spanner.Client

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

func (*EmulatorFixture) NewDatabaseFromStatements added in v0.26.0

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

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

type Fixture added in v0.26.0

type Fixture interface {
	// NewDatabaseFromDLLFiles creates a new database and applies the DDL files from the provided glob.
	NewDatabaseFromDDLFiles(t testing.TB, globs ...string) *spanner.Client
	// NewDatabaseFromStatements creates a new database and applies the provided DLL statements.
	NewDatabaseFromStatements(t testing.TB, statements []string) *spanner.Client
}

Fixture is a Spanner test fixture.

func NewEmulatorFixture added in v0.26.0

func NewEmulatorFixture(t testing.TB) Fixture

NewEmulatorFixture creates a test fixture for a containerized Spanner emulator.

func NewInMemoryFixture added in v0.26.0

func NewInMemoryFixture(t testing.TB) Fixture

NewInMemoryFixture creates a test fixture for the in-memory Spanner emulator.

type InMemoryFixture added in v0.26.0

type InMemoryFixture struct {
	// contains filtered or unexported fields
}

InMemoryFixture is a test fixture running the Spanner emulator.

func (*InMemoryFixture) NewDatabaseFromDDLFiles added in v0.26.0

func (fx *InMemoryFixture) NewDatabaseFromDDLFiles(t testing.TB, globs ...string) *spanner.Client

NewDatabaseFromDDLFiles implements Fixture.

func (*InMemoryFixture) NewDatabaseFromStatements added in v0.26.0

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

NewDatabaseFromDDLFiles implements Fixture.

Jump to

Keyboard shortcuts

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