tests

package
v2.15.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2021 License: Apache-2.0 Imports: 26 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 GetTestMongoDBDSN

func GetTestMongoDBDSN(tb testing.TB) string

GetTestMongoDBDSN returns DNS for MongoDB test database.

func GetTestMongoDBWithSSLDSN

func GetTestMongoDBWithSSLDSN(tb testing.TB, pathToRoot string) (string, *agentpb.TextFiles)

GetTestMongoDBWithSSLDSN returns DNS template and files for MongoDB test database with ssl.

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 MongoDBVersion

func MongoDBVersion(t testing.TB, client *mongo.Client) string

MongoDBVersion returns Mongo DB version.

func OpenTestMongoDB

func OpenTestMongoDB(tb testing.TB, dsn string) *mongo.Client

OpenTestMongoDB opens connection to MongoDB test database.

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