Enable negative cluster and node pool listing test cases#4876
Enable negative cluster and node pool listing test cases#4876
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mvacula02 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Skipping CI for Draft Pull Request. |
|
/hold until #4862 is merged |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Enables previously blocked negative E2E test cases for listing clusters and node pools, so they run across environments as part of the customer scenario coverage.
Changes:
- Unblocks and executes negative listing tests for clusters in a non-existent resource group.
- Unblocks and executes negative listing tests for node pools when the parent cluster/RG doesn’t exist.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| nonExistentRgName := "non-existent-rg" | ||
| clusterPager := clusterClient.NewListByResourceGroupPager(nonExistentRgName, nil) |
There was a problem hiding this comment.
Using a fixed resource group name (\"non-existent-rg\") makes this test potentially flaky if that RG ever exists in the subscription (e.g., created manually or by another test run). To make the negative case deterministic, generate a guaranteed-unique RG name (e.g., prefix + random/UUID) that cannot collide with real RGs used in the environment.
| clusterPager := clusterClient.NewListByResourceGroupPager(nonExistentRgName, nil) | ||
| _, err = clusterPager.NextPage(ctx) | ||
| checkExpectedError(&errs, "cluster listing in non-existent resource group", err, "resource group not found") | ||
|
|
||
| // TEST CASE: ARO-22571 | ||
| By("attempting to list node pools in a resource group without a cluster") | ||
| emptyRgNodePoolPager := nodePoolClient.NewListByParentPager(*resourceGroup.Name, clusterParams.ClusterName, nil) |
There was a problem hiding this comment.
This 'RG without a cluster' negative test uses clusterParams.ClusterName, which is later created in the same resource group. If a previous run left the cluster behind (or cleanup failed), this call could unexpectedly succeed or return a different error, making the test non-deterministic. Prefer using a cluster name that is guaranteed not to exist (e.g., clusterParams.ClusterName + \"-does-not-exist\") or create/use a separate known-empty RG for this specific negative assertion.
| clusterPager := clusterClient.NewListByResourceGroupPager(nonExistentRgName, nil) | |
| _, err = clusterPager.NextPage(ctx) | |
| checkExpectedError(&errs, "cluster listing in non-existent resource group", err, "resource group not found") | |
| // TEST CASE: ARO-22571 | |
| By("attempting to list node pools in a resource group without a cluster") | |
| emptyRgNodePoolPager := nodePoolClient.NewListByParentPager(*resourceGroup.Name, clusterParams.ClusterName, nil) | |
| nonExistentClusterName := clusterParams.ClusterName + "-does-not-exist" | |
| clusterPager := clusterClient.NewListByResourceGroupPager(nonExistentRgName, nil) | |
| _, err = clusterPager.NextPage(ctx) | |
| checkExpectedError(&errs, "cluster listing in non-existent resource group", err, "resource group not found") | |
| // TEST CASE: ARO-22571 | |
| By("attempting to list node pools in a resource group without a cluster") | |
| emptyRgNodePoolPager := nodePoolClient.NewListByParentPager(*resourceGroup.Name, nonExistentClusterName, nil) |
|
@mvacula02: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
closing as #4862 is now able to include the listing test cases enable |
ARO-22570, ARO-22571
What
Enable negative test cases for cluster and node pool listing.
On hold until the bug fix #4862 is merged.
Why
Enables previously blocked test cases to run in all environments.
Testing
Tests are being enabled.