From ad7679e7ae512b67064b48767a40e9fc62bed577 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Duffeck?= Date: Thu, 21 Nov 2024 12:16:04 +0100 Subject: [PATCH] Fix tests --- pkg/storage/fs/ocis/ocis_test.go | 3 ++- pkg/storage/fs/posix/posix_test.go | 3 ++- pkg/storage/fs/posix/testhelpers/helpers.go | 2 +- pkg/storage/fs/s3ng/s3ng_test.go | 5 +++-- pkg/storage/utils/decomposedfs/testhelpers/helpers.go | 3 ++- pkg/storage/utils/decomposedfs/upload_async_test.go | 3 ++- pkg/storage/utils/decomposedfs/upload_test.go | 3 ++- 7 files changed, 14 insertions(+), 8 deletions(-) diff --git a/pkg/storage/fs/ocis/ocis_test.go b/pkg/storage/fs/ocis/ocis_test.go index db5a12bb6d..4656b142c7 100644 --- a/pkg/storage/fs/ocis/ocis_test.go +++ b/pkg/storage/fs/ocis/ocis_test.go @@ -23,6 +23,7 @@ import ( "github.com/cs3org/reva/v2/pkg/storage/fs/ocis" "github.com/cs3org/reva/v2/tests/helpers" + "github.com/rs/zerolog" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -53,7 +54,7 @@ var _ = Describe("Ocis", func() { Describe("New", func() { It("returns a new instance", func() { - _, err := ocis.New(options, nil, nil) + _, err := ocis.New(options, nil, &zerolog.Logger{}) Expect(err).ToNot(HaveOccurred()) }) }) diff --git a/pkg/storage/fs/posix/posix_test.go b/pkg/storage/fs/posix/posix_test.go index 5a7e1fcc9e..c727d2a990 100644 --- a/pkg/storage/fs/posix/posix_test.go +++ b/pkg/storage/fs/posix/posix_test.go @@ -23,6 +23,7 @@ import ( "github.com/cs3org/reva/v2/pkg/storage/fs/posix" "github.com/cs3org/reva/v2/tests/helpers" + "github.com/rs/zerolog" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -56,7 +57,7 @@ var _ = Describe("Posix", func() { Describe("New", func() { It("returns a new instance", func() { - _, err := posix.New(options, nil, nil) + _, err := posix.New(options, nil, &zerolog.Logger{}) Expect(err).ToNot(HaveOccurred()) }) }) diff --git a/pkg/storage/fs/posix/testhelpers/helpers.go b/pkg/storage/fs/posix/testhelpers/helpers.go index 0f00229765..39930797af 100644 --- a/pkg/storage/fs/posix/testhelpers/helpers.go +++ b/pkg/storage/fs/posix/testhelpers/helpers.go @@ -195,7 +195,7 @@ func NewTestEnv(config map[string]interface{}) (*TestEnv, error) { Permissions: permissions.NewPermissions(pmock, permissionsSelector), Trashbin: tb, } - fs, err := decomposedfs.New(&o.Options, aspects) + fs, err := decomposedfs.New(&o.Options, aspects, &logger) if err != nil { return nil, err } diff --git a/pkg/storage/fs/s3ng/s3ng_test.go b/pkg/storage/fs/s3ng/s3ng_test.go index bae0b88417..515666f0db 100644 --- a/pkg/storage/fs/s3ng/s3ng_test.go +++ b/pkg/storage/fs/s3ng/s3ng_test.go @@ -23,6 +23,7 @@ import ( "github.com/cs3org/reva/v2/pkg/storage/fs/s3ng" "github.com/cs3org/reva/v2/tests/helpers" + "github.com/rs/zerolog" . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" @@ -58,12 +59,12 @@ var _ = Describe("S3ng", func() { Describe("New", func() { It("fails on missing s3 configuration", func() { - _, err := s3ng.New(map[string]interface{}{}, nil, nil) + _, err := s3ng.New(map[string]interface{}{}, nil, &zerolog.Logger{}) Expect(err).To(MatchError("S3 configuration incomplete")) }) It("works with complete configuration", func() { - _, err := s3ng.New(options, nil, nil) + _, err := s3ng.New(options, nil, &zerolog.Logger{}) Expect(err).ToNot(HaveOccurred()) }) }) diff --git a/pkg/storage/utils/decomposedfs/testhelpers/helpers.go b/pkg/storage/utils/decomposedfs/testhelpers/helpers.go index b8b9d5d53b..c0502a3ea5 100644 --- a/pkg/storage/utils/decomposedfs/testhelpers/helpers.go +++ b/pkg/storage/utils/decomposedfs/testhelpers/helpers.go @@ -34,6 +34,7 @@ import ( "github.com/cs3org/reva/v2/pkg/storagespace" "github.com/cs3org/reva/v2/pkg/store" "github.com/google/uuid" + "github.com/rs/zerolog" "github.com/stretchr/testify/mock" "google.golang.org/grpc" @@ -178,7 +179,7 @@ func NewTestEnv(config map[string]interface{}) (*TestEnv, error) { Permissions: permissions.NewPermissions(pmock, permissionsSelector), Trashbin: &decomposedfs.DecomposedfsTrashbin{}, } - fs, err := decomposedfs.New(o, aspects) + fs, err := decomposedfs.New(o, aspects, &zerolog.Logger{}) if err != nil { return nil, err } diff --git a/pkg/storage/utils/decomposedfs/upload_async_test.go b/pkg/storage/utils/decomposedfs/upload_async_test.go index f5c0907202..4ce18be7b8 100644 --- a/pkg/storage/utils/decomposedfs/upload_async_test.go +++ b/pkg/storage/utils/decomposedfs/upload_async_test.go @@ -31,6 +31,7 @@ import ( "github.com/cs3org/reva/v2/pkg/store" "github.com/cs3org/reva/v2/pkg/utils" "github.com/cs3org/reva/v2/tests/helpers" + "github.com/rs/zerolog" "github.com/stretchr/testify/mock" "google.golang.org/grpc" @@ -180,7 +181,7 @@ var _ = Describe("Async file uploads", Ordered, func() { EventStream: stream.Chan{pub, con}, Trashbin: &DecomposedfsTrashbin{}, } - fs, err = New(o, aspects) + fs, err = New(o, aspects, &zerolog.Logger{}) Expect(err).ToNot(HaveOccurred()) resp, err := fs.CreateStorageSpace(ctx, &provider.CreateStorageSpaceRequest{Owner: user, Type: "personal"}) diff --git a/pkg/storage/utils/decomposedfs/upload_test.go b/pkg/storage/utils/decomposedfs/upload_test.go index a8bb593924..b35f36286b 100644 --- a/pkg/storage/utils/decomposedfs/upload_test.go +++ b/pkg/storage/utils/decomposedfs/upload_test.go @@ -48,6 +48,7 @@ import ( "github.com/cs3org/reva/v2/pkg/storagespace" "github.com/cs3org/reva/v2/pkg/store" "github.com/cs3org/reva/v2/tests/helpers" + "github.com/rs/zerolog" "github.com/stretchr/testify/mock" "google.golang.org/grpc" @@ -144,7 +145,7 @@ var _ = Describe("File uploads", func() { Permissions: permissions.NewPermissions(pmock, permissionsSelector), Trashbin: &decomposedfs.DecomposedfsTrashbin{}, } - fs, err = decomposedfs.New(o, aspects) + fs, err = decomposedfs.New(o, aspects, &zerolog.Logger{}) Expect(err).ToNot(HaveOccurred()) resp, err := fs.CreateStorageSpace(ctx, &provider.CreateStorageSpaceRequest{Owner: user, Type: "personal"})