Skip to content

Commit

Permalink
Merge pull request #2537 from aaraj7/master
Browse files Browse the repository at this point in the history
OCM-11710 | ci: fix id:38770
  • Loading branch information
openshift-merge-bot[bot] authored Oct 10, 2024
2 parents 55057af + 2208c2b commit a641d3d
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions tests/e2e/test_rosacli_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,6 @@ var _ = Describe("Classic cluster creation validation",
}
}
profile = profilesMap[profilesNames[helper.RandomInt(len(profilesNames))]]

})

AfterEach(func() {
Expand All @@ -791,6 +790,10 @@ var _ = Describe("Classic cluster creation validation",
command = "rosa create cluster --cluster-name " + profile.ClusterConfig.Name + " " + strings.Join(flags, " ")
rosalCommand = config.GenerateCommand(command)

if !rosalCommand.CheckFlagExist("--compute-machine-type") {
rosalCommand.AddFlags("--compute-machine-type", constants.DefaultInstanceType)
}

rosalCommand.AddFlags("--dry-run")
originalClusterName := rosalCommand.GetFlagValue("--cluster-name", true)
originalMachineType := rosalCommand.GetFlagValue("--compute-machine-type", true)
Expand All @@ -800,13 +803,25 @@ var _ = Describe("Classic cluster creation validation",
}
originalReplicas := rosalCommand.GetFlagValue("--replicas", true)

if rosalCommand.CheckFlagExist("--enable-autoscaling") {
rosalCommand.DeleteFlag("--enable-autoscaling", false)
}

if rosalCommand.CheckFlagExist("--min-replicas") {
rosalCommand.DeleteFlag("--min-replicas", true)
}

if rosalCommand.CheckFlagExist("--max-replicas") {
rosalCommand.DeleteFlag("--max-replicas", true)
}

invalidClusterNames := []string{
"1-test-1",
"-test-cluster",
"test-cluster-",
}
for _, cn := range invalidClusterNames {
By("Check the validation for cluster-name")
By("Check the validation for cluster-name " + cn)
rosalCommand.ReplaceFlagValue(map[string]string{
"--cluster-name": cn,
})
Expand Down

0 comments on commit a641d3d

Please sign in to comment.