Documentation ¶
Index ¶
- func AddCompressorToUri(uri string) string
- 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 ...bsonx.Doc)
- func ColName(t *testing.T) string
- func CompareVersions(t *testing.T, v1 string, v2 string) int
- 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 GetConnString() (connstring.ConnString, error)
- func GetDBName(cs connstring.ConnString) string
- func GlobalMonitoredTopology(t *testing.T, monitor *event.CommandMonitor) *topology.Topology
- func InsertDocs(t *testing.T, dbname, colname string, writeConcern *writeconcern.WriteConcern, ...)
- func Integration(t *testing.T)
- func MonitoredTopology(t *testing.T, dbName string, monitor *event.CommandMonitor) *topology.Topology
- func RunCommand(t *testing.T, s *topology.Server, db string, b bsonx.Doc) (bson.Raw, error)
- func Topology(t *testing.T) *topology.Topology
- func TopologyWithConnString(t *testing.T, cs connstring.ConnString) *topology.Topology
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddCompressorToUri ¶ added in v0.3.0
AddCompressorToUri checks for the environment variable indicating that the tests are being run with compression enabled. If so, it returns a new URI with the necessary configuration
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 ...bsonx.Doc)
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 CompareVersions ¶ added in v1.0.0
compareVersions compares two version number strings (i.e. positive integers separated by periods). Comparisons are done to the lesser precision of the two versions. For example, 3.2 is considered equal to 3.2.11, whereas 3.2.0 is considered less than 3.2.11.
Returns a positive int if version1 is greater than version2, a negative int if version1 is less than version2, and 0 if version1 is equal to version2.
func ConnString ¶
func ConnString(t *testing.T) connstring.ConnString
ConnString gets the globally configured connection string.
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 GetConnString ¶ added in v0.3.0
func GetConnString() (connstring.ConnString, error)
func GetDBName ¶ added in v0.3.0
func GetDBName(cs connstring.ConnString) string
func GlobalMonitoredTopology ¶ added in v0.3.0
GlobalMonitoredTopology gets the globally configured topology and attaches a command monitor.
func InsertDocs ¶
func InsertDocs(t *testing.T, dbname, colname string, writeConcern *writeconcern.WriteConcern, docs ...bsonx.Doc)
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 MonitoredTopology ¶ added in v0.3.0
func MonitoredTopology(t *testing.T, dbName string, monitor *event.CommandMonitor) *topology.Topology
MonitoredTopology returns a new topology with the command monitor attached
func RunCommand ¶ added in v0.3.0
RunCommand runs an arbitrary command on a given database of target server
func TopologyWithConnString ¶ added in v0.3.0
func TopologyWithConnString(t *testing.T, cs connstring.ConnString) *topology.Topology
TopologyWithConnString takes a connection string and returns a connected topology, or else bails out of testing
Types ¶
This section is empty.