Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrating messaging python testcase to go #5795

Merged
merged 10 commits into from
Feb 7, 2020
20 changes: 20 additions & 0 deletions go/test/endtoend/cluster/cluster_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,27 @@ func getTablet(tabletGrpcPort int, hostname string) *tabletpb.Tablet {
return &tabletpb.Tablet{Hostname: hostname, PortMap: portMap}
}

// ExecuteQueriesUsingVtgate sends query to vtgate using vtgate session.
func ExecuteQueriesUsingVtgate(t *testing.T, session *vtgateconn.VTGateSession, query string) {
_, err := session.Execute(context.Background(), query, nil)
assert.Nil(t, err)
}

// NewConnParams creates ConnParams corresponds to given arguments.
func NewConnParams(port int, password, socketPath, keyspace string) mysql.ConnParams {
if port != 0 {
socketPath = ""
}
cp := mysql.ConnParams{
Uname: "vt_dba",
Port: port,
UnixSocket: socketPath,
Pass: password,
}

if keyspace != "" {
cp.DbName = "vt_" + keyspace
}

return cp
}
4 changes: 1 addition & 3 deletions go/test/endtoend/messaging/main_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2019 The Vitess Authors.
Copyright 2020 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 Down Expand Up @@ -34,8 +34,6 @@ var (
shard1Master *cluster.Vttablet
lookupMaster *cluster.Vttablet
hostname = "localhost"
testingID = 1
tableName = "vt_prepare_stmt_test"
cell = "zone1"
userKeyspace = "user"
lookupKeyspace = "lookup"
Expand Down
2 changes: 1 addition & 1 deletion go/test/endtoend/messaging/messaging_test.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2019 The Vitess Authors.
Copyright 2020 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 Down
22 changes: 0 additions & 22 deletions test/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,28 +67,6 @@
"RetryMax": 0,
"Tags": []
},
"merge_sharding": {
"File": "merge_sharding.py",
"Args": [],
"Command": [],
"Manual": false,
"Shard": 4,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the process so far has been to move python tests to shard 5 (which means they don't run at all) instead of removing them. but I'll approve this since we are very close to deleting them.

"RetryMax": 0,
"Tags": [
"worker_test"
]
},
"merge_sharding_bytes": {
"File": "merge_sharding_bytes.py",
"Args": [],
"Command": [],
"Manual": false,
"Shard": 4,
"RetryMax": 0,
"Tags": [
"worker_test"
]
},
"python_client": {
"File": "python_client_test.py",
"Args": [],
Expand Down