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)
| 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). |
| 586 | func 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. |
| 595 | func CreateTestDatabase(t testing.TB, tBucket base.Bucket, dbcOptions DatabaseContextOptions) (*Database, context.Context) { |