From b09b4316c67075f605fa14bc24019e0b2a5bb98f Mon Sep 17 00:00:00 2001 From: Matt Lord Date: Sat, 14 Oct 2023 13:33:19 -0400 Subject: [PATCH] Fix migrate test Signed-off-by: Matt Lord --- go/test/endtoend/vreplication/migrate_test.go | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/go/test/endtoend/vreplication/migrate_test.go b/go/test/endtoend/vreplication/migrate_test.go index bdabe1d9cad..2ec738bf8c8 100644 --- a/go/test/endtoend/vreplication/migrate_test.go +++ b/go/test/endtoend/vreplication/migrate_test.go @@ -221,17 +221,17 @@ func TestVtctldMigrate(t *testing.T) { var output, expected string t.Run("mount external cluster", func(t *testing.T) { - output, err := vc.VtctldClient.ExecuteCommandWithOutput("Mount", "Register", "--topo-type=etcd2", + output, err := vc.VtctldClient.ExecuteCommandWithOutput("Mount", "register", "--topo-type=etcd2", fmt.Sprintf("--topo-server=localhost:%d", extVc.ClusterConfig.topoPort), "--topo-root=/vitess/global", "ext1") require.NoError(t, err, "Mount Register command failed with %s", output) - output, err = vc.VtctldClient.ExecuteCommandWithOutput("Mount", "List") + output, err = vc.VtctldClient.ExecuteCommandWithOutput("Mount", "list") require.NoError(t, err, "Mount List command failed with %s", output) names := gjson.Get(output, "names") require.Equal(t, 1, len(names.Array())) require.Equal(t, "ext1", names.Array()[0].String()) - output, err = vc.VtctldClient.ExecuteCommandWithOutput("Mount", "Show", "ext1") + output, err = vc.VtctldClient.ExecuteCommandWithOutput("Mount", "show", "ext1") require.NoError(t, err, "Mount command failed with %s\n", output) require.Equal(t, "etcd2", gjson.Get(output, "topo_type").String()) @@ -244,7 +244,7 @@ func TestVtctldMigrate(t *testing.T) { t.Run("migrate from external cluster", func(t *testing.T) { if output, err = vc.VtctldClient.ExecuteCommandWithOutput("Migrate", "--target-keyspace", "product", "--workflow", "e1", - "Create", "--source-keyspace", "rating", "--mount-name", "ext1", "--all-tables", "--cells=extcell1", "--tablet-types=primary,replica"); err != nil { + "create", "--source-keyspace", "rating", "--mount-name", "ext1", "--all-tables", "--cells=extcell1", "--tablet-types=primary,replica"); err != nil { t.Fatalf("Migrate command failed with %+v : %s\n", err, output) } waitForWorkflowState(t, vc, ksWorkflow, binlogdatapb.VReplicationWorkflowState_Running.String()) @@ -258,7 +258,7 @@ func TestVtctldMigrate(t *testing.T) { vdiffSideBySide(t, ksWorkflow, "extcell1") output, err = vc.VtctldClient.ExecuteCommandWithOutput("Migrate", - "--target-keyspace", "product", "--workflow", "e1", "Show") + "--target-keyspace", "product", "--workflow", "e1", "show") require.NoError(t, err, "Migrate command failed with %s", output) wf := gjson.Get(output, "workflows").Array()[0] @@ -266,13 +266,13 @@ func TestVtctldMigrate(t *testing.T) { require.Equal(t, "Migrate", wf.Get("workflow_type").String()) output, err = vc.VtctldClient.ExecuteCommandWithOutput("Migrate", - "--target-keyspace", "product", "--workflow", "e1", "Progress") + "--target-keyspace", "product", "--workflow", "e1", "status", "--format=json") require.NoError(t, err, "Migrate command failed with %s", output) require.Equal(t, "Running", gjson.Get(output, "shard_streams.product/0.streams.0.status").String()) output, err = vc.VtctldClient.ExecuteCommandWithOutput("Migrate", - "--target-keyspace", "product", "--workflow", "e1", "Complete") + "--target-keyspace", "product", "--workflow", "e1", "complete") require.NoError(t, err, "Migrate command failed with %s", output) expectNumberOfStreams(t, vtgateConn, "migrate", "e1", "product:0", 0) @@ -288,7 +288,7 @@ func TestVtctldMigrate(t *testing.T) { waitForRowCount(t, vtgateConn, "product:0", "rating", 0) waitForRowCount(t, vtgateConn, "product:0", "review", 0) output, err = vc.VtctldClient.ExecuteCommandWithOutput("Migrate", - "--target-keyspace", "product", "--workflow", "e1", "Cancel") + "--target-keyspace", "product", "--workflow", "e1", "cancel") require.NoError(t, err, "Migrate command failed with %s", output) expectNumberOfStreams(t, vtgateConn, "migrate", "e1", "product:0", 0) @@ -302,15 +302,15 @@ func TestVtctldMigrate(t *testing.T) { }) t.Run("unmount external cluster", func(t *testing.T) { - output, err = vc.VtctldClient.ExecuteCommandWithOutput("Mount", "Unregister", "ext1") + output, err = vc.VtctldClient.ExecuteCommandWithOutput("Mount", "unregister", "ext1") require.NoError(t, err, "Mount command failed with %s\n", output) - output, err = vc.VtctldClient.ExecuteCommandWithOutput("Mount", "List") + output, err = vc.VtctldClient.ExecuteCommandWithOutput("Mount", "list") require.NoError(t, err, "Mount command failed with %+v : %s\n", output) expected = "{}\n" require.Equal(t, expected, output) - output, err = vc.VtctldClient.ExecuteCommandWithOutput("Mount", "Show", "ext1") + output, err = vc.VtctldClient.ExecuteCommandWithOutput("Mount", "show", "ext1") require.Errorf(t, err, "there is no vitess cluster named ext1") }) }