Merge pull request #2154 from dmcgowan/shared-content-ingests

content: shared content across namespaces
This commit is contained in:
Stephen Day
2018-03-12 16:11:32 -07:00
committed by GitHub
11 changed files with 577 additions and 88 deletions

View File

@@ -19,7 +19,9 @@ package metadata
import (
"bytes"
"context"
"fmt"
"path/filepath"
"sync/atomic"
"testing"
"github.com/boltdb/bolt"
@@ -45,6 +47,16 @@ func createContentStore(ctx context.Context, root string) (context.Context, cont
return nil, nil, nil, err
}
var (
count uint64
name = testsuite.Name(ctx)
)
wrap := func(ctx context.Context) (context.Context, func() error, error) {
n := atomic.AddUint64(&count, 1)
return namespaces.WithNamespace(ctx, fmt.Sprintf("%s-n%d", name, n)), func() error { return nil }, nil
}
ctx = testsuite.SetContextWrapper(ctx, wrap)
return ctx, NewDB(db, cs, nil).ContentStore(), func() error {
return db.Close()
}, nil