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

✨ Enable using setup-envtest without a separate CLI #2810

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

tomasaschan
Copy link
Member

@tomasaschan tomasaschan commented May 3, 2024

This implements the proposal in #2790.

The implementation is incomplete so far; opening this mostly to show my progress and solicit feedback, as well as to avoid too many conflicts with initiatives like this one.

To do:

  • Copy existing implementation of supporting packages over into the main module
  • Implement use in the main module
  • Implement list in the main module
  • Implement cleanup in the main module
  • Implement sideload in the main module
  • Port tests for the workflows (at least the ones that make sense)
  • Clean up the setup-envtest module, removing duplicated code etc
  • Remove dependency on afero
  • Rebase onto whatever latest changes have happened in e.g. go.mod since I branched off
  • (Optional, possibly in a later PR) Re-implement the arg parsing and help parts of the main module with something a little less home-grown, probably something like https://github.com/spf13/cobra/

tomasaschan and others added 3 commits April 21, 2024 21:46
Since the error handling in the setup-envtest executable main path is
built on panics, recovers and os.Exit, it isn't ideal for re-using in a
version that downloads binaries within the test run.

However, much of the heavy lifting is performed by the remote, store and
versions packages, which _do_ properly return errors, and can readily be
reused in a new implementation.

This commit just duplicates the code from under tools/setup-envtest to
pkg/envtest, where we can build a new entry point that is easier to use
from within tests.
@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 3, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: tomasaschan
Once this PR has been reviewed and has the lgtm label, please assign fillzpp for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found 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 needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 3, 2024
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

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.

@k8s-ci-robot k8s-ci-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label May 3, 2024
@tomasaschan tomasaschan force-pushed the tomasaschan/setup-envtest-in-band branch from a12a6c3 to b3a4f85 Compare May 3, 2024 12:50
@tomasaschan
Copy link
Member Author

I will rebase this properly once #2811 merges, since I expect conflicts with that anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. 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

2 participants