Documentation ¶
Overview ¶
Package tests contains auxiliary functions for testing.
Index ¶
- Variables
- func AssertEqualSet(t *testing.T, expected []interface{}, actual []interface{})
- func CreateTestCollection(s *mgo.Session) *mgo.Collection
- func DropTestCollection(c *mgo.Collection)
- func GetBenchmarkCol() *mgo.Collection
- func HasMongoDBDecimalSupport() bool
- func HasMongoDBSampleStageSupport() bool
- func IsMongoDBVersionOld() bool
- func SetupTestCol() *mgo.Collection
- func SkipBIfNotSupportAggregationAlgorithm(b *testing.B)
- func SkipTIfNotSupportAggregationAlgorithm(t *testing.T)
- func TearDownTestCol(c *mgo.Collection)
Constants ¶
This section is empty.
Variables ¶
var BenchmarkCol = os.Getenv("BENCHMARK_COL")
BenchmarkCol - name of benchmark collection
var BenchmarkDb = os.Getenv("BENCHMARK_DB")
BenchmarkDb - name of benchmark database
var BenchmarkDbSession *mgo.Session
BenchmarkDbSession - connection to benchmark database
var BenchmarkDbUri = os.Getenv("BENCHMARK_MONGO_URI")
BenchmarkDbUri - URI of benchmark database
var TestDbInfo mgo.BuildInfo
TestDbInfo - server info of test database
var TestDbSession *mgo.Session
TestDbSession - connection to test database
var TestDbUri = os.Getenv("TEST_MONGO_URI")
TestDbUri - URI of test database
Functions ¶
func AssertEqualSet ¶
AssertEqualSet is helper function that compare two slices regardless of order.
func CreateTestCollection ¶
func CreateTestCollection(s *mgo.Session) *mgo.Collection
CreateTestCollection creates test collection with random name.
func DropTestCollection ¶
func DropTestCollection(c *mgo.Collection)
DropTestCollection drops test collection.
func GetBenchmarkCol ¶
func GetBenchmarkCol() *mgo.Collection
GetBenchmarkCol gets collection for benchmarks.
func HasMongoDBDecimalSupport ¶
func HasMongoDBDecimalSupport() bool
HasMongoDBDecimalSupport returns true if MongoDB support decimal type.
func HasMongoDBSampleStageSupport ¶
func HasMongoDBSampleStageSupport() bool
HasMongoDBSampleStageSupport returns true if MongoDB support $sample aggregation.
func IsMongoDBVersionOld ¶
func IsMongoDBVersionOld() bool
IsMongoDBVersionOld return true if MongoDB version don't support all features.
func SetupTestCol ¶
func SetupTestCol() *mgo.Collection
SetupTestCol creates test collection with random name.
func SkipBIfNotSupportAggregationAlgorithm ¶
SkipBIfNotSupportAggregationAlgorithm skip benchmark if MongoDB version don't support all features.
func SkipTIfNotSupportAggregationAlgorithm ¶
SkipTIfNotSupportAggregationAlgorithm skip test if MongoDB version don't support all features.
func TearDownTestCol ¶
func TearDownTestCol(c *mgo.Collection)
TearDownTestCol drops test collection.
Types ¶
This section is empty.