package testutil
import "go.mongodb.org/mongo-driver/internal/testutil"
Index ¶
- func AddOptionsToURI(uri string, opts ...string) string
- func AddTLSConfigToURI(uri string) string
- func AutoCreateIndexes(t *testing.T, keys []string)
- func AutoDropCollection(t *testing.T)
- func AutoInsertDocs(t *testing.T, writeConcern *writeconcern.WriteConcern, docs ...*bson.Document)
- func ColName(t *testing.T) string
- func ConnString(t *testing.T) connstring.ConnString
- func DBName(t *testing.T) string
- func DisableMaxTimeFailPoint(t *testing.T, s *topology.Server)
- func DropCollection(t *testing.T, dbname, colname string)
- func EnableMaxTimeFailPoint(t *testing.T, s *topology.Server) error
- func InsertDocs(t *testing.T, dbname, colname string, writeConcern *writeconcern.WriteConcern, docs ...*bson.Document)
- func Integration(t *testing.T)
- func Topology(t *testing.T) *topology.Topology
Functions ¶
func AddOptionsToURI ¶
AddOptionsToURI appends connection string options to a URI.
func AddTLSConfigToURI ¶
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 AutoCreateIndexes ¶
AutoCreateIndexes creates an index in the test cluster.
func AutoDropCollection ¶
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 ColName ¶
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 ¶
DBName gets the globally configured database name.
func DisableMaxTimeFailPoint ¶
DisableMaxTimeFailPoint turns off the max time fail point in the test cluster.
func DropCollection ¶
DropCollection drops the collection in the test cluster.
func EnableMaxTimeFailPoint ¶
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 ¶
Integration should be called at the beginning of integration tests to ensure that they are skipped if integration testing is turned off.
func Topology ¶
Topology gets the globally configured topology.
Source Files ¶
config.go ops.go
Directories ¶
Path | Synopsis |
---|---|
internal/testutil/helpers |
- Version
- v0.0.6
- Published
- May 31, 2018
- Platform
- js/wasm
- Imports
- 16 packages
- Last checked
- 33 seconds ago –
Tools for package owners.