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
⚠️ Move envtest setup under internal/envtest #4698
⚠️ Move envtest setup under internal/envtest #4698
Conversation
9c369be
to
9746243
Compare
In CAPA, we are using CleanUp(), CreateNamespace() from that package: helpers.TestEnvironment is part of our TestEnvironment: |
Do you overwrite the CRDs? |
Do you mean adding to scheme several times? If so, yes |
I meant more about how you're using this envtest, given that it mostly initializes Cluster API-related things. For example the webhooks registered expect the Cluster API CRDs, and internally it's using relative paths (to the CAPI repository) to determine how to install CRDs. To be fair, the Create/Cleanup functions should go somewhere else and this package should use them, rather than trying to expose and use it directly |
a6d8bd2
to
9621a0e
Compare
We don't use the initialization logic, just adding TestEnvironment struct into our TestEnvironment and handle its initialization. Just to use helper functions like CleanUp, I don't think CleanUp has specific assumptions. It is a small method we can copy what we need. |
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.
We don't use any of these in CAPZ. Overall lgtm.
9621a0e
to
1418e33
Compare
This change refactors all envtest suites to use the internal/envtest package instead of test/helpers. These helpers aren't useful to folks outside of Cluster API because of the nature how we setup the CRDs. Signed-off-by: Vince Prignano <vincepri@vmware.com>
1418e33
to
aa049f1
Compare
@vincepri: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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/test-infra repository. I understand the commands that are listed here. |
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
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vincepri 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 |
What this PR does / why we need it:
This change refactors all envtest suites to use the internal/envtest
package instead of test/helpers. These helpers aren't useful to folks
outside of Cluster API because of the nature how we setup the CRDs.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Related to #4687