New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make test framework easier to re-use #86177
Conversation
a8bf065
to
773fbea
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: deads2k The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
github flake (webhook faster than availability of refs?) |
/test pull-kubernetes-e2e-gce |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
For cleanup purposes the ginkgo.DeferCleanup is a better replacement for f.AddAfterEach: - the cleanup only gets executed when the corresponding setup code ran and can use the same local variables - the callback runs after the test and before the framework deletes namespaces (as before) - if one callback fails, the others still get executed For the original purpose (kubernetes#86177 "This is very useful for custom gathering scripts.") it is now possible to use ginkgo.AfterEach because it will always get executed. Just beware that its callbacks run in first-in-first-out order.
For cleanup purposes the ginkgo.DeferCleanup is a better replacement for f.AddAfterEach: - the cleanup only gets executed when the corresponding setup code ran and can use the same local variables - the callback runs after the test and before the framework deletes namespaces (as before) - if one callback fails, the others still get executed For the original purpose (kubernetes#86177 "This is very useful for custom gathering scripts.") it is now possible to use ginkgo.AfterEach because it will always get executed. Just beware that its callbacks run in first-in-first-out order.
Fixes a few issues for extenders of the test Framework
/kind cleanup
/priority important-soon
@kubernetes/sig-testing-pr-reviews