Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aduffeck committed Jul 26, 2024
1 parent ba3349e commit 746fbe0
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/storage/fs/posix/testhelpers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,15 @@ func NewTestEnv(config map[string]interface{}) (*TestEnv, error) {
if err != nil {
return nil, err
}
tb, err := trashbin.New(o, lu)
if err != nil {
return nil, err
}
aspects := aspects.Aspects{
Lookup: lu,
Tree: tree,
Permissions: permissions.NewPermissions(pmock, permissionsSelector),
Trashbin: tb,
}
fs, err := decomposedfs.New(&o.Options, aspects)
if err != nil {
Expand Down
3 changes: 3 additions & 0 deletions pkg/storage/utils/decomposedfs/decomposedfs.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,9 @@ func New(o *options.Options, aspects aspects.Aspects) (storage.FS, error) {
return nil, err
}

if aspects.Trashbin == nil {
return nil, errors.New("need trashbin")
}
// set a null usermapper if we don't have one
if aspects.UserMapper == nil {
aspects.UserMapper = &usermapper.NullMapper{}
Expand Down
1 change: 1 addition & 0 deletions pkg/storage/utils/decomposedfs/testhelpers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ func NewTestEnv(config map[string]interface{}) (*TestEnv, error) {
Lookup: lu,
Tree: tree,
Permissions: permissions.NewPermissions(pmock, permissionsSelector),
Trashbin: &decomposedfs.DecomposedfsTrashbin{},
}
fs, err := decomposedfs.New(o, aspects)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions pkg/storage/utils/decomposedfs/upload_async_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ var _ = Describe("Async file uploads", Ordered, func() {
Tree: tree,
Permissions: permissions.NewPermissions(pmock, permissionsSelector),
EventStream: stream.Chan{pub, con},
Trashbin: &DecomposedfsTrashbin{},
}
fs, err = New(o, aspects)
Expect(err).ToNot(HaveOccurred())
Expand Down
1 change: 1 addition & 0 deletions pkg/storage/utils/decomposedfs/upload_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ var _ = Describe("File uploads", func() {
Lookup: lu,
Tree: tree,
Permissions: permissions.NewPermissions(pmock, permissionsSelector),
Trashbin: &decomposedfs.DecomposedfsTrashbin{},
}
fs, err = decomposedfs.New(o, aspects)
Expect(err).ToNot(HaveOccurred())
Expand Down

0 comments on commit 746fbe0

Please sign in to comment.