package testutil

import "go.mongodb.org/mongo-driver/mongo/internal/testutil"

Index

Functions

func AddTLSConfigToURI

func AddTLSConfigToURI(uri string) string

AddTLSConfigToURI checks for the environmental variable indicating that the tests are being run on an SSL-enabled server, and if so, returns a new URI with the necessary configuration.

func AutoCreateIndex

func AutoCreateIndex(t *testing.T, keys []string)

AutoCreateIndex creates an index in the test cluster.

func AutoDropCollection

func AutoDropCollection(t *testing.T)

AutoDropCollection drops the collection in the test cluster.

func AutoInsertDocs

func AutoInsertDocs(t *testing.T, writeConcern *writeconcern.WriteConcern, docs ...*bson.Document)

AutoInsertDocs inserts the docs into the test cluster.

func Cluster

func Cluster(t *testing.T) *cluster.Cluster

Cluster gets the globally configured cluster.

func ColName

func ColName(t *testing.T) string

ColName gets a collection name that should be unique to the currently executing test.

func ConnString

func ConnString(t *testing.T) connstring.ConnString

ConnString gets the globally configured connection string.

func DBName

func DBName(t *testing.T) string

DBName gets the globally configured database name.

func DisableMaxTimeFailPoint

func DisableMaxTimeFailPoint(t *testing.T, s cluster.Server)

DisableMaxTimeFailPoint turns off the max time fail point in the test cluster.

func DropCollection

func DropCollection(t *testing.T, dbname, colname string)

DropCollection drops the collection in the test cluster.

func EnableMaxTimeFailPoint

func EnableMaxTimeFailPoint(t *testing.T, s cluster.Server) error

EnableMaxTimeFailPoint turns on the max time fail point in the test cluster.

func InsertDocs

func InsertDocs(t *testing.T, dbname, colname string, writeConcern *writeconcern.WriteConcern, docs ...*bson.Document)

InsertDocs inserts the docs into the test cluster.

func Integration

func Integration(t *testing.T)

Integration should be called at the beginning of integration tests to ensure that they are skipped if integration testing is turned off.

Source Files

config.go ops.go

Directories

PathSynopsis
mongo/internal/testutil/helpers
Version
v0.0.2
Published
Mar 6, 2018
Platform
darwin/amd64
Imports
16 packages
Last checked
7 minutes ago

Tools for package owners.