Skip to content

chore(e2e): Use DeferCleanup for namespace cleanup in parallel tests 1-019 to 1-039 - #1531

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

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

Conversation

@Gabrielandre02

@Gabrielandre02 Gabrielandre02 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Refs #1464

Replaces defer cleanupFunc() with Ginkgo's DeferCleanup in 8 parallel specs (1-019, 1-023, 1-032 inclusions, 1-033, 1-034, 1-037, 1-038, 1-039). Setup and cleanup are collocated, and 1-023's AfterEach no longer needs a spec variable for the cleanup func.

First of several small PRs; no new helpers, so it is independent of #1504.

Testing

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

@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 jannfis 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 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.

@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 several end-to-end test cases to register namespace cleanup through the test framework’s cleanup mechanism.
    • Existing test scenarios and assertions remain unchanged.

Eight OpenShift E2E tests now register namespace cleanup with Ginkgo’s DeferCleanup instead of Go’s defer. One test also scopes its cleanup function locally.

Changes: OpenShift E2E cleanup

Layer / File(s) Summary
Register namespace cleanup with Ginkgo
test/openshift/e2e/ginkgo/parallel/1-019_validate_volume_mounts_test.go, 1-023_validate_repo_server_tls_test.go, 1-032_validate_resource_inclusions_test.go, 1-033_validate_resource_exclusions_test.go, 1-034_validate_webhook_notifications_test.go, 1-037_validate_argocd_setting_replicas_test.go, 1-038_validate_productized_images_test.go, 1-039_validate_fix_argocd-tls-certs-cm_test.go
These tests register namespace cleanup with DeferCleanup. The repo-server TLS test also moves the cleanup function into the test scope. Its AfterEach debug-output hook remains.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other

Suggested reviewers: jgwest, olivergondza

Merge Risk: Minimal · up to 966ff

This change only affects how E2E tests register namespace cleanup. It does not touch production code, and there is no concrete merge-blocking risk.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title states the main change: replacing deferred namespace cleanup with Ginkgo's DeferCleanup across parallel e2e tests 1-019 to 1-039. The raw summary and objectives confirm this matches the eigh…
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 the change: replacing defer cleanupFunc() with Ginkgo's DeferCleanup in eight parallel E2E specs. It names the affected specs, explains the collocation of setup and cleanup,…
Full details: Title check

Explanation

The title states the main change: replacing deferred namespace cleanup with Ginkgo's DeferCleanup across parallel e2e tests 1-019 to 1-039. The raw summary and objectives confirm this matches the eight modified specs. The 'chore(e2e):' prefix is a conventional-commit style and does not affect relevance.

Full details: Description check

Explanation

The description states the change: replacing defer cleanupFunc() with Ginkgo's DeferCleanup in eight parallel E2E specs. It names the affected specs, explains the collocation of setup and cleanup, and notes the removal of the AfterEach cleanup-function variable in 1-023. It also reports the verification performed (go vet clean, E2E not run). This matches the changeset summary.

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between a90784c and 966ff2a.

Files selected for processing: 8

  • test/openshift/e2e/ginkgo/parallel/1-019_validate_volume_mounts_test.go
  • test/openshift/e2e/ginkgo/parallel/1-023_validate_repo_server_tls_test.go
  • test/openshift/e2e/ginkgo/parallel/1-032_validate_resource_inclusions_test.go
  • test/openshift/e2e/ginkgo/parallel/1-033_validate_resource_exclusions_test.go
  • test/openshift/e2e/ginkgo/parallel/1-034_validate_webhook_notifications_test.go
  • test/openshift/e2e/ginkgo/parallel/1-037_validate_argocd_setting_replicas_test.go
  • test/openshift/e2e/ginkgo/parallel/1-038_validate_productized_images_test.go
  • test/openshift/e2e/ginkgo/parallel/1-039_validate_fix_argocd-tls-certs-cm_test.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; 1 remain after this review.

…1-019 to 1-039

Refs redhat-developer#1464

Replace defer cleanupFunc() inside It blocks, and the AfterEach in
1-023, with Ginkgo's DeferCleanup so setup and cleanup are collocated
and no cleanup func has to be kept in a spec variable.

Signed-off-by: gabriel.carmo <admin@gabrielandre.com.br>
@Gabrielandre02
Gabrielandre02 force-pushed the e2e-defercleanup-parallel-1 branch from 966ff2a to 1ad36c6 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

@jgwest
jgwest merged commit a744a48 into redhat-developer:master Nov 17, 2026
19 of 21 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