Skip to content

Commit

Permalink
Any test that needs a VtctldServer needs to override the protocol to …
Browse files Browse the repository at this point in the history
…the fake

Signed-off-by: Andrew Mason <[email protected]>
  • Loading branch information
ajm188 committed Jan 22, 2021
1 parent da1437c commit 3ee391b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions go/vt/vtadmin/api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,18 @@ import (
"vitess.io/vitess/go/vt/vtctl/grpcvtctldserver"
"vitess.io/vitess/go/vt/vtctl/grpcvtctldserver/testutil"
"vitess.io/vitess/go/vt/vtctl/vtctldclient"
"vitess.io/vitess/go/vt/vttablet/tmclient"

topodatapb "vitess.io/vitess/go/vt/proto/topodata"
vtadminpb "vitess.io/vitess/go/vt/proto/vtadmin"
vtctldatapb "vitess.io/vitess/go/vt/proto/vtctldata"
"vitess.io/vitess/go/vt/proto/vttime"
)

func init() {
*tmclient.TabletManagerProtocol = testutil.TabletManagerClientProtocol
}

func TestGetGates(t *testing.T) {
fakedisco1 := fakediscovery.New()
cluster1 := &cluster.Cluster{
Expand Down
5 changes: 4 additions & 1 deletion go/vt/vtctl/grpcvtctldserver/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ import (
vtctldatapb "vitess.io/vitess/go/vt/proto/vtctldata"
)

func init() {
*tmclient.TabletManagerProtocol = testutil.TabletManagerClientProtocol
}

func TestFindAllShardsInKeyspace(t *testing.T) {
ctx := context.Background()
ts := memorytopo.NewServer("cell1")
Expand Down Expand Up @@ -264,7 +268,6 @@ func TestGetTablet(t *testing.T) {
}

func TestGetSchema(t *testing.T) {
*tmclient.TabletManagerProtocol = testutil.TabletManagerClientProtocol
ctx := context.Background()
ts := memorytopo.NewServer("zone1")
vtctld := NewVtctldServer(ts)
Expand Down

0 comments on commit 3ee391b

Please sign in to comment.