Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aduffeck committed Aug 6, 2024
1 parent 8eb8cf6 commit 5a157ba
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
6 changes: 4 additions & 2 deletions pkg/storage/fs/posix/testhelpers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import (
"github.com/cs3org/reva/v2/pkg/rgrpc/todo/pool"
"github.com/cs3org/reva/v2/pkg/storage/fs/posix/lookup"
"github.com/cs3org/reva/v2/pkg/storage/fs/posix/options"
"github.com/cs3org/reva/v2/pkg/storage/fs/posix/timemanager"
"github.com/cs3org/reva/v2/pkg/storage/fs/posix/trashbin"
"github.com/cs3org/reva/v2/pkg/storage/fs/posix/tree"
"github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs"
Expand Down Expand Up @@ -153,12 +154,13 @@ func NewTestEnv(config map[string]interface{}) (*TestEnv, error) {
},
},
}

var lu *lookup.Lookup
switch o.MetadataBackend {
case "xattrs":
lu = lookup.New(metadata.NewXattrsBackend(o.Root, o.FileMetadataCache), um, o)
lu = lookup.New(metadata.NewXattrsBackend(o.Root, o.FileMetadataCache), um, o, &timemanager.Manager{})
case "messagepack":
lu = lookup.New(metadata.NewMessagePackBackend(o.Root, o.FileMetadataCache), um, o)
lu = lookup.New(metadata.NewMessagePackBackend(o.Root, o.FileMetadataCache), um, o, &timemanager.Manager{})
default:
return nil, fmt.Errorf("unknown metadata backend %s", o.MetadataBackend)
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/storage/utils/decomposedfs/migrator/migrator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"github.com/rs/zerolog"

provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
"github.com/cs3org/reva/v2/pkg/storage/fs/posix/timemanager"
"github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/lookup"
"github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/metadata"
"github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/metadata/prefixes"
Expand Down Expand Up @@ -89,7 +90,7 @@ var _ = Describe("Migrator", func() {
path = nRef.InternalPath()

// Change backend to messagepack
env.Lookup = lookup.New(backend, env.Options)
env.Lookup = lookup.New(backend, env.Options, &timemanager.Manager{})
})

It("migrates", func() {
Expand Down
5 changes: 3 additions & 2 deletions pkg/storage/utils/decomposedfs/testhelpers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"path/filepath"

"github.com/cs3org/reva/v2/pkg/rgrpc/todo/pool"
"github.com/cs3org/reva/v2/pkg/storage/fs/posix/timemanager"
"github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/aspects"
"github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/lookup"
"github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/metadata"
Expand Down Expand Up @@ -150,9 +151,9 @@ func NewTestEnv(config map[string]interface{}) (*TestEnv, error) {
var lu *lookup.Lookup
switch o.MetadataBackend {
case "xattrs":
lu = lookup.New(metadata.NewXattrsBackend(o.Root, o.FileMetadataCache), o)
lu = lookup.New(metadata.NewXattrsBackend(o.Root, o.FileMetadataCache), o, &timemanager.Manager{})
case "messagepack":
lu = lookup.New(metadata.NewMessagePackBackend(o.Root, o.FileMetadataCache), o)
lu = lookup.New(metadata.NewMessagePackBackend(o.Root, o.FileMetadataCache), o, &timemanager.Manager{})
default:
return nil, fmt.Errorf("unknown metadata backend %s", o.MetadataBackend)
}
Expand Down
3 changes: 2 additions & 1 deletion pkg/storage/utils/decomposedfs/upload_async_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
"github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/options"
"github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/permissions"
"github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/permissions/mocks"
"github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/timemanager"
"github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/tree"
treemocks "github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/tree/mocks"
"github.com/cs3org/reva/v2/pkg/storagespace"
Expand Down Expand Up @@ -139,7 +140,7 @@ var _ = Describe("Async file uploads", Ordered, func() {
})
Expect(err).ToNot(HaveOccurred())

lu = lookup.New(metadata.NewXattrsBackend(o.Root, cache.Config{}), o)
lu = lookup.New(metadata.NewXattrsBackend(o.Root, cache.Config{}), o, &timemanager.Manager{})
pmock = &mocks.PermissionsChecker{}

cs3permissionsclient = &mocks.CS3PermissionsClient{}
Expand Down
3 changes: 2 additions & 1 deletion pkg/storage/utils/decomposedfs/upload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import (
"github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/options"
"github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/permissions"
"github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/permissions/mocks"
"github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/timemanager"
"github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/tree"
treemocks "github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/tree/mocks"
"github.com/cs3org/reva/v2/pkg/storagespace"
Expand Down Expand Up @@ -104,7 +105,7 @@ var _ = Describe("File uploads", func() {
"root": tmpRoot,
})
Expect(err).ToNot(HaveOccurred())
lu = lookup.New(metadata.NewXattrsBackend(o.Root, cache.Config{}), o)
lu = lookup.New(metadata.NewXattrsBackend(o.Root, cache.Config{}), o, &timemanager.Manager{})
pmock = &mocks.PermissionsChecker{}
cs3permissionsclient = &mocks.CS3PermissionsClient{}
pool.RemoveSelector("PermissionsSelector" + "any")
Expand Down

0 comments on commit 5a157ba

Please sign in to comment.