From 83f75bf089e72b955a59d58d53d8b776760a3642 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Thu, 28 Apr 2022 10:05:51 +0200 Subject: [PATCH] fix ginko testsuite --- .vscode/launch.json | 8 ++++---- extensions/graph/pkg/config/defaults/defaultconfig.go | 9 +++++++++ extensions/graph/pkg/service/v0/graph_suite_test.go | 2 +- extensions/graph/pkg/service/v0/graph_test.go | 4 ++-- extensions/ocs/pkg/server/http/svc_test.go | 3 +++ ocis-pkg/crypto/crypto_suite_test.go | 2 +- ocis-pkg/crypto/crypto_test.go | 2 +- 7 files changed, 21 insertions(+), 9 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 52d4b8408..4332cf2e1 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -12,11 +12,11 @@ ], "env": { // log settings for human developers - //"OCIS_LOG_LEVEL": "debug", - //"OCIS_LOG_PRETTY": "true", - //"OCIS_LOG_COLOR": "true", + "OCIS_LOG_LEVEL": "debug", + "OCIS_LOG_PRETTY": "true", + "OCIS_LOG_COLOR": "true", // enable basic auth for dev setup so that we can use curl for testing - //"PROXY_ENABLE_BASIC_AUTH": "true", + "PROXY_ENABLE_BASIC_AUTH": "true", // set insecure options because we don't have valid certificates in dev environments "OCIS_INSECURE": "true", // demo users diff --git a/extensions/graph/pkg/config/defaults/defaultconfig.go b/extensions/graph/pkg/config/defaults/defaultconfig.go index f36a33d10..509189ccc 100644 --- a/extensions/graph/pkg/config/defaults/defaultconfig.go +++ b/extensions/graph/pkg/config/defaults/defaultconfig.go @@ -6,6 +6,15 @@ import ( "github.com/owncloud/ocis/extensions/graph/pkg/config" ) +func FullDefaultConfig() *config.Config { + cfg := DefaultConfig() + + EnsureDefaults(cfg) + Sanitize(cfg) + + return cfg +} + func DefaultConfig() *config.Config { return &config.Config{ Debug: config.Debug{ diff --git a/extensions/graph/pkg/service/v0/graph_suite_test.go b/extensions/graph/pkg/service/v0/graph_suite_test.go index 1c6cfc6cc..6b34ae063 100644 --- a/extensions/graph/pkg/service/v0/graph_suite_test.go +++ b/extensions/graph/pkg/service/v0/graph_suite_test.go @@ -3,7 +3,7 @@ package svc_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/extensions/graph/pkg/service/v0/graph_test.go b/extensions/graph/pkg/service/v0/graph_test.go index fe328d93a..f01a7b11a 100644 --- a/extensions/graph/pkg/service/v0/graph_test.go +++ b/extensions/graph/pkg/service/v0/graph_test.go @@ -13,7 +13,7 @@ import ( provider "github.com/cs3org/go-cs3apis/cs3/storage/provider/v1beta1" typesv1beta1 "github.com/cs3org/go-cs3apis/cs3/types/v1beta1" "github.com/cs3org/reva/v2/pkg/rgrpc/status" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" libregraph "github.com/owncloud/libre-graph-api-go" "github.com/owncloud/ocis/extensions/graph/mocks" @@ -38,7 +38,7 @@ var _ = Describe("Graph", func() { httpClient = &mocks.HTTPClient{} eventsPublisher = mocks.Publisher{} svc = service.NewService( - service.Config(defaults.DefaultConfig()), + service.Config(defaults.FullDefaultConfig()), service.WithGatewayClient(gatewayClient), service.WithHTTPClient(httpClient), service.EventsPublisher(&eventsPublisher), diff --git a/extensions/ocs/pkg/server/http/svc_test.go b/extensions/ocs/pkg/server/http/svc_test.go index 7bdddbf28..c5a73fcfb 100644 --- a/extensions/ocs/pkg/server/http/svc_test.go +++ b/extensions/ocs/pkg/server/http/svc_test.go @@ -723,6 +723,9 @@ func getService() svc.Service { Root: "/", Addr: "localhost:9110", }, + Reva: &config.Reva{ + Address: "", + }, TokenManager: &config.TokenManager{ JWTSecret: jwtSecret, }, diff --git a/ocis-pkg/crypto/crypto_suite_test.go b/ocis-pkg/crypto/crypto_suite_test.go index e60462b99..87ac8f6f7 100644 --- a/ocis-pkg/crypto/crypto_suite_test.go +++ b/ocis-pkg/crypto/crypto_suite_test.go @@ -3,7 +3,7 @@ package crypto_test import ( "testing" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" ) diff --git a/ocis-pkg/crypto/crypto_test.go b/ocis-pkg/crypto/crypto_test.go index 328607ba9..0f5479625 100644 --- a/ocis-pkg/crypto/crypto_test.go +++ b/ocis-pkg/crypto/crypto_test.go @@ -8,7 +8,7 @@ import ( "github.com/owncloud/ocis/ocis-pkg/crypto" "github.com/owncloud/ocis/ocis-pkg/log" - . "github.com/onsi/ginkgo" + . "github.com/onsi/ginkgo/v2" cfg "github.com/owncloud/ocis/ocis-pkg/config" )