tests

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2019 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertBucketsEqual

func AssertBucketsEqual(t *testing.T, expected, actual *agentpb.MetricsBucket) bool

AssertBucketsEqual asserts that two MetricsBuckets are equal while providing a good diff.

func FormatBuckets

func FormatBuckets(mb []*agentpb.MetricsBucket) string

FormatBuckets formats MetricsBuckets to string for tests.

func GetTestMySQLDSN

func GetTestMySQLDSN(tb testing.TB) string

GetTestMySQLDSN returns DNS for MySQL test database.

func GetTestPostgreSQLDSN

func GetTestPostgreSQLDSN(tb testing.TB) string

GetTestPostgreSQLDSN returns DNS for PostgreSQL test database.

func LogTable

func LogTable(t *testing.T, structs []reform.Struct)

func OpenTestMySQL

func OpenTestMySQL(tb testing.TB) *sql.DB

OpenTestMySQL opens connection to MySQL test database.

func OpenTestPostgreSQL

func OpenTestPostgreSQL(tb testing.TB) *sql.DB

OpenTestPostgreSQL opens connection to PostgreSQL test database.

func PostgreSQLVersion

func PostgreSQLVersion(tb testing.TB, db *sql.DB) string

PostgreSQLVersion returns major PostgreSQL version (e.g. "9.6", "10", etc.).

Types

type MySQLVendor

type MySQLVendor string

MySQLVendor represents MySQL vendor (Oracle, Percona).

const (
	OracleMySQL  MySQLVendor = "oracle"
	PerconaMySQL MySQLVendor = "percona"
	MariaDBMySQL MySQLVendor = "mariadb"
)

MySQL vendors.

func MySQLVersion

func MySQLVersion(tb testing.TB, db *sql.DB) (string, MySQLVendor)

MySQLVersion returns MAJOR.MINOR MySQL version (e.g. "5.6", "8.0", etc.) and vendor.

Jump to

Keyboard shortcuts

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