Skip to content

Commit

Permalink
OCM-11356 | ci: fix id:56786,73638
Browse files Browse the repository at this point in the history
  • Loading branch information
86254860 committed Sep 23, 2024
1 parent a0fbd64 commit c34bd0f
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tests/e2e/hcp_machine_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ var _ = Describe("HCP Machine Pool", labels.Feature.Machinepool, func() {
"--tags", strings.Join(tags, ","),
)
Expect(err).ToNot(HaveOccurred(), out.String())
defer machinePoolService.DeleteMachinePool(clusterID, mpID)

By("Describe the machinepool")
description, err := machinePoolService.DescribeAndReflectMachinePool(clusterID, mpID)
Expand Down Expand Up @@ -422,13 +423,13 @@ var _ = Describe("HCP Machine Pool", labels.Feature.Machinepool, func() {
Expect(err).To(HaveOccurred())
Expect(err.Error()).Should(ContainSubstring("Replicas must be a non-negative integer"))

By("with replicas > 180")
_, err = machinePoolService.CreateMachinePool(clusterID, "anything", "--replicas", "181")
By("with replicas > the maximum")
_, err = machinePoolService.CreateMachinePool(clusterID, "anything", "--replicas", "501")
Expect(err).To(HaveOccurred())
Expect(err.Error()).
Should(
ContainSubstring("Replicas+Autoscaling.Min: The total number of compute nodes for a single cluster"))
Expect(err.Error()).Should(ContainSubstring("exceeds the maximum allowed: 180"))
Expect(err.Error()).Should(ContainSubstring("exceeds the maximum allowed"))

By("with invalid name")
_, err = machinePoolService.CreateMachinePool(clusterID, "anything%^#@", "--replicas", "2")
Expand Down Expand Up @@ -467,18 +468,18 @@ var _ = Describe("HCP Machine Pool", labels.Feature.Machinepool, func() {
Expect(err).To(HaveOccurred())
Expect(err.Error()).Should(ContainSubstring("Autoscaling must be enabled in order to set min and max replicas"))

By("with max-replicas > 180")
By("with max-replicas > the maximum")
_, err = machinePoolService.CreateMachinePool(
clusterID,
"anything",
"--enable-autoscaling",
"--min-replicas", "3",
"--max-replicas", "181")
"--max-replicas", "501")
Expect(err).To(HaveOccurred())
Expect(err.Error()).
Should(
ContainSubstring("Replicas+Autoscaling.Max: The total number of compute nodes for a single cluster"))
Expect(err.Error()).Should(ContainSubstring("exceeds the maximum allowed: 180"))
Expect(err.Error()).Should(ContainSubstring("exceeds the maximum allowed"))

By("with wrong instance-type")
_, err = machinePoolService.CreateMachinePool(clusterID, "anything", "--replicas", "2", "--instance-type", "wrong")
Expand Down

0 comments on commit c34bd0f

Please sign in to comment.