testhelpers

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TestConfigEnv is the key for an environment variable containing the path to the test
	// configuration file.
	TestConfigEnv = "BLOBSTORE_TEST_CFG"
	// TestSection is the section of the test.cfg ini file where the tests look for configuration
	// values
	TestSection = "BlobstoreTest"
	// TestMinioExe is the key in the config file for the minio executable path.
	TestMinioExe = "test.minio.exe"
	// TestMongoExe is the key in the config file for the mongo executable path.
	TestMongoExe = "test.mongo.exe"
	// TestUseWiredTiger denotes that the MongoDB WiredTiger storage engine should be used.
	TestUseWiredTiger = "test.mongo.wired_tiger"
	// TestAuth2Jar is the key in the config file for the path to the KBase auth2 shadow test jar.
	TestAuth2Jar = "test.auth2jar"
	// TestTempDir is the key in the config file for the temporary directory.
	TestTempDir = "test.temp.dir"
	// TestDeleteTempDir is the key in the config file for whether the temporary directory
	// should be deleted when the tests are complete. Any value other than 'false' is treated
	// as true
	TestDeleteTempDir = "test.delete.temp.dir"
)

Variables

This section is empty.

Functions

func AssertCloseToNow

func AssertCloseToNow(t *testing.T, tme time.Time, dur time.Duration)

AssertCloseToNow asserts that the given time is within the given duration of the present time.

func AssertWithin1MS

func AssertWithin1MS(t *testing.T, tme1 time.Time, tme2 time.Time)

AssertWithin1MS asserts that the given times are within 1ms of each other.

Types

type TestConfig

type TestConfig struct {
	MinioExePath  string
	MongoExePath  string
	UseWiredTiger bool
	Auth2JarPath  string
	TempDir       string
	DeleteTempDir bool
}

TestConfig contains the test configuration.

func GetConfig

func GetConfig() (*TestConfig, error)

GetConfig provides the test configuration. It expects the path to the test config file to be provided in the TestConfigEnv environment variable.

Jump to

Keyboard shortcuts

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