Repository navigation
chore(e2e): Use DeferCleanup for namespace cleanup kept in spec variables in sequential tests - #1635
Conversation
…bles in sequential tests Signed-off-by: gabriel.carmo <admin@gabrielandre.com.br>
|
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 36 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 Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain 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. |
|
/ok-to-test |
What does this PR do?
Refs #1464
In 9 sequential specs the namespace cleanup funcs were kept in spec variables and called from
AfterEach, often behindif x != nilchecks. They are now registered withDeferCleanupright after each namespace is created, so the spec variables and the checks go away.AfterEachkeeps onlyOutputDebugOnFail, which still runs before the namespaces are deleted.BeforeEach, so theDeferCleanupis registered there, replacing thedefer cleanupFunc()inAfterEach.test-gitops-ns, which the Application creates, is registered once the namespace exists. It still ignores NotFound, because the spec deletes and recreates it.DeferCleanupruns in reverse order of registration. In 1-025, 1-108, 1-116 and 1-132 that is the orderAfterEachused. Two specs change order:Left for a follow-up, because their cleanup needs case-by-case handling: 1-027 (its namespace is created by an Application with automated sync, and the order would change), specs that restore the Subscription in
AfterEach, specs that remove finalizers or restore the default instance inAfterEach, and specs withdefer func() {...}()in the spec body.PR acceptance criteria:
make serve-docs: not applicable, no docs change.What type of PR is this?
/kind cleanup
Special notes to the reviewer:
go vet ./test/openshift/e2e/ginkgo/sequential/is clean and the package compiles. I did not run the E2E specs locally (no cluster).Independent of #1634, which covers the parallel specs.