From c5452a87ecd8ade5fc4adfad24f722e69c8aa3ca Mon Sep 17 00:00:00 2001 From: Egon Elbre Date: Wed, 6 May 2020 17:30:22 +0300 Subject: [PATCH] private/testplanet: use drpc referral manager server Change-Id: I9e9e9a724c78c98859dd3e29416d766d8ffdca63 --- private/testplanet/reconfigure.go | 4 ++-- private/testplanet/referralmanager.go | 3 +-- private/testplanet/rpc_test.go | 16 ---------------- satellite/referrals/service_test.go | 5 ++--- 4 files changed, 5 insertions(+), 23 deletions(-) diff --git a/private/testplanet/reconfigure.go b/private/testplanet/reconfigure.go index 41de6677f..4e44774a7 100644 --- a/private/testplanet/reconfigure.go +++ b/private/testplanet/reconfigure.go @@ -9,7 +9,7 @@ import ( "go.uber.org/zap" "storj.io/common/identity/testidentity" - "storj.io/common/pb/pbgrpc" + "storj.io/common/pb" "storj.io/common/storj" "storj.io/storj/satellite" "storj.io/storj/satellite/metainfo" @@ -22,7 +22,7 @@ type Reconfigure struct { SatellitePointerDB func(log *zap.Logger, index int, db metainfo.PointerDB) (metainfo.PointerDB, error) Satellite func(log *zap.Logger, index int, config *satellite.Config) - ReferralManagerServer func(log *zap.Logger) pbgrpc.ReferralManagerServer + ReferralManagerServer func(log *zap.Logger) pb.DRPCReferralManagerServer StorageNodeDB func(index int, db storagenode.DB, log *zap.Logger) (storagenode.DB, error) StorageNode func(index int, config *storagenode.Config) diff --git a/private/testplanet/referralmanager.go b/private/testplanet/referralmanager.go index 8bc77254c..34ec203fd 100644 --- a/private/testplanet/referralmanager.go +++ b/private/testplanet/referralmanager.go @@ -9,7 +9,6 @@ import ( "path/filepath" "storj.io/common/pb" - "storj.io/common/pb/pbgrpc" "storj.io/common/peertls/extensions" "storj.io/common/peertls/tlsopts" "storj.io/common/testrand" @@ -51,7 +50,7 @@ func (planet *Planet) newReferralManager() (*server.Server, error) { }, } - var endpoints pbgrpc.ReferralManagerServer + var endpoints pb.DRPCReferralManagerServer // only create a referral manager server if testplanet was reconfigured with a custom referral manager endpoint if planet.config.Reconfigure.ReferralManagerServer != nil { endpoints = planet.config.Reconfigure.ReferralManagerServer(log) diff --git a/private/testplanet/rpc_test.go b/private/testplanet/rpc_test.go index 2891f6275..996162234 100644 --- a/private/testplanet/rpc_test.go +++ b/private/testplanet/rpc_test.go @@ -24,22 +24,6 @@ import ( "storj.io/storj/storagenode" ) -// TestRPCBuild prints a statement so that in test output you can know whether -// the code was compiled with dprc or grpc -func TestRPCBuild(t *testing.T) { - require.False(t, rpc.IsDRPC == rpc.IsGRPC) - - var rpcType string - if rpc.IsDRPC { - rpcType = "Compiled with DRPC" - } else if rpc.IsGRPC { - rpcType = "Compiled with GRPC" - } - require.NotEqual(t, rpcType, "") - - t.Log(rpcType) -} - func TestDialNode(t *testing.T) { testplanet.Run(t, testplanet.Config{ SatelliteCount: 0, StorageNodeCount: 2, UplinkCount: 0, diff --git a/satellite/referrals/service_test.go b/satellite/referrals/service_test.go index aeae02758..2f1735d70 100644 --- a/satellite/referrals/service_test.go +++ b/satellite/referrals/service_test.go @@ -11,7 +11,6 @@ import ( "go.uber.org/zap" "storj.io/common/pb" - "storj.io/common/pb/pbgrpc" "storj.io/common/rpc/rpcstatus" "storj.io/common/testcontext" "storj.io/common/testrand" @@ -24,7 +23,7 @@ func TestServiceSuccess(t *testing.T) { testplanet.Run(t, testplanet.Config{ SatelliteCount: 1, Reconfigure: testplanet.Reconfigure{ - ReferralManagerServer: func(logger *zap.Logger) pbgrpc.ReferralManagerServer { + ReferralManagerServer: func(logger *zap.Logger) pb.DRPCReferralManagerServer { endpoint := &endpointHappyPath{} endpoint.SetTokenCount(tokenCount) return endpoint @@ -59,7 +58,7 @@ func TestServiceRedeemFailure(t *testing.T) { testplanet.Run(t, testplanet.Config{ SatelliteCount: 1, Reconfigure: testplanet.Reconfigure{ - ReferralManagerServer: func(logger *zap.Logger) pbgrpc.ReferralManagerServer { + ReferralManagerServer: func(logger *zap.Logger) pb.DRPCReferralManagerServer { endpoint := &endpointFailedPath{} endpoint.SetTokenCount(2) return endpoint