@@ -221,17 +221,17 @@ func TestVtctldMigrate(t *testing.T) {
221
221
var output , expected string
222
222
223
223
t .Run ("mount external cluster" , func (t * testing.T ) {
224
- output , err := vc .VtctldClient .ExecuteCommandWithOutput ("Mount" , "Register " , "--topo-type=etcd2" ,
224
+ output , err := vc .VtctldClient .ExecuteCommandWithOutput ("Mount" , "register " , "--topo-type=etcd2" ,
225
225
fmt .Sprintf ("--topo-server=localhost:%d" , extVc .ClusterConfig .topoPort ), "--topo-root=/vitess/global" , "ext1" )
226
226
require .NoError (t , err , "Mount Register command failed with %s" , output )
227
227
228
- output , err = vc .VtctldClient .ExecuteCommandWithOutput ("Mount" , "List " )
228
+ output , err = vc .VtctldClient .ExecuteCommandWithOutput ("Mount" , "list " )
229
229
require .NoError (t , err , "Mount List command failed with %s" , output )
230
230
231
231
names := gjson .Get (output , "names" )
232
232
require .Equal (t , 1 , len (names .Array ()))
233
233
require .Equal (t , "ext1" , names .Array ()[0 ].String ())
234
- output , err = vc .VtctldClient .ExecuteCommandWithOutput ("Mount" , "Show " , "ext1" )
234
+ output , err = vc .VtctldClient .ExecuteCommandWithOutput ("Mount" , "show " , "ext1" )
235
235
require .NoError (t , err , "Mount command failed with %s\n " , output )
236
236
237
237
require .Equal (t , "etcd2" , gjson .Get (output , "topo_type" ).String ())
@@ -244,7 +244,7 @@ func TestVtctldMigrate(t *testing.T) {
244
244
t .Run ("migrate from external cluster" , func (t * testing.T ) {
245
245
if output , err = vc .VtctldClient .ExecuteCommandWithOutput ("Migrate" ,
246
246
"--target-keyspace" , "product" , "--workflow" , "e1" ,
247
- "Create " , "--source-keyspace" , "rating" , "--mount-name" , "ext1" , "--all-tables" , "--cells=extcell1" , "--tablet-types=primary,replica" ); err != nil {
247
+ "create " , "--source-keyspace" , "rating" , "--mount-name" , "ext1" , "--all-tables" , "--cells=extcell1" , "--tablet-types=primary,replica" ); err != nil {
248
248
t .Fatalf ("Migrate command failed with %+v : %s\n " , err , output )
249
249
}
250
250
waitForWorkflowState (t , vc , ksWorkflow , binlogdatapb .VReplicationWorkflowState_Running .String ())
@@ -258,21 +258,21 @@ func TestVtctldMigrate(t *testing.T) {
258
258
vdiffSideBySide (t , ksWorkflow , "extcell1" )
259
259
260
260
output , err = vc .VtctldClient .ExecuteCommandWithOutput ("Migrate" ,
261
- "--target-keyspace" , "product" , "--workflow" , "e1" , "Show " )
261
+ "--target-keyspace" , "product" , "--workflow" , "e1" , "show " )
262
262
require .NoError (t , err , "Migrate command failed with %s" , output )
263
263
264
264
wf := gjson .Get (output , "workflows" ).Array ()[0 ]
265
265
require .Equal (t , "e1" , wf .Get ("name" ).String ())
266
266
require .Equal (t , "Migrate" , wf .Get ("workflow_type" ).String ())
267
267
268
268
output , err = vc .VtctldClient .ExecuteCommandWithOutput ("Migrate" ,
269
- "--target-keyspace" , "product" , "--workflow" , "e1" , "Progress " )
269
+ "--target-keyspace" , "product" , "--workflow" , "e1" , "status" , "--format=json " )
270
270
require .NoError (t , err , "Migrate command failed with %s" , output )
271
271
272
272
require .Equal (t , "Running" , gjson .Get (output , "shard_streams.product/0.streams.0.status" ).String ())
273
273
274
274
output , err = vc .VtctldClient .ExecuteCommandWithOutput ("Migrate" ,
275
- "--target-keyspace" , "product" , "--workflow" , "e1" , "Complete " )
275
+ "--target-keyspace" , "product" , "--workflow" , "e1" , "complete " )
276
276
require .NoError (t , err , "Migrate command failed with %s" , output )
277
277
278
278
expectNumberOfStreams (t , vtgateConn , "migrate" , "e1" , "product:0" , 0 )
@@ -288,7 +288,7 @@ func TestVtctldMigrate(t *testing.T) {
288
288
waitForRowCount (t , vtgateConn , "product:0" , "rating" , 0 )
289
289
waitForRowCount (t , vtgateConn , "product:0" , "review" , 0 )
290
290
output , err = vc .VtctldClient .ExecuteCommandWithOutput ("Migrate" ,
291
- "--target-keyspace" , "product" , "--workflow" , "e1" , "Cancel " )
291
+ "--target-keyspace" , "product" , "--workflow" , "e1" , "cancel " )
292
292
require .NoError (t , err , "Migrate command failed with %s" , output )
293
293
294
294
expectNumberOfStreams (t , vtgateConn , "migrate" , "e1" , "product:0" , 0 )
@@ -302,15 +302,15 @@ func TestVtctldMigrate(t *testing.T) {
302
302
})
303
303
304
304
t .Run ("unmount external cluster" , func (t * testing.T ) {
305
- output , err = vc .VtctldClient .ExecuteCommandWithOutput ("Mount" , "Unregister " , "ext1" )
305
+ output , err = vc .VtctldClient .ExecuteCommandWithOutput ("Mount" , "unregister " , "ext1" )
306
306
require .NoError (t , err , "Mount command failed with %s\n " , output )
307
307
308
- output , err = vc .VtctldClient .ExecuteCommandWithOutput ("Mount" , "List " )
308
+ output , err = vc .VtctldClient .ExecuteCommandWithOutput ("Mount" , "list " )
309
309
require .NoError (t , err , "Mount command failed with %+v : %s\n " , output )
310
310
expected = "{}\n "
311
311
require .Equal (t , expected , output )
312
312
313
- output , err = vc .VtctldClient .ExecuteCommandWithOutput ("Mount" , "Show " , "ext1" )
313
+ output , err = vc .VtctldClient .ExecuteCommandWithOutput ("Mount" , "show " , "ext1" )
314
314
require .Errorf (t , err , "there is no vitess cluster named ext1" )
315
315
})
316
316
}
0 commit comments