Skip to content

test: skip terminating source namespaces - #1249

Open
aali309 wants to merge 1 commit into
redhat-developer:masterfrom
aali309:AddTest-10532
Open

test: skip terminating source namespaces#1249
aali309 wants to merge 1 commit into
redhat-developer:masterfrom
aali309:AddTest-10532

Conversation

@aali309

@aali309 aali309 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind enhancement

What does this PR do / why we need it:

Direct copy/paste of the test in: argoproj-labs/argocd-operator#2292
Following: #1240 && #1247
Also see: https://redhat-internal.slack.com/archives/D07LM8HHZGC/p1786001038132709?thread_ts=1785330549.543099&cid=D07LM8HHZGC

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:

Signed-off-by: Atif Ali <atali@redhat.com>
@openshift-ci openshift-ci Bot added the kind/enhancement New feature or request label Aug 6, 2026
@openshift-ci
openshift-ci Bot requested review from AdamSaleh and chetan-rns August 6, 2026 14:37
@openshift-ci

openshift-ci Bot commented Aug 6, 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 varshab1210 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

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Summary by CodeRabbit

  • Tests
    • Added an end-to-end test validating that source namespaces stuck in Terminating do not block management of other matching namespaces.
    • Verified continued access, RBAC behavior, destination namespace creation, and successful application synchronization.
    • Added cleanup coverage to remove test resources and unblock namespace deletion.

Walkthrough

Added a sequential OpenShift Ginkgo test. The test verifies that a terminating wildcard-matched source namespace does not block management of another matching namespace or successful Application synchronization.

Changes

Terminating Source Namespace Handling

Layer / File(s) Summary
Test lifecycle and cleanup
test/openshift/e2e/ginkgo/sequential/1-132_validate_handle_terminating_source_namespaces_test.go
Defines the test context, Kubernetes state, diagnostics, namespace cleanup, and finalizer removal.
Terminating namespace scenario
test/openshift/e2e/ginkgo/sequential/1-132_validate_handle_terminating_source_namespaces_test.go
Configures wildcard source namespaces, places one namespace in Terminating state, and verifies management of another matching namespace.
Application deployment validation
test/openshift/e2e/ginkgo/sequential/1-132_validate_handle_terminating_source_namespaces_test.go
Checks controller arguments, creates the destination namespace and Role, authorizes the active source namespace, and verifies Application synchronization.

Estimated code review effort: 3 (Moderate) | ~25 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes the added test for skipping terminating source namespaces.
Description check ✅ Passed The description explains that the pull request adds a test for skipping terminating source namespaces.

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@test/openshift/e2e/ginkgo/sequential/1-132_validate_handle_terminating_source_namespaces_test.go`:
- Around line 97-99: In the sequential test cleanup, snapshot the original
argoCD.Spec.SourceNamespaces before the Update call at lines 97-99 and restore
it in AfterEach; likewise snapshot appProject.Spec.SourceNamespaces before the
change at lines 176-178 and restore it during cleanup, ensuring both shared
configurations are returned to their pre-test values.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 11fe9a02-fd0f-42bf-af58-17c6b495898f

📥 Commits

Reviewing files that changed from the base of the PR and between 5a448d9 and 3a9f29f.

📒 Files selected for processing (1)
  • test/openshift/e2e/ginkgo/sequential/1-132_validate_handle_terminating_source_namespaces_test.go
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • argoproj-labs/argocd-operator (manual)

Comment on lines +97 to +99
argocdFixture.Update(argoCD, func(ac *argov1beta1api.ArgoCD) {
ac.Spec.SourceNamespaces = []string{"src-1-132-*"}
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Restore all shared resource changes during cleanup.

AfterEach cleans created namespaces but does not restore shared ArgoCD and AppProject configuration. This leaks test state into later sequential specs.

  • test/openshift/e2e/ginkgo/sequential/1-132_validate_handle_terminating_source_namespaces_test.go#L97-L99: snapshot and restore argoCD.Spec.SourceNamespaces.
  • test/openshift/e2e/ginkgo/sequential/1-132_validate_handle_terminating_source_namespaces_test.go#L176-L178: snapshot and restore appProject.Spec.SourceNamespaces.
📍 Affects 1 file
  • test/openshift/e2e/ginkgo/sequential/1-132_validate_handle_terminating_source_namespaces_test.go#L97-L99 (this comment)
  • test/openshift/e2e/ginkgo/sequential/1-132_validate_handle_terminating_source_namespaces_test.go#L176-L178
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@test/openshift/e2e/ginkgo/sequential/1-132_validate_handle_terminating_source_namespaces_test.go`
around lines 97 - 99, In the sequential test cleanup, snapshot the original
argoCD.Spec.SourceNamespaces before the Update call at lines 97-99 and restore
it in AfterEach; likewise snapshot appProject.Spec.SourceNamespaces before the
change at lines 176-178 and restore it during cleanup, ensuring both shared
configurations are returned to their pre-test values.

Source: Path instructions

@aali309

aali309 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@varshab1210

Copy link
Copy Markdown
Member

/test v4.19-kuttl-sequential

@openshift-ci

openshift-ci Bot commented Aug 7, 2026

Copy link
Copy Markdown

@aali309: 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/v4.14-kuttl-sequential 3a9f29f link false /test v4.14-kuttl-sequential
ci/prow/v4.19-kuttl-sequential 3a9f29f link true /test v4.19-kuttl-sequential

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.

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

Labels

kind/enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants