MCPcopy Create free account
hub / github.com/couchbase/sync_gateway / SetupTestDBForBucketWithOptions

Function SetupTestDBForBucketWithOptions

db/util_testing.go:586–592  ·  view source on GitHub ↗

SetupTestDBForBucketWithOptions sets up a test database with the specified database context options. Note that environment variables will override values (SG_TEST_USE_XATTRS, SG_TEST_USE_DEFAULT_COLLECTION).

(t testing.TB, tBucket base.Bucket, dbcOptions DatabaseContextOptions)

Source from the content-addressed store, hash-verified

584
585// SetupTestDBForBucketWithOptions sets up a test database with the specified database context options. Note that environment variables will override values (SG_TEST_USE_XATTRS, SG_TEST_USE_DEFAULT_COLLECTION).
586func SetupTestDBForBucketWithOptions(t testing.TB, tBucket base.Bucket, dbcOptions DatabaseContextOptions) (*Database, context.Context) {
587 AddOptionsFromEnvironmentVariables(&dbcOptions)
588 if dbcOptions.Scopes == nil {
589 dbcOptions.Scopes = GetScopesOptions(t, tBucket, 1)
590 }
591 return CreateTestDatabase(t, tBucket, dbcOptions)
592}
593
594// CreateTestDatabase creates a DatabaseContext and makes it online. Returns a context suitable for use with the database which has information sufficient for audit logging.
595func CreateTestDatabase(t testing.TB, tBucket base.Bucket, dbcOptions DatabaseContextOptions) (*Database, context.Context) {

Calls 3

GetScopesOptionsFunction · 0.85
CreateTestDatabaseFunction · 0.85