-
Notifications
You must be signed in to change notification settings - Fork 350
chore: add e2e tests for ArgoCD Agent #1056
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
Assisted by: Cursor Signed-off-by: Jayendra Parsai <jparsai@redhat.com>
| Copyright 2025. | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to make the variable names used in 1-051_validate_argocd_agent_principal_test.go and 1-052_validate_argocd_agent_agent_test.go more consistent with the variable names in the same tests in argocd-operator?
The reason I ask is that generally we want to keep the tests (roughly) in sync between the two projects. We do this by manually comparing the test files using a tool like meld/beyondcompare/winmerge/etc. (In my case I used meld and beyondcompare).
- The adhoc process for doing this is defined here.
- Note: it's perfectly fine for the test files to be different in other ways, for example,
fixture.SetEnvInOperatorSubscriptionOrDeployment()doesn't make sense in argocd-operator but DOES make sense in gitops-operator. - So we just want to make sure we do what we can to avoid differences between the files where it isn't needed (for example, variable names)
So, when I compare 1-051 files between argocd-operator and gitops-operator, (e.g. meld (path to 1-051 test in argocd-operator) (path to 1-0511 test in gitops-operator in PR)) I see that the files are very similar (which is good!) but the variables names between them are different.
For example, using beyondcompare (but any comparison tool will show the same):

This makes it more difficult to keep the tests in sync, as it means there are many diffs listed in the file comparison, even though the diff is only a variable name.
You can try this for yourself by comparing1-051 in your PR versus one in argocd-operator in the comparison tool of your choice.
WDYT? Presuming that makes sense, the change can be made in 1-051 and 1-052 in this PR. (AFAICT 1-053 didn't have the issue).
| ArgoCDDefaultRedisPort = 6379 | ||
|
|
||
| // ArgoCDAgentAgentDefaultImageName is the default image name for the ArgoCD agent's agent component. | ||
| ArgoCDAgentAgentDefaultImageName = "quay.io/argoprojlabs/argocd-agent:v0.5.2" | ||
|
|
||
| // ArgoCDAgentPrincipalDefaultImageName is the default image name for the ArgoCD agent's principal component. | ||
| ArgoCDAgentPrincipalDefaultImageName = "quay.io/argoprojlabs/argocd-agent:v0.5.2" | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than defining these values here, I would assume they can be read from the existing argocd-operator constants, for example, ArgoCDAgentAgentDefaultImageName in common/defaults.go?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated it. My impression was that we need to keep them separated, but now I am using it from argocd operator.
|
/test unit |
Assisted by: Cursor Signed-off-by: Jayendra Parsai <jparsai@redhat.com>
This PR is to add ArgoCD Agent E2E tests in GitOps Operator. It has tests to verify Principal, Agent components in stand alone as well as connected mode. These tests are isolating principal, managed and autonomous agents in different namespaces to simulate multi cluster environment.
Here is how namespaces are used for principal/agent resource isolation to simulate hub and 2 spokes in same cluster.
/kind enhancement
Assisted by: Cursor