mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-27 23:47:33 -05:00
start metadata storage in tests
This commit is contained in:
committed by
Ilja Neumann
parent
4015a504e3
commit
7bbc387af1
@@ -1,16 +1,20 @@
|
||||
package cs3
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path"
|
||||
"testing"
|
||||
|
||||
"github.com/owncloud/ocis/accounts/pkg/config"
|
||||
"github.com/owncloud/ocis/accounts/pkg/indexer/option"
|
||||
. "github.com/owncloud/ocis/accounts/pkg/indexer/test"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"os"
|
||||
"path"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestCS3NonUniqueIndex_FakeSymlink(t *testing.T) {
|
||||
go setupMetadataStorage()
|
||||
defer cancelFunc()
|
||||
|
||||
dataDir := WriteIndexTestDataCS3(t, TestData, "Id")
|
||||
cfg := config.Config{
|
||||
Repo: config.Repo{
|
||||
|
||||
@@ -1,16 +1,39 @@
|
||||
package cs3
|
||||
|
||||
import (
|
||||
"github.com/owncloud/ocis/accounts/pkg/config"
|
||||
"github.com/owncloud/ocis/accounts/pkg/indexer/option"
|
||||
. "github.com/owncloud/ocis/accounts/pkg/indexer/test"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"context"
|
||||
"flag"
|
||||
"os"
|
||||
"path"
|
||||
"testing"
|
||||
|
||||
"github.com/micro/cli/v2"
|
||||
"github.com/owncloud/ocis/accounts/pkg/config"
|
||||
"github.com/owncloud/ocis/accounts/pkg/indexer/option"
|
||||
. "github.com/owncloud/ocis/accounts/pkg/indexer/test"
|
||||
"github.com/owncloud/ocis/storage/pkg/command"
|
||||
mcfg "github.com/owncloud/ocis/storage/pkg/config"
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
var (
|
||||
ctx, cancelFunc = context.WithCancel(context.Background())
|
||||
)
|
||||
|
||||
func setupMetadataStorage() {
|
||||
cfg := mcfg.New()
|
||||
app := cli.App{
|
||||
Name: "storage-metadata-for-tests",
|
||||
Commands: []*cli.Command{command.StorageMetadata(cfg)},
|
||||
}
|
||||
|
||||
_ = app.Command("storage-metadata").Run(cli.NewContext(&app, &flag.FlagSet{}, &cli.Context{Context: ctx}))
|
||||
}
|
||||
|
||||
func TestCS3UniqueIndex_FakeSymlink(t *testing.T) {
|
||||
go setupMetadataStorage()
|
||||
defer cancelFunc()
|
||||
|
||||
dataDir := WriteIndexTestDataCS3(t, TestData, "Id")
|
||||
cfg := config.Config{
|
||||
Repo: config.Repo{
|
||||
@@ -60,6 +83,9 @@ func TestCS3UniqueIndex_FakeSymlink(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestCS3UniqueIndexSearch(t *testing.T) {
|
||||
go setupMetadataStorage()
|
||||
defer cancelFunc()
|
||||
|
||||
dataDir := WriteIndexTestDataCS3(t, TestData, "Id")
|
||||
cfg := config.Config{
|
||||
Repo: config.Repo{
|
||||
|
||||
Reference in New Issue
Block a user