Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aduffeck authored and butonic committed Jul 6, 2023
1 parent 78527b2 commit 1dd27a4
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
15 changes: 8 additions & 7 deletions pkg/storage/utils/decomposedfs/testhelpers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ import (
"os"
"path/filepath"

"github.com/cs3org/reva/v2/pkg/rgrpc/todo/pool"
"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"
"github.com/cs3org/reva/v2/pkg/storagespace"
"github.com/cs3org/reva/v2/pkg/store"
"github.com/google/uuid"
"github.com/stretchr/testify/mock"
"google.golang.org/grpc"
Expand All @@ -39,12 +33,19 @@ import (
v1beta11 "github.com/cs3org/go-cs3apis/cs3/rpc/v1beta1"
providerv1beta1 "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1"
ruser "github.com/cs3org/reva/v2/pkg/ctx"
"github.com/cs3org/reva/v2/pkg/rgrpc/todo/pool"
"github.com/cs3org/reva/v2/pkg/storage/cache"
"github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs"
"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"
"github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/mocks"
"github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/node"
"github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/options"
"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"
"github.com/cs3org/reva/v2/pkg/store"
"github.com/cs3org/reva/v2/tests/helpers"
)

Expand Down Expand Up @@ -151,7 +152,7 @@ func NewTestEnv(config map[string]interface{}) (*TestEnv, error) {
case "xattrs":
lu = lookup.New(metadata.XattrsBackend{}, o)
case "messagepack":
lu = lookup.New(metadata.NewMessagePackBackend(o.Root, o.FileMetadataCache), o)
lu = lookup.New(metadata.NewMessagePackBackend(o.Root, cache.Config{Store: "noop"}), o)
default:
return nil, fmt.Errorf("unknown metadata backend %s", o.MetadataBackend)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/utils/decomposedfs/tree/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -767,7 +767,7 @@ func (t *Tree) Propagate(ctx context.Context, n *node.Node, sizeDiff int64) (err
}
}()

if n, err = n.ParentWithReader(ctx, f); err != nil {
if n, err = n.Parent(ctx); err != nil {
sublog.Error().Err(err).
Msg("Propagation failed. Could not read parent node.")
return err
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 @@ -16,6 +16,7 @@ import (
"github.com/cs3org/reva/v2/pkg/events/stream"
"github.com/cs3org/reva/v2/pkg/rgrpc/todo/pool"
"github.com/cs3org/reva/v2/pkg/storage"
"github.com/cs3org/reva/v2/pkg/storage/cache"
"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/mocks"
Expand Down Expand Up @@ -87,7 +88,7 @@ var _ = Describe("Async file uploads", Ordered, func() {
})
Expect(err).ToNot(HaveOccurred())

lu = lookup.New(metadata.XattrsBackend{}, o)
lu = lookup.New(metadata.NewMessagePackBackend(o.Root, cache.Config{Store: "noop"}), o)
permissions = &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 @@ -32,6 +32,7 @@ import (
"github.com/cs3org/reva/v2/pkg/errtypes"
"github.com/cs3org/reva/v2/pkg/rgrpc/todo/pool"
"github.com/cs3org/reva/v2/pkg/storage"
"github.com/cs3org/reva/v2/pkg/storage/cache"
"github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs"
"github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/lookup"
"github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/metadata"
Expand Down Expand Up @@ -101,7 +102,7 @@ var _ = Describe("File uploads", func() {
"root": tmpRoot,
})
Expect(err).ToNot(HaveOccurred())
lu = lookup.New(metadata.XattrsBackend{}, o)
lu = lookup.New(metadata.NewMessagePackBackend(o.Root, cache.Config{Store: "noop"}), o)
permissions = &mocks.PermissionsChecker{}
cs3permissionsclient = &mocks.CS3PermissionsClient{}
pool.RemoveSelector("PermissionsSelector" + "any")
Expand Down

0 comments on commit 1dd27a4

Please sign in to comment.