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

Merge Sharding tests in Go migrated from Python #5790

Merged
merged 5 commits into from
Feb 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/cluster_endtoend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
name: [11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
name: [11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 22]

steps:
- name: Set up Go
Expand Down
8 changes: 4 additions & 4 deletions go/test/endtoend/sharding/base_sharding.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,16 +183,16 @@ func CheckBinlogPlayerVars(t *testing.T, vttablet cluster.Vttablet, sourceShards
replicationSourceObj := reflect.ValueOf(tabletVars["VReplicationSource"])
replicationSourceValue := []string{}

assert.Equal(t,
fmt.Sprintf("%v", replicationSourceObj.MapKeys()),
fmt.Sprintf("%v", reflect.ValueOf(tabletVars["VReplicationSourceTablet"]).MapKeys()))
assert.Equal(t, len(replicationSourceObj.MapKeys()), len(reflect.ValueOf(tabletVars["VReplicationSourceTablet"]).MapKeys()))
deepthi marked this conversation as resolved.
Show resolved Hide resolved

for _, key := range replicationSourceObj.MapKeys() {
replicationSourceValue = append(replicationSourceValue,
fmt.Sprintf("%v", replicationSourceObj.MapIndex(key)))
}

assert.True(t, reflect.DeepEqual(replicationSourceValue, sourceShards))
for _, shard := range sourceShards {
assert.Containsf(t, replicationSourceValue, shard, "Source shard is not matched with vReplication shard value")
}

if secondBehindMaster != 0 {
secondBehindMaserMaxStr := fmt.Sprintf("%v", reflect.ValueOf(tabletVars["VReplicationSecondsBehindMasterMax"]))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
Copyright 2019 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.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package v3

import (
"testing"

sharding "vitess.io/vitess/go/test/endtoend/sharding/mergesharding"
)

// TestMergeShardingIntShardingKey - tests merge sharding using a INT column
func TestMergeShardingIntShardingKey(t *testing.T) {
sharding.TestMergesharding(t, false /* useVarbinaryShardingKeyType */)

}
Loading