integtest

package
v1.16.1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCompressorToURI

func AddCompressorToURI(uri string) string

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

func AddOptionsToURI(uri string, opts ...string) string

AddOptionsToURI appends connection string options to a URI.

func AddServerlessAuthCredentials

func AddServerlessAuthCredentials(uri string) (string, error)

AddServerlessAuthCredentials will attempt to construct the serverless auth credentials for a URI.

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 AddTestServerAPIVersion

func AddTestServerAPIVersion(opts *options.ClientOptions)

AddTestServerAPIVersion adds the latest server API version in a ServerAPIOptions to passed-in opts.

func ColName

func ColName(t *testing.T) string

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

func CompareVersions

func CompareVersions(t *testing.T, v1 string, v2 string) int

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 DBName

func DBName(t *testing.T) string

DBName gets the globally configured database name.

func GetConnString

func GetConnString() (*connstring.ConnString, error)

func GetDBName

func GetDBName(cs *connstring.ConnString) string

func MongoDBURI

func MongoDBURI() (string, error)

MongoDBURI will construct the MongoDB URI from the MONGODB_URI environment variable for testing. The default host is "localhost" and the default port is "27017"

func MonitoredTopology

func MonitoredTopology(t *testing.T, dbName string, monitor *event.CommandMonitor) *topology.Topology

MonitoredTopology returns a new topology with the command monitor attached

func Topology

func Topology(t *testing.T) *topology.Topology

Topology gets the globally configured topology.

func TopologyWithCredential

func TopologyWithCredential(t *testing.T, credential options.Credential) *topology.Topology

TopologyWithCredential takes an "options.Credential" object and returns a connected topology.

Types

This section is empty.

Jump to

Keyboard shortcuts

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