createCollections will create a set of test collections on the bucket, if enabled...
(ctx context.Context, bucket Bucket)
| 585 | |
| 586 | // createCollections will create a set of test collections on the bucket, if enabled... |
| 587 | func (tbp *TestBucketPool) createCollections(ctx context.Context, bucket Bucket) { |
| 588 | // If we're able to use collections, the test bucket pool will also create N collections per bucket - rather than just getting the default collection ready. |
| 589 | if tbp.skipCollections { |
| 590 | return |
| 591 | } |
| 592 | |
| 593 | dynamicDataStore, ok := bucket.(sgbucket.DynamicDataStoreBucket) |
| 594 | if !ok { |
| 595 | tbp.Fatalf(ctx, "Bucket doesn't support dynamic collection creation %T", bucket) |
| 596 | } |
| 597 | |
| 598 | for i := 0; i < tbp.NumCollectionsPerBucket(); i++ { |
| 599 | scopeName := tbp.testScopeName() |
| 600 | collectionName := fmt.Sprintf("%s%d", tbpCollectionPrefix, i) |
| 601 | ctx := KeyspaceLogCtx(ctx, bucket.GetName(), scopeName, collectionName) |
| 602 | |
| 603 | tbp.Logf(ctx, "Creating new collection: %s.%s", scopeName, collectionName) |
| 604 | dataStoreName := ScopeAndCollectionName{Scope: scopeName, Collection: collectionName} |
| 605 | err := dynamicDataStore.CreateDataStore(ctx, dataStoreName) |
| 606 | if err != nil { |
| 607 | tbp.Fatalf(ctx, "Couldn't create datastore %v.%v: %v", scopeName, collectionName, err) |
| 608 | } |
| 609 | } |
| 610 | } |
| 611 | |
| 612 | // createTestBuckets creates a new set of integration test buckets and pushes them into the readier queue. |
| 613 | func (tbp *TestBucketPool) createTestBuckets(ctx context.Context, numBuckets, bucketQuotaMB int, bucketInitFunc TBPBucketInitFunc, parallelBucketInit bool) { |
no test coverage detected