Skip to content

chore(e2e): Use DeferCleanup for namespace cleanup in sequential tests 1-083 to 1-135 - #1537

Merged
jgwest merged 1 commit into
redhat-developer:masterfrom
Gabrielandre02:e2e-defercleanup-sequential-2
Nov 17, 2026
Merged

jgwest merged 1 commit into
redhat-developer:masterfrom
Gabrielandre02:e2e-defercleanup-sequential-2

Conversation

@Gabrielandre02

@Gabrielandre02 Gabrielandre02 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Refs #1464

Replaces defer cleanupFunc(), defer cleanupArgoCD(), defer nsCleanup() and defer nsfCleanup() with Ginkgo's DeferCleanup in 8 sequential specs (1-083, 1-100, 1-101, 1-112, 1-113, 1-114, 1-120 must gather, 1-135). In 1-113 only the It-level cleanupFunc4 is converted. Cleanups still run in reverse registration order.

Left alone: specs that create the namespace in BeforeEach and clean it up from AfterEach (1-084, 1-092, 1-105, and the BeforeEach part of 1-113), 1-067 (changed by #1504), and the defer func() {...} state-restore blocks. Those need a different conversion and will follow separately.

Second of the sequential PRs, independent of #1536, #1531 to #1535 and #1504.

Testing

go vet ./test/openshift/e2e/ginkgo/sequential/ is clean. E2E specs not run locally (no cluster).

@openshift-ci
openshift-ci Bot requested review from keithchong and svghadi November 12, 2026 00:54
@openshift-ci

openshift-ci Bot commented Nov 12, 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

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Tests
    • Updated cleanup handling across OpenShift end-to-end tests covering applications, rollouts, namespaces, image pull policies, and secrets. Temporary resources are now cleaned up through the test framework’s cleanup lifecycle, helping ensure cleanup occurs at the appropriate point in each test. Test scenarios and their existing checks remain unchanged.

Sequential OpenShift E2E tests now register cleanup functions with Ginkgo’s DeferCleanup instead of Go’s defer.

Changes: Sequential E2E cleanup

Layer / File(s) Summary
Ginkgo-managed cleanup registration
test/openshift/e2e/ginkgo/sequential/1-083_validate_apps_in_any_namespace_test.go, test/openshift/e2e/ginkgo/sequential/1-100_validate_rollouts_resources_creation_test.go, test/openshift/e2e/ginkgo/sequential/1-101_validate_rollout_policyrules_test.go, test/openshift/e2e/ginkgo/sequential/1-112_validate_rollout_plugin_support_test.go, test/openshift/e2e/ginkgo/sequential/1-113_validate_namespacemanagement_test.go, test/openshift/e2e/ginkgo/sequential/1-114_validate_imagepullpolicy_test.go, test/openshift/e2e/ginkgo/sequential/1-120_validate_running_must_gather.go, test/openshift/e2e/ginkgo/sequential/1-135_validate_image_pull_secret_propagation.go
These tests register ArgoCD and namespace cleanup functions with Ginkgo’s DeferCleanup.

Estimated code review effort: 1 (Trivial) | ~4 minutes

Change: Other

Suggested reviewers: anandrkskd, jgwest

Merge Risk: Minimal · up to 5c5da

This test-only change moves cleanup registration to Ginkgo's DeferCleanup and has no visible production impact. No concrete merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: replacing deferred namespace cleanup with Ginkgo's DeferCleanup in the sequential e2e tests 1-083 to 1-135. The raw summary and objectives confirm this is the primary …
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.
Description check Passed The description states that it replaces defer cleanup calls with Ginkgo DeferCleanup in eight sequential specs, names the specs, lists the specs left unchanged and why, and reports a go vet run. This …
Full details: Title check

Explanation

The title names the main change: replacing deferred namespace cleanup with Ginkgo's DeferCleanup in the sequential e2e tests 1-083 to 1-135. The raw summary and objectives confirm this is the primary change. The title is 85 characters, slightly long, but it is specific and accurate.

Full details: Description check

Explanation

The description states that it replaces defer cleanup calls with Ginkgo DeferCleanup in eight sequential specs, names the specs, lists the specs left unchanged and why, and reports a go vet run. This matches the raw summary of changes, so the description is related to the changeset.

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 5fb7a03 and 5c5da07.

Files selected for processing: 8

  • test/openshift/e2e/ginkgo/sequential/1-083_validate_apps_in_any_namespace_test.go
  • test/openshift/e2e/ginkgo/sequential/1-100_validate_rollouts_resources_creation_test.go
  • test/openshift/e2e/ginkgo/sequential/1-101_validate_rollout_policyrules_test.go
  • test/openshift/e2e/ginkgo/sequential/1-112_validate_rollout_plugin_support_test.go
  • test/openshift/e2e/ginkgo/sequential/1-113_validate_namespacemanagement_test.go
  • test/openshift/e2e/ginkgo/sequential/1-114_validate_imagepullpolicy_test.go
  • test/openshift/e2e/ginkgo/sequential/1-120_validate_running_must_gather.go
  • test/openshift/e2e/ginkgo/sequential/1-135_validate_image_pull_secret_propagation.go
Linked repositories identified

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

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

@openshift-ci

openshift-ci Bot commented Nov 12, 2026

Copy link
Copy Markdown

Hi @Gabrielandre02. Thanks for your PR.

I'm waiting for a redhat-developer member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

…s 1-083 to 1-135

Refs redhat-developer#1464

Replace defer cleanup funcs inside It blocks with Ginkgo's DeferCleanup.
Specs that create the namespace in BeforeEach and clean it up from
AfterEach (1-084, 1-092, 1-105, 1-113) are left alone, as are 1-067
(changed by redhat-developer#1504) and the defer func(){...} state-restore blocks.

Signed-off-by: gabriel.carmo <admin@gabrielandre.com.br>
@Gabrielandre02
Gabrielandre02 force-pushed the e2e-defercleanup-sequential-2 branch from f68f1b2 to 5c5da07 Compare November 13, 2026 23:41
@jgwest

jgwest commented Nov 14, 2026

Copy link
Copy Markdown
Member

/ok-to-test

@Gabrielandre02

Copy link
Copy Markdown
Contributor Author

/retest-required

@jgwest

jgwest commented Nov 16, 2026

Copy link
Copy Markdown
Member

/retest

1 similar comment
@jgwest

jgwest commented Nov 17, 2026

Copy link
Copy Markdown
Member

/retest

@jgwest
jgwest merged commit d5b45e0 into redhat-developer:master Nov 17, 2026
18 of 19 checks passed
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