Skip to content

added E2E for role ownership validation#1213

Open
alkakumari016 wants to merge 1 commit into
redhat-developer:v1.19from
alkakumari016:doenstream_1.19
Open

added E2E for role ownership validation#1213
alkakumari016 wants to merge 1 commit into
redhat-developer:v1.19from
alkakumari016:doenstream_1.19

Conversation

@alkakumari016

Copy link
Copy Markdown
Contributor

What type of PR is this?

Uncomment only one /kind line, and delete the rest.
For example, > /kind bug would simply become: /kind bug

/kind bug
/kind cleanup
/kind failing-test
/kind enhancement
/kind documentation
/kind code-refactoring

What does this PR do / why we need it:
added E2E for role ownership validation
Have you updated the necessary documentation?

  • Documentation update is required by this PR.
  • Documentation has been updated.

Which issue(s) this PR fixes:

Fixes #?

Test acceptance criteria:

  • Unit Test
  • E2E Test

How to test changes / Special notes to the reviewer:

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: bed78b4d-e5c2-452d-9afd-9eec822eebd1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@openshift-ci
openshift-ci Bot requested a review from keithchong July 13, 2026 07:46
@openshift-ci

openshift-ci Bot commented Jul 13, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign jgwest 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
openshift-ci Bot requested a review from wtam2018 July 13, 2026 07:46
Signed-off-by: Alka Kumari <alkumari@redhat.com>

@ranakan19 ranakan19 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

left some comments
I'm a bit unsure how the tests are checking for role ownership. I see the tests are verifying UID of the roles and rolebinding, but don't see anything about ownership. Could you also add references to the bug in the description for easier review?

ctx = context.Background()
})

It("validates that the role bug is fixed", func() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: we won't remember which role bug we are referring to here, we should rename it for our future selves.

afterServerRoleBindingReconcileUid := newServerClusterRoleBinding.GetUID()

By("comparing the UID to check if the ClusterRole was recreated")
Expect(initialControllerUid).To(Equal(afterControllerReconcileUid), "the ClusterRole was recreated")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if the intial and after reconcile uid are the same, doesn't that imply that it was not recreated?

Eventually(newServerClusterRoleBinding).Should(k8sFixture.ExistByName())

By("fetching UID of the clusterrole after reconciliation")
afterControllerReconcileUid := newControllerClusterRole.GetUID()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

could you rename other variables in L169-L175 as well?

Suggested change
afterControllerReconcileUid := newControllerClusterRole.GetUID()
afterReconcileControllerUid := newControllerClusterRole.GetUID()

var _ = Describe("GitOps Operator Sequential E2E Tests", func() {

const (
clusterRoleName = "argocd-agent-argocd-agent-agent-agent"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

curious if this is a test name for the role or the actual role name? lots of repeating agent in the name.
if this is just for test, i don't see a difference in the name or role and rolebinding name, could we try to have say a suffix in the name for role and rb?

},
}
Eventually(service).Should(k8sFixture.ExistByName())
Expect(string(service.Spec.Type)).To(Equal("ClusterIP"))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

test name gives an indication service type is checked dynamically to either be clusterIP or LoadBalancer, but this line is hardcoded to check only for ClusterIP.

Expect(string(service.Spec.Type)).To(Equal("ClusterIP"))

}
By("verifying primary agent Deployment has expected values")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
By("verifying primary agent Deployment has expected values")
By("verifying primary agent Deployment has expected labels")

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants