Skip to content
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

Merged
merged 1 commit into from May 28, 2021

Conversation

vincepri
Copy link
Member

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

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels May 28, 2021
@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label May 28, 2021
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 28, 2021
@vincepri
Copy link
Member Author

Do you overwrite the CRDs?

@sedefsavas
Copy link

Do you mean adding to scheme several times? If so, yes

@vincepri
Copy link
Member Author

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

@vincepri vincepri force-pushed the move-envtest-internal branch 4 times, most recently from a6d8bd2 to 9621a0e Compare May 28, 2021 19:08
@sedefsavas
Copy link

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.

Copy link
Contributor

@CecileRobertMichon CecileRobertMichon left a 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.

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>
@k8s-ci-robot
Copy link
Contributor

@vincepri: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
pull-cluster-api-apidiff-main aa049f1 link /test pull-cluster-api-apidiff-main

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.

Copy link
Contributor

@CecileRobertMichon CecileRobertMichon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 28, 2021
@vincepri
Copy link
Member Author

/approve

@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 28, 2021
@k8s-ci-robot k8s-ci-robot merged commit a74b6a6 into kubernetes-sigs:master May 28, 2021
@k8s-ci-robot k8s-ci-robot added this to the v0.4 milestone May 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants