Skip to content

Gitops 9686 UI test app pruning - #1252

Open
trdoyle81 wants to merge 11 commits into
redhat-developer:masterfrom
trdoyle81:GITOPS-9686-UI-Test-App-Pruning
Open

Gitops 9686 UI test app pruning#1252
trdoyle81 wants to merge 11 commits into
redhat-developer:masterfrom
trdoyle81:GITOPS-9686-UI-Test-App-Pruning

Conversation

@trdoyle81

@trdoyle81 trdoyle81 commented Aug 10, 2026

Copy link
Copy Markdown
Member

What type of PR is this?

/kind enhancement

What does this PR do / why we need it:

This PR introduces a new E2E test suite to verify the Argo CD Application Pruning functionality via the UI.

Have you updated the necessary documentation?

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

Which issue(s) this PR fixes:

Fixes GITOPS-9686

Test acceptance criteria:

  • Unit Test
  • E2E Test

How to test changes / Special notes to the reviewer:

Verification Matrix
This PR has been successfully tested against the following cluster flavors and GitOps Operator versions:

GitOps Operator Version Non-FIPS Cluster FIPS Cluster
v1.21.x Yes Yes
v1.20.x Yes Yes
v1.19.x Yes Yes

To run the test locally:

./run-ui-tests.sh --project=chromium --workers=1 --trace on

Triona Doyle added 9 commits August 10, 2026 11:40
Signed-off-by: Triona Doyle <tekton@example.com>
Signed-off-by: Triona Doyle <tekton@example.com>
Signed-off-by: Triona Doyle <tekton@example.com>
Signed-off-by: Triona Doyle <tekton@example.com>
Signed-off-by: Triona Doyle <tekton@example.com>
Signed-off-by: Triona Doyle <tekton@example.com>
Signed-off-by: Triona Doyle <tekton@example.com>
Signed-off-by: Triona Doyle <tekton@example.com>
Signed-off-by: Triona Doyle <tekton@example.com>
@openshift-ci openshift-ci Bot added the kind/enhancement New feature or request label Aug 10, 2026
@openshift-ci

openshift-ci Bot commented Aug 10, 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 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: 8b20a17d-0a4a-4f04-9d46-7d576bc85f87

📥 Commits

Reviewing files that changed from the base of the PR and between 9ccc39a and 717e25d.

📒 Files selected for processing (1)
  • test/ui-e2e/tests/app-deletion.spec.ts
🔗 Linked repositories identified

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

  • argoproj-labs/argocd-operator (manual)
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/ui-e2e/tests/app-deletion.spec.ts

📝 Walkthrough

Summary by CodeRabbit

  • Tests
    • Added end-to-end coverage for deleting an application through the UI.
    • Verifies deletion confirmation, removal from the application list, and cascading cleanup of associated resources.
    • Includes setup and teardown checks to ensure test resources are fully synchronized and removed.

Walkthrough

The PR adds a Playwright E2E test that creates a uniquely named guestbook application, deletes it through the Argo CD UI, and verifies removal of the application, deployment, and service.

Changes

Application deletion E2E

Layer / File(s) Summary
Application provisioning and synchronization
test/ui-e2e/tests/app-deletion.spec.ts
The test creates a unique application from a pinned commit, removes stale child resources, and waits for synchronization with bounded polling.
UI deletion flow
test/ui-e2e/tests/app-deletion.spec.ts
The test selects the application tile, checks child resources, confirms deletion, and verifies that the tile disappears.
Deletion cleanup and backend verification
test/ui-e2e/tests/app-deletion.spec.ts
Teardown retries application deletion and verifies removal of the application, deployment, and service from Kubernetes.

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

Suggested reviewers: olivergondza, keithchong

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the GitOps issue and the new UI test for application pruning.
Description check ✅ Passed The description explains the new E2E test, its purpose, issue reference, verification matrix, and local test command.
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.

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: 2

🧹 Nitpick comments (3)
test/ui-e2e/tests/app-deletion.spec.ts (2)

17-39: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Pass the manifest on stdin instead of through a shell echo pipeline.

execSync runs the string through /bin/sh, so the YAML passes through shell quoting and echo. echo handling of backslashes and leading dashes is shell-dependent, and any future interpolation into appYaml (branch name, repo URL, env var) becomes command injection. execFileSync with the input option avoids both problems.

🔒 Proposed fix
-import { execSync } from 'child_process';
+import { execSync, execFileSync } from 'child_process';
-      execSync(`echo "${appYaml}" | oc apply -f -`, { stdio: 'pipe', timeout: 15000 });
+      execFileSync('oc', ['apply', '-f', '-'], { input: appYaml, stdio: 'pipe', timeout: 15000 });
🤖 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/ui-e2e/tests/app-deletion.spec.ts` around lines 17 - 39, Replace the
shell-based execSync echo pipeline in the app deployment test with execFileSync,
invoking oc apply directly and passing appYaml through the input option.
Preserve the existing timeout and stdio behavior while avoiding shell parsing
and interpolation risks.

Source: Linters/SAST tools


102-108: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Reuse the shared fixtures for login.

test/ui-e2e/src/fixtures.ts already exports a test whose page fixture performs the OpenShift login and throws a clear error when CLUSTER_PASSWORD is missing. This file re-implements that flow and uses non-null assertions on process.env, so a missing password produces the generic Login required but credentials (user/pass) not provided error from LoginPage. Import test from ../src/fixtures and drop the manual login block.

🤖 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/ui-e2e/tests/app-deletion.spec.ts` around lines 102 - 108, Replace the
manual LoginPage navigation and login flow in the test with the shared test
fixture exported by fixtures.ts. Import test from ../src/fixtures, use its
authenticated page fixture, and remove the loginPage creation, goto, and
loginViaOpenShift calls so missing CLUSTER_PASSWORD uses the fixture’s clear
validation error.
test/ui-e2e/tests/resource-tree.spec.ts (1)

9-9: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

argoVersion is destructured but never used.

Playwright instantiates a fixture when the test destructures it. This triggers the /api/version request and the console log in test/ui-e2e/src/fixtures.ts on every run, but the test body (lines 10-26) never reads the value. Remove argoVersion, or use it to select version-specific behavior in verifyResourceTreeLoaded/clickResourceNode.

🤖 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/ui-e2e/tests/resource-tree.spec.ts` at line 9, Remove the unused
argoVersion fixture from the test callback parameters in the “Navigate to app
details, open a Pod, and verify logs stream” test, unless the test is updated to
use it for version-specific behavior in verifyResourceTreeLoaded or
clickResourceNode.
🤖 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/ui-e2e/tests/app-deletion.spec.ts`:
- Around line 143-153: Update the Application deletion checks in
test/ui-e2e/tests/app-deletion.spec.ts at lines 143-153 and 80-90 to call `oc
get ... --ignore-not-found -o name`, treating empty stdout as confirmation that
the resource is deleted; set `backendDeleted` only for that result, and allow
genuine `oc` failures such as timeouts or connectivity errors to propagate.
Apply the same behavior in the `afterAll` cleanup verification at lines 80-90.
- Around line 141-155: The app-deletion test currently verifies only removal of
the Application CR, not its child resources. After the backendDeleted assertion
in the existing polling flow, query deployments and services in openshift-gitops
using the app.kubernetes.io/instance label for appName, and assert that no
matching resources remain; use the existing command-execution conventions or add
the required execFileSync import.

---

Nitpick comments:
In `@test/ui-e2e/tests/app-deletion.spec.ts`:
- Around line 17-39: Replace the shell-based execSync echo pipeline in the app
deployment test with execFileSync, invoking oc apply directly and passing
appYaml through the input option. Preserve the existing timeout and stdio
behavior while avoiding shell parsing and interpolation risks.
- Around line 102-108: Replace the manual LoginPage navigation and login flow in
the test with the shared test fixture exported by fixtures.ts. Import test from
../src/fixtures, use its authenticated page fixture, and remove the loginPage
creation, goto, and loginViaOpenShift calls so missing CLUSTER_PASSWORD uses the
fixture’s clear validation error.

In `@test/ui-e2e/tests/resource-tree.spec.ts`:
- Line 9: Remove the unused argoVersion fixture from the test callback
parameters in the “Navigate to app details, open a Pod, and verify logs stream”
test, unless the test is updated to use it for version-specific behavior in
verifyResourceTreeLoaded or clickResourceNode.
🪄 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: Enterprise

Run ID: 89620ae9-6480-4853-8d2f-12593d256369

📥 Commits

Reviewing files that changed from the base of the PR and between 7b70b65 and 068a855.

📒 Files selected for processing (2)
  • test/ui-e2e/tests/app-deletion.spec.ts
  • test/ui-e2e/tests/resource-tree.spec.ts
🔗 Linked repositories identified

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

  • argoproj-labs/argocd-operator (manual)

Comment thread test/ui-e2e/tests/app-deletion.spec.ts
Comment thread test/ui-e2e/tests/app-deletion.spec.ts
Signed-off-by: Triona Doyle <tekton@example.com>

@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/ui-e2e/tests/app-deletion.spec.ts`:
- Around line 192-217: Increase the test timeout configured by test.setTimeout
for the app-deletion test so it covers the UI assertions and the combined
backendDeleted and childrenGone polling budgets, including CLI execution
overhead. Apply the timeout increase before extending the child-resource retry
loop, and ensure any retry-count change remains within the enlarged timeout.
🪄 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: Enterprise

Run ID: 4e92d120-96cc-4c8e-8f16-e72a97a0fa08

📥 Commits

Reviewing files that changed from the base of the PR and between 068a855 and 9ccc39a.

📒 Files selected for processing (1)
  • test/ui-e2e/tests/app-deletion.spec.ts
🔗 Linked repositories identified

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

  • argoproj-labs/argocd-operator (manual)

Comment thread test/ui-e2e/tests/app-deletion.spec.ts
Signed-off-by: Triona Doyle <tekton@example.com>
@openshift-ci

openshift-ci Bot commented Aug 10, 2026

Copy link
Copy Markdown

@trdoyle81: 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 717e25d link false /test v4.14-kuttl-sequential
ci/prow/v4.19-kuttl-sequential 717e25d 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.

1 participant