-
Notifications
You must be signed in to change notification settings - Fork 1.2k
✨ Clean up pkg/internal/testing #1540
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
✨ Clean up pkg/internal/testing #1540
Conversation
This moves testing/integration/internal into several more specific packages to prepare to refactor the rest and dedup with the main envtest code.
This moves control plane components to a new internal/testing/controlplane directory, unifying the first and second levels of internal packages.
This removes some legacy cruft from the process abstraction, namely: - the legacy health check support (startup message), since our supported etcd versions support the /health endpoint - URL populatation, since we end up needing multiple ports for the api server - gexec usage, since we don't need to check wait messages any more and the equivalent "send SIGTERM" and "wait for process to exit" parts are pretty straightforward for our usecases.
This only contained integration tests, which will be re-introduced in a cleaned up form shortly.
78a2f9f
to
b884743
Compare
This updates envtests, etc to use to the new refactored internal/testing/xyz paths (certs, addr, controlplane).
b884743
to
294af4f
Compare
if e.processState == nil { | ||
if err := e.setProcessState(); err != nil { | ||
if err := e.setState(); err != nil { | ||
return err | ||
} | ||
} |
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.
Is there any reason why we need to protect this?
Could we put everything inside a sync.Once?
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.
ditto here -- focusing on not changing functionality in this PR
this PR is supposed to generally not change behavior from what happened previously -- just refactor or prune a couple of blatantly unused things. |
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.
/approve
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: DirectXMan12, 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 |
/retest |
This cleans up
pkg/internal/testing
, hosting a series of nested packages into a flatter hierarchy that makes more sense for its current location, and prunes some old, unused functionality.The old state matches, more-or-less directly, the structure of
sigs.k8s.io/testing_frameworks
. When we took ownership of that code, we pretty much dropped it ininternal/testing
. This made it easier to import, but leaves us with a complicated mess that's more difficult to refactor and understand.We also ended up with some unused functionality -- some of this was due to mismatches between how CR needed to use
testing_frameworks
vs how it was written, other stuff was due to older versions of software that we no longer support (e.g. all the etcd versions we support have HTTP health check end points).This should make it easier to build on this code to add new features (e.g. support for secure serving).
Part of #1486.