Skip to content

Commit

Permalink
Reorgnaize the permissions tests
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Lord <[email protected]>
  • Loading branch information
mattlord committed Jan 17, 2025
1 parent 60fca3a commit f0d6c1e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

/*
Package testlib contains utility methods to include in unit tests to
deal with topology common tasks, like fake tablets and action loops.
*/
package testlib
package command

import (
"context"
Expand Down Expand Up @@ -54,7 +50,7 @@ import (
)

func init() {
tabletconntest.SetProtocol("go.vt.vtctl.workflow.testlib", "grpc")
tabletconntest.SetProtocol("go.cmd.vtctldclient.command", "grpc")
}

// This file contains utility methods for unit tests.
Expand Down
7 changes: 3 additions & 4 deletions go/cmd/vtctldclient/command/permissions_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2019 The Vitess Authors.
Copyright 2025 The Vitess Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -26,7 +26,6 @@ import (
"vitess.io/vitess/go/vt/discovery"
"vitess.io/vitess/go/vt/topo/topoproto"
"vitess.io/vitess/go/vt/vtctl/grpcvtctldserver"
"vitess.io/vitess/go/vt/vtctl/workflow/testlib"
"vitess.io/vitess/go/vt/vtenv"

"vitess.io/vitess/go/sqltypes"
Expand All @@ -52,8 +51,8 @@ func TestPermissions(t *testing.T) {
defer ts.Close()
vtctld := grpcvtctldserver.NewVtctldServer(vtenv.NewTestEnv(), ts)

primary := testlib.NewFakeTablet(t, ts, "cell1", 0, topodatapb.TabletType_PRIMARY, nil)
replica := testlib.NewFakeTablet(t, ts, "cell1", 1, topodatapb.TabletType_REPLICA, nil)
primary := NewFakeTablet(t, ts, "cell1", 0, topodatapb.TabletType_PRIMARY, nil)
replica := NewFakeTablet(t, ts, "cell1", 1, topodatapb.TabletType_REPLICA, nil)

// Mark the primary for the shard.
_, err := ts.UpdateShardFields(ctx, primary.Tablet.Keyspace, primary.Tablet.Shard, func(si *topo.ShardInfo) error {
Expand Down

0 comments on commit f0d6c1e

Please sign in to comment.