test

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: Unlicense Imports: 5 Imported by: 0

Documentation

Overview

Package test provides library functions for testing the MicroDB system.

Package test provides library functions for testing MicroDB system.

Package test provides library functions for testing the MicroDB system.

Index

Constants

This section is empty.

Variables

View Source
var (

	// TestTableName represents the table name for the test table.
	TestTableName = tableNameTest
	// TestSchemaOption represents option used for creating a test table origin.
	TestSchemaOption = microdb.WithSchemaStrings(
		tableNameTest,
		microdb.DataOriginTypeMySQL,
		testOGTableQuery,
		testLocalTableQuery,
		testInsertQuery,
	)
)

nolint // Allow globals for easy use.

Functions

func UUID

func UUID() string

UUID generates a unique UUID for the duration of a test.

Types

type Container

type Container interface {
	GetPort(id string) string
	Purge() error
}

Container represents a container resource.

func NATS

func NATS(pool *dockertest.Pool, network *dockertest.Network, clusterID string) (Container, error)

NATS starts a NATS Streaming Server cluster in docker containers.

func Publisher

func Publisher(
	pool *dockertest.Pool,
	network *dockertest.Network,
	natsHost, natsPort, natsClusterID, natsClientID,
	mysqlHost, mysqlPort, mysqlUser, mysqlPassword, mysqlDatabase, mysqlTable string) (Container, error)

Publisher starts a publisher in docker container. nolint // Allow duplicate statements with querier.

func Querier

func Querier(
	pool *dockertest.Pool,
	network *dockertest.Network,
	natsHost, natsPort, natsClusterID, natsClientID,
	mysqlHost, mysqlPort, mysqlUser, mysqlPassword, mysqlDatabase, mysqlTable string) (Container, error)

Querier starts a querier in docker container. nolint // Allow duplicate statements with publisher.

func TestDB

func TestDB(pool *dockertest.Pool, network *dockertest.Network, password, database string) (Container, error)

TestDB creates a MySQL data origin for testing. Initialized with test.sql. nolint // This method name is fine.

Jump to

Keyboard shortcuts

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