Skip to content

Commit

Permalink
Fix#5
Browse files Browse the repository at this point in the history
Signed-off-by: Parthvi Vala <parthvi.vala@suse.com>
  • Loading branch information
valaparthvi committed Oct 29, 2024
1 parent 85b8015 commit 07869e5
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion hosted/aks/p1/p1_import_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ var _ = Describe("P1Import", func() {
updateCloudCredentialsCheck(cluster, ctx.RancherAdminClient)
})

FIt("should fail to update with invalid cloud credential and update when the cloud credentials becomes valid", func() {
FIt("should fail to update with invalid (deleted) cloud credential and update when the cloud credentials becomes valid", func() {
testCaseID = 238
invalidateCloudCredentialsCheck(cluster, ctx.RancherAdminClient, ctx.CloudCredID)
})
Expand Down
2 changes: 1 addition & 1 deletion hosted/aks/p1/p1_provisioning_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ var _ = Describe("P1Provisioning", func() {
updateCloudCredentialsCheck(cluster, ctx.RancherAdminClient)
})

FIt("should fail to update with invalid cloud credential and update when the cloud credentials becomes valid", func() {
FIt("should fail to update with invalid (deleted) cloud credential and update when the cloud credentials becomes valid", func() {
testCaseID = 299
invalidateCloudCredentialsCheck(cluster, ctx.RancherAdminClient, ctx.CloudCredID)
})
Expand Down
16 changes: 13 additions & 3 deletions hosted/aks/p1/p1_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@ func invalidateCloudCredentialsCheck(cluster *management.Cluster, client *ranche
Expect(err).To(BeNil())
err = client.Management.CloudCredential.Delete(currentCC)
Expect(err).To(BeNil())
GinkgoLogr.Info(fmt.Sprintf("Deleting existing Cloud Credentials: %s:%s", currentCC.Name, currentCC.ID))
const scaleCount int64 = 2
cluster, err = helper.ScaleNodePool(cluster, client, scaleCount, false, false)
Expect(err).To(BeNil())
Expand Down Expand Up @@ -563,11 +564,20 @@ func invalidateCloudCredentialsCheck(cluster *management.Cluster, client *ranche
Expect(*nodepool.Count).To(Equal(scaleCount))
}

for _, nodepool := range cluster.AKSStatus.UpstreamSpec.NodePools {
Expect(*nodepool.Count).To(Equal(scaleCount))
}
// This is sometimes flaky, so using Eventually
Eventually(func() bool {
cluster, err = client.Management.Cluster.ByID(cluster.ID)
Expect(err).NotTo(HaveOccurred())
for _, nodepool := range cluster.AKSStatus.UpstreamSpec.NodePools {
if *nodepool.Count != scaleCount {
return false
}
}
return true
}, "5m", "5s").Should(BeTrue(), "Timed out waiting for upstream spec to reflect node count")

// Update the context so that any future tests are not disrupted
GinkgoLogr.Info(fmt.Sprintf("Updating the new Cloud Credentials %s to the context", newCCID))
ctx.CloudCredID = newCCID
}

Expand Down

0 comments on commit 07869e5

Please sign in to comment.