Documentation ¶
Overview ¶
Package testutil implements functions for filtering and configuring tests.
Index ¶
- Variables
- func CompareFCV(x, y string) (int, error)
- func GetAuthArgs() []string
- func GetAuthOptions() options.Auth
- func GetBareArgs() []string
- func GetBareSession() (*mongo.Client, error)
- func GetBareSessionProvider() (*db.SessionProvider, *options.ToolOptions, error)
- func GetFCV(s *mongo.Client) string
- func GetSSLArgs() []string
- func GetSSLOptions() commonOpts.SSL
- func MakeTempDir(t *testing.T) (string, func())
- func MergeOplogStreams(input [][]db.Oplog) []db.Oplog
Constants ¶
This section is empty.
Variables ¶
var ( UserAdmin = "uAdmin" UserAdminPassword = "password" CreatedUserNameEnv = "TOOLS_TESTING_AUTH_USERNAME" CreatedUserPasswordEnv = "TOOLS_TESTING_AUTH_PASSWORD" )
Functions ¶
func CompareFCV ¶
CompareFCV compares two strings as dot-delimited tuples of integers.
func GetAuthArgs ¶
func GetAuthArgs() []string
func GetAuthOptions ¶
func GetBareArgs ¶
func GetBareArgs() []string
func GetBareSession ¶
GetBareSession returns an mgo.Session from the environment or from a default host and port.
func GetBareSessionProvider ¶
func GetBareSessionProvider() (*db.SessionProvider, *options.ToolOptions, error)
GetBareSessionProvider returns a session provider from the environment or from a default host and port.
func GetFCV ¶
GetFCV returns the featureCompatibilityVersion string for an mgo Session or the empty string if it can't be found.
func GetSSLArgs ¶
func GetSSLArgs() []string
func GetSSLOptions ¶
func GetSSLOptions() commonOpts.SSL
func MakeTempDir ¶
MakeTempDir will attempt to create a temp directory. If it fails it will abort the test. It returns two values. The first is the string containing the path to the temp directory. The second is a cleanup func that will remove the temp directory. You should always call the cleanup func with `defer` immedatiately after calling this function:
dir, cleanup := testutil.MakeTempDir(t) defer cleanup()
If the `TOOLS_TESTING_NO_CLEANUP` env var is not empty, then the cleanup function will not delete the directory. This can be useful when investigating test failures.
Types ¶
This section is empty.