Skip to content

Enable negative cluster and node pool listing test cases#4876

Closed
mvacula02 wants to merge 1 commit intomainfrom
mvacula/enable-negative-listing-tests
Closed

Enable negative cluster and node pool listing test cases#4876
mvacula02 wants to merge 1 commit intomainfrom
mvacula/enable-negative-listing-tests

Conversation

@mvacula02
Copy link
Copy Markdown
Collaborator

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.

@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Apr 14, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mvacula02
Once this PR has been reviewed and has the lgtm label, please assign miquelsi for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Apr 14, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@mvacula02
Copy link
Copy Markdown
Collaborator Author

/hold until #4862 is merged

@mvacula02 mvacula02 marked this pull request as ready for review April 14, 2026 16:13
Copilot AI review requested due to automatic review settings April 14, 2026 16:13
@openshift-ci openshift-ci bot requested review from bennerv and miquelsi April 14, 2026 16:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +91 to +92
nonExistentRgName := "non-existent-rg"
clusterPager := clusterClient.NewListByResourceGroupPager(nonExistentRgName, nil)
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines +92 to +98
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)
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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)

Copilot uses AI. Check for mistakes.
@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Apr 16, 2026

@mvacula02: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-parallel 9e22b67 link true /test e2e-parallel
ci/prow/cspr 9e22b67 link true /test cspr

Full PR test history. Your PR dashboard.

Details

Instructions 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.

@mvacula02
Copy link
Copy Markdown
Collaborator Author

closing as #4862 is now able to include the listing test cases enable

@mvacula02 mvacula02 closed this Apr 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants