Skip to content

Commit

Permalink
Merge pull request owncloud#4259 from kobergj/AddSearchUnittestsToCI
Browse files Browse the repository at this point in the history
[tests-only] Add search unit test to ci
  • Loading branch information
phil-davis authored Jul 22, 2022
2 parents 1c98198 + e6ef03f commit 5db4b3a
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 5 deletions.
1 change: 1 addition & 0 deletions .drone.star
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ config = {
"services/ocdav",
"services/ocs",
"services/proxy",
"services/search",
"services/settings",
"services/sharing",
"services/storage-system",
Expand Down
37 changes: 37 additions & 0 deletions services/search/Makefile
Original file line number Diff line number Diff line change
@@ -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:
1 change: 1 addition & 0 deletions services/search/pkg/search/index/index_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
},
Expand Down
11 changes: 6 additions & 5 deletions services/search/pkg/search/provider/searchprovider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")},
},
},
Expand Down

0 comments on commit 5db4b3a

Please sign in to comment.