Skip to content

Commit 25325ba

Browse files
Fix various tests
Signed-off-by: Rohit Nayak <[email protected]>
1 parent 0564baa commit 25325ba

File tree

18 files changed

+55
-55
lines changed

18 files changed

+55
-55
lines changed

go/cmd/vtclient/cli/vtclient_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func TestVtclient(t *testing.T) {
9191
args: []string{"SELECT * FROM table1"},
9292
},
9393
{
94-
args: []string{"--target", "@primary", "--bind_variables", `[ 1, 100 ]`,
94+
args: []string{"--target", "@primary", "--bind-variables", `[ 1, 100 ]`,
9595
"INSERT INTO table1 (id, i) VALUES (:v1, :v2)"},
9696
rowsAffected: 1,
9797
},
@@ -106,7 +106,7 @@ func TestVtclient(t *testing.T) {
106106
rowsAffected: 1,
107107
},
108108
{
109-
args: []string{"--target", "@primary", "--bind_variables", `[ 1 ]`,
109+
args: []string{"--target", "@primary", "--bind-variables", `[ 1 ]`,
110110
"DELETE FROM table1 WHERE id = :v1"},
111111
rowsAffected: 1,
112112
},

go/cmd/vttestserver/cli/main_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ func TestForeignKeysAndDDLModes(t *testing.T) {
137137
conf := config
138138
defer resetConfig(conf)
139139

140-
cluster, err := startCluster("--foreign-key-mode=allow", "--enable_online_ddl=true", "--enable_direct_ddl=true")
140+
cluster, err := startCluster("--foreign-key-mode=allow", "--enable-online-ddl=true", "--enable-direct-ddl=true")
141141
require.NoError(t, err)
142142
defer cluster.TearDown()
143143

@@ -163,7 +163,7 @@ func TestForeignKeysAndDDLModes(t *testing.T) {
163163
assert.NoError(t, err)
164164

165165
cluster.TearDown()
166-
cluster, err = startCluster("--foreign-key-mode=disallow", "--enable_online_ddl=false", "--enable_direct_ddl=false")
166+
cluster, err = startCluster("--foreign-key-mode=disallow", "--enable-online-ddl=false", "--enable-direct-ddl=false")
167167
require.NoError(t, err)
168168
defer cluster.TearDown()
169169

@@ -271,8 +271,8 @@ func TestExternalTopoServerConsul(t *testing.T) {
271271
}
272272
}()
273273

274-
cluster, err := startCluster("--external_topo_implementation=consul",
275-
fmt.Sprintf("--external_topo_global_server_address=%s", serverAddr), "--external_topo_global_root=consul_test/global")
274+
cluster, err := startCluster("--external-topo-implementation=consul",
275+
fmt.Sprintf("--external-topo-global-server-address=%s", serverAddr), "--external-topo-global-root=consul_test/global")
276276
require.NoError(t, err)
277277
defer cluster.TearDown()
278278

@@ -361,10 +361,10 @@ func TestMtlsAuthUnauthorizedFails(t *testing.T) {
361361

362362
func startPersistentCluster(dir string, flags ...string) (vttest.LocalCluster, error) {
363363
flags = append(flags, []string{
364-
"--persistent_mode",
364+
"--persistent-mode",
365365
// FIXME: if port is not provided, data_dir is not respected
366366
fmt.Sprintf("--port=%d", randomPort()),
367-
fmt.Sprintf("--data_dir=%s", dir),
367+
fmt.Sprintf("--data-dir=%s", dir),
368368
}...)
369369
return startCluster(flags...)
370370
}
@@ -379,8 +379,8 @@ func startCluster(flags ...string) (cluster vttest.LocalCluster, err error) {
379379
schemaDirArg := utils.GetFlagVariantForTests("--schema-dir") + "=data/schema"
380380
tabletHostname := fmt.Sprintf("%s=localhost", utils.GetFlagVariantForTests("--tablet-hostname"))
381381
keyspaceArg := "--keyspaces=" + strings.Join(clusterKeyspaces, ",")
382-
numShardsArg := "--num_shards=2,2"
383-
vschemaDDLAuthorizedUsers := "--vschema_ddl_authorized_users=%"
382+
numShardsArg := "--num-shards=2,2"
383+
vschemaDDLAuthorizedUsers := "--vschema-ddl-authorized-users=%"
384384
alsoLogToStderr := "--alsologtostderr" // better debugging
385385
args = append(args, []string{schemaDirArg, keyspaceArg, numShardsArg, tabletHostname, vschemaDDLAuthorizedUsers, alsoLogToStderr}...)
386386
args = append(args, flags...)

go/flags/endtoend/topo2topo.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ Flags:
1818
--do-shard-replications copies the shard replication information
1919
--do-shards copies the shard information
2020
--do-tablets copies the tablet information
21-
--from_implementation string topology implementation to copy data from
22-
--from_root string topology server root to copy data from
23-
--from_server string topology server address to copy data from
21+
--from-implementation string topology implementation to copy data from
22+
--from-root string topology server root to copy data from
23+
--from-server string topology server address to copy data from
2424
--grpc-enable-tracing Enable gRPC tracing.
2525
--grpc-max-message-size int Maximum allowed RPC message size. Larger messages will be rejected by gRPC with the error 'exceeding the max size'. (default 16777216)
2626
--grpc-prometheus Enable gRPC monitoring with Prometheus.
@@ -37,9 +37,9 @@ Flags:
3737
--purge-logs-interval duration how often try to remove old logs (default 1h0m0s)
3838
--security-policy string the name of a registered security policy to use for controlling access to URLs - empty means allow all for anyone (built-in policies: deny-all, read-only)
3939
--stderrthreshold severityFlag logs at or above this threshold go to stderr (default 1)
40-
--to_implementation string topology implementation to copy data to
41-
--to_root string topology server root to copy data to
42-
--to_server string topology server address to copy data to
40+
--to-implementation string topology implementation to copy data to
41+
--to-root string topology server root to copy data to
42+
--to-server string topology server address to copy data to
4343
--v Level log level for V logs
4444
-v, --version print binary version
4545
--vmodule vModuleFlag comma-separated list of pattern=N settings for file-filtered logging

go/test/endtoend/mysqlserver/main_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,10 @@ func TestMain(m *testing.M) {
109109
}
110110

111111
clusterInstance.VtGateExtraArgs = []string{
112-
"--vschema_ddl_authorized_users=%",
112+
"--vschema-ddl-authorized-users=%",
113113
utils.GetFlagVariantForTests("--mysql-server-query-timeout"), "1s",
114114
utils.GetFlagVariantForTests("--mysql-auth-server-impl"), "static",
115-
"--mysql_auth_server_static_file", clusterInstance.TmpDirectory + mysqlAuthServerStatic,
115+
"--mysql-auth-server-static-file", clusterInstance.TmpDirectory + mysqlAuthServerStatic,
116116
utils.GetFlagVariantForTests("--mysql-server-version"), "8.0.16-7",
117117
utils.GetFlagVariantForTests("--warn-sharded-only") + "=true",
118118
}

go/test/endtoend/preparestmt/main_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ func TestMain(m *testing.M) {
163163
// add extra arguments
164164
vtgateInstance.ExtraArgs = []string{
165165
utils.GetFlagVariantForTests("--mysql-server-query-timeout"), "1s",
166-
"--mysql_auth_server_static_file", clusterInstance.TmpDirectory + "/" + mysqlAuthServerStatic,
166+
"--mysql-auth-server-static-file", clusterInstance.TmpDirectory + "/" + mysqlAuthServerStatic,
167167
"--pprof-http",
168168
utils.GetFlagVariantForTests("--schema-change-signal") + "=false",
169169
}

go/test/endtoend/tabletmanager/main_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ func TestMain(m *testing.M) {
9494

9595
// List of users authorized to execute vschema ddl operations
9696
clusterInstance.VtGateExtraArgs = []string{
97-
"--vschema_ddl_authorized_users=%",
97+
"--vschema-ddl-authorized-users=%",
9898
"--enable-views",
99-
"--discovery_low_replication_lag", tabletUnhealthyThreshold.String(),
99+
"--discovery-low-replication-lag", tabletUnhealthyThreshold.String(),
100100
}
101101
// Set extra tablet args for lock timeout
102102
clusterInstance.VtTabletExtraArgs = []string{

go/test/endtoend/tabletmanager/tablet_health_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ func TestHealthCheck(t *testing.T) {
148148

149149
// stop the replica's source mysqld instance to break replication
150150
// and test that the replica tablet becomes unhealthy and non-serving after crossing
151-
// the tablet's --unhealthy-threshold and the gateway's --discovery_low_replication_lag
151+
// the tablet's --unhealthy-threshold and the gateway's --discovery-low-replication-lag
152152
err = primaryTablet.MysqlctlProcess.Stop()
153153
require.NoError(t, err)
154154

go/test/endtoend/transaction/single/main_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ func TestMain(m *testing.M) {
7171

7272
// Start vtgate
7373
clusterInstance.VtGatePlannerVersion = planbuilder.Gen4
74-
clusterInstance.VtGateExtraArgs = []string{"--transaction_mode", "SINGLE"}
74+
clusterInstance.VtGateExtraArgs = []string{"--transaction-mode", "SINGLE"}
7575
err = clusterInstance.StartVtgate()
7676
if err != nil {
7777
return 1

go/test/endtoend/transaction/twopc/fuzz/main_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func TestMain(m *testing.M) {
6666

6767
// Set extra args for twopc
6868
clusterInstance.VtGateExtraArgs = append(clusterInstance.VtGateExtraArgs,
69-
"--transaction_mode", "TWOPC",
69+
"--transaction-mode", "TWOPC",
7070
vtutils.GetFlagVariantForTests("--grpc-use-effective-callerid"),
7171
vtutils.GetFlagVariantForTests("--tablet-refresh-interval"), "2s",
7272
)

go/test/endtoend/transaction/twopc/metric/main_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func TestMain(m *testing.M) {
6666

6767
// Set extra args for twopc
6868
clusterInstance.VtGateExtraArgs = append(clusterInstance.VtGateExtraArgs,
69-
"--transaction_mode", "TWOPC",
69+
"--transaction-mode", "TWOPC",
7070
utils.GetFlagVariantForTests("--grpc-use-effective-callerid"),
7171
)
7272
clusterInstance.VtTabletExtraArgs = append(clusterInstance.VtTabletExtraArgs,

0 commit comments

Comments
 (0)