From fdaa55865c45875a57677dfb8c21b157b31be86d Mon Sep 17 00:00:00 2001 From: jkoberg Date: Fri, 22 Jul 2022 11:16:53 +0200 Subject: [PATCH 1/2] add search unit test to ci Signed-off-by: jkoberg --- .drone.star | 1 + services/search/pkg/search/index/index_test.go | 1 + .../search/pkg/search/provider/searchprovider_test.go | 11 ++++++----- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.drone.star b/.drone.star index e6fc3e393cb..f4c43d59a5a 100644 --- a/.drone.star +++ b/.drone.star @@ -68,6 +68,7 @@ config = { "services/ocdav", "services/ocs", "services/proxy", + "services/search", "services/settings", "services/sharing", "services/storage-system", diff --git a/services/search/pkg/search/index/index_test.go b/services/search/pkg/search/index/index_test.go index 036f1e20aa8..7391d18a2e2 100644 --- a/services/search/pkg/search/index/index_test.go +++ b/services/search/pkg/search/index/index_test.go @@ -196,6 +196,7 @@ var _ = Describe("Index", func() { Ref: &searchmsg.Reference{ ResourceId: &searchmsg.ResourceID{ StorageId: ref.ResourceId.StorageId, + SpaceId: ref.ResourceId.SpaceId, OpaqueId: ref.ResourceId.OpaqueId, }, }, diff --git a/services/search/pkg/search/provider/searchprovider_test.go b/services/search/pkg/search/provider/searchprovider_test.go index c04299c4dd6..0badf5e715a 100644 --- a/services/search/pkg/search/provider/searchprovider_test.go +++ b/services/search/pkg/search/provider/searchprovider_test.go @@ -222,19 +222,20 @@ var _ = Describe("Searchprovider", func() { grantSpace = &sprovider.StorageSpace{ SpaceType: "grant", Owner: otherUser, - Id: &sprovider.StorageSpaceId{OpaqueId: "otherspaceroot!otherspacegrant"}, - Root: &sprovider.ResourceId{StorageId: "otherspaceroot", OpaqueId: "otherspacegrant"}, + Id: &sprovider.StorageSpaceId{OpaqueId: "storageproviderid$spaceid!otherspacegrant"}, + Root: &sprovider.ResourceId{StorageId: "storageproviderid", SpaceId: "spaceid", OpaqueId: "otherspacegrant"}, Name: "grantspace", } mountpointSpace = &sprovider.StorageSpace{ SpaceType: "mountpoint", Owner: otherUser, - Id: &sprovider.StorageSpaceId{OpaqueId: "otherspaceroot!otherspacemountpoint"}, - Root: &sprovider.ResourceId{StorageId: "otherspaceroot", OpaqueId: "otherspacemountpoint"}, + Id: &sprovider.StorageSpaceId{OpaqueId: "storageproviderid$spaceid!otherspacemountpoint"}, + Root: &sprovider.ResourceId{StorageId: "storageproviderid", SpaceId: "spaceid", OpaqueId: "otherspacemountpoint"}, Name: "mountpointspace", Opaque: &typesv1beta1.Opaque{ Map: map[string]*typesv1beta1.OpaqueEntry{ - "grantStorageID": {Decoder: "plain", Value: []byte("otherspaceroot")}, + "grantStorageID": {Decoder: "plain", Value: []byte("storageproviderid")}, + "grantSpaceID": {Decoder: "plain", Value: []byte("spaceid")}, "grantOpaqueID": {Decoder: "plain", Value: []byte("otherspacegrant")}, }, }, From e6ef03fb43a18e5cc380a03172baeffad61db6a8 Mon Sep 17 00:00:00 2001 From: jkoberg Date: Fri, 22 Jul 2022 11:25:04 +0200 Subject: [PATCH 2/2] add Makefile Signed-off-by: jkoberg --- services/search/Makefile | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 services/search/Makefile diff --git a/services/search/Makefile b/services/search/Makefile new file mode 100644 index 00000000000..032a972be33 --- /dev/null +++ b/services/search/Makefile @@ -0,0 +1,37 @@ +SHELL := bash +NAME := search + +include ../../.make/recursion.mk + +############ tooling ############ +ifneq (, $(shell command -v go 2> /dev/null)) # suppress `command not found warnings` for non go targets in CI +include ../../.bingo/Variables.mk +endif + +############ go tooling ############ +include ../../.make/go.mk + +############ release ############ +include ../../.make/release.mk + +############ docs generate ############ +include ../../.make/docs.mk + +.PHONY: docs-generate +docs-generate: config-docs-generate + +############ generate ############ +include ../../.make/generate.mk + +.PHONY: ci-go-generate +ci-go-generate: # CI runs ci-node-generate automatically before this target + +.PHONY: ci-node-generate +ci-node-generate: + +############ licenses ############ +.PHONY: ci-node-check-licenses +ci-node-check-licenses: + +.PHONY: ci-node-save-licenses +ci-node-save-licenses: