Repository navigation
chore(e2e): Use DeferCleanup instead of AfterEach cleanup in sequential tests - #1539
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 |
|
Warning Review limit reachedThis review ran on the open-source allowance, not this organization's plan, because the pull request author doesn't have an assigned seat. Waiting won't change this — ask an organization admin to assign them a seat, or add seats in Billing if every seat is already assigned, then retry. Next included review available in 5 minutes. View limit details
|
|
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 Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
…al tests Refs redhat-developer#1464 Register the namespace cleanup with DeferCleanup right after the namespace is created in 1-060, 1-103, 1-113 controller role, 1-134 and 1-136, instead of keeping the cleanup func in a spec variable and calling it from AfterEach. AfterEach blocks that only did the cleanup are removed; 1-113 keeps its OutputDebugOnFail. Signed-off-by: gabriel.carmo <admin@gabrielandre.com.br>
7289b1f to
bd267be
Compare
|
/ok-to-test |
|
/retest-required |
Refs #1464
In 5 sequential specs (1-060, 1-103 imagepullpolicy, 1-113 controller role, 1-134, 1-136) the namespace cleanup func was kept in a spec variable and called from
AfterEach. It is now registered withDeferCleanupright after the namespace is created, so setup and cleanup are collocated and the spec variable goes away.AfterEachblocks that only did the cleanup are removed; 1-113 keeps itsOutputDebugOnFail, which still runs before the namespace is deleted.None of these specs mixes the cleanup with
RestoreSubscriptionToDefault, so the cleanup order relative to other teardown is unchanged.Left alone: 1-020 (cleanup guarded by
ns != nil) and specs that also restore the Subscription, clean up several namespaces or delete resources inAfterEach; those need case-by-case handling.Independent of #1531 to #1538 and #1504.
Testing
go vet ./test/openshift/e2e/ginkgo/sequential/is clean. E2E specs not run locally (no cluster).