Skip to content

Commit

Permalink
merge master, resolve conflict
Browse files Browse the repository at this point in the history
Signed-off-by: Shlomi Noach <2607934+shlomi-noach@users.noreply.github.com>
  • Loading branch information
shlomi-noach committed Mar 7, 2021
2 parents d1992ac + 233877d commit afec18b
Showing 1 changed file with 49 additions and 5 deletions.
54 changes: 49 additions & 5 deletions test/ci_workflow_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,45 @@ const (
unitTestDatabases = "percona56, mysql57, mysql80, mariadb101, mariadb102, mariadb103"

clusterTestTemplate = "templates/cluster_endtoend_test.tpl"
clusterList = "11,12,13,14,15,16,17,18,19,20,21,22,23,24,26,27,vreplication_basic,vreplication_multicell,vreplication_cellalias,vreplication_v2,onlineddl_ghost,onlineddl_vrepl,onlineddl_vrepl_stress,vreplication_migrate,onlineddl_revert,tabletmanager_throttler,tabletmanager_throttler_custom_config"
)

var (
clusterList = []string{
"11",
"12",
"13",
"14",
"15",
"16",
"17",
"18",
"19",
"20",
"21",
"22",
"23",
"24",
"26",
"27",
"vreplication_basic",
"vreplication_multicell",
"vreplication_cellalias",
"vreplication_v2",
"onlineddl_ghost",
"onlineddl_vrepl",
"onlineddl_vrepl_stress",
"vreplication_migrate",
"onlineddl_revert",
"tabletmanager_throttler",
"tabletmanager_throttler_custom_config",
}
// TODO: currently some percona tools including xtrabackup are installed on all clusters, we can possibly optimize
// this by only installing them in the required clusters
clustersRequiringXtraBackup = clusterList
clustersRequiringMakeTools = "18,24"
clustersRequiringMakeTools = []string{
"18",
"24",
}
)

type unitTest struct {
Expand Down Expand Up @@ -72,6 +106,16 @@ func main() {
generateClusterWorkflows()
}

func canonnizeList(list []string) []string {
var output []string
for _, item := range list {
item = strings.TrimSpace(item)
if item != "" {
output = append(output, item)
}
}
return output
}
func parseList(csvList string) []string {
var list []string
for _, item := range strings.Split(csvList, ",") {
Expand All @@ -81,20 +125,20 @@ func parseList(csvList string) []string {
}

func generateClusterWorkflows() {
clusters := parseList(clusterList)
clusters := canonnizeList(clusterList)
for _, cluster := range clusters {
test := &clusterTest{
Name: fmt.Sprintf("Cluster (%s)", cluster),
Shard: cluster,
}
makeToolClusters := parseList(clustersRequiringMakeTools)
makeToolClusters := canonnizeList(clustersRequiringMakeTools)
for _, makeToolCluster := range makeToolClusters {
if makeToolCluster == cluster {
test.MakeTools = true
break
}
}
xtraBackupClusters := parseList(clustersRequiringXtraBackup)
xtraBackupClusters := canonnizeList(clustersRequiringXtraBackup)
for _, xtraBackupCluster := range xtraBackupClusters {
if xtraBackupCluster == cluster {
test.InstallXtraBackup = true
Expand Down

0 comments on commit afec18b

Please sign in to comment.