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

✨ Clean up pkg/internal/testing #1540

Conversation

DirectXMan12
Copy link
Contributor

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 in internal/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.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 25, 2021
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels May 25, 2021
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.
@DirectXMan12 DirectXMan12 force-pushed the refactor/shuffle-internal-testing branch from 78a2f9f to b884743 Compare May 25, 2021 20:41
This updates envtests, etc to use to the new refactored
internal/testing/xyz paths (certs, addr, controlplane).
@DirectXMan12 DirectXMan12 force-pushed the refactor/shuffle-internal-testing branch from b884743 to 294af4f Compare May 25, 2021 20:43
Comment on lines 67 to 71
if e.processState == nil {
if err := e.setProcessState(); err != nil {
if err := e.setState(); err != nil {
return err
}
}
Copy link
Member

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?

Copy link
Contributor Author

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

@DirectXMan12
Copy link
Contributor Author

this PR is supposed to generally not change behavior from what happened previously -- just refactor or prune a couple of blatantly unused things.

Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

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

/approve

@vincepri
Copy link
Member

/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 26, 2021
@k8s-ci-robot
Copy link
Contributor

[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:
  • OWNERS [DirectXMan12,vincepri]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@vincepri
Copy link
Member

/retest

@k8s-ci-robot k8s-ci-robot merged commit 72fc2c6 into kubernetes-sigs:master May 26, 2021
@k8s-ci-robot k8s-ci-robot added this to the v0.9.x milestone May 26, 2021
@DirectXMan12 DirectXMan12 deleted the refactor/shuffle-internal-testing branch May 26, 2021 20:58
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

3 participants