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

VPA: separate module for e2e tests #2531

Merged
merged 5 commits into from
Nov 15, 2019

Conversation

wozniakjan
Copy link
Member

@wozniakjan wozniakjan commented Nov 13, 2019

Effort to simplify go modules tracking even more than #2530 by removing the requirement for replace directives with filesystem absolute paths and separate go module for the e2e tests.

It is generally not recommended to depend on k8s.io/kubernetes kubernetes/kubernetes#79384 (comment), and opens doors to issues for people who may want to depend on VPA - kubernetes/kube-state-metrics#949 (comment)

It looks like the e2e tests are the only large obstacle in removing the dependency on k8s.io/kuberentes. So I would like to propose separate go module for the e2e tests to simplify depending on VPA and only make life hard for those who decide to depend on VPA e2e package. Input from maintainers is greatly appreciated.

checking imports - grep output

$ grep k8s.io/autoscaler/vertical-pod-autoscaler --include=*.go -nre '[[:blank:]]"k8s.io/kubernetes' | grep -v "$vendor/k8s.io/kubernetes"
./pkg/utils/metrics/metrics.go:28:	_ "k8s.io/kubernetes/pkg/client/metrics/prometheus" // for client-go metrics registration
./e2e/v1/updater.go:33:	"k8s.io/kubernetes/test/e2e/framework"
./e2e/v1/updater.go:34:	framework_deployment "k8s.io/kubernetes/test/e2e/framework/deployment"
./e2e/v1/updater.go:35:	framework_job "k8s.io/kubernetes/test/e2e/framework/job"
./e2e/v1/updater.go:36:	framework_rs "k8s.io/kubernetes/test/e2e/framework/replicaset"
./e2e/v1/updater.go:37:	framework_ss "k8s.io/kubernetes/test/e2e/framework/statefulset"
./e2e/v1/updater.go:38:	testutils "k8s.io/kubernetes/test/utils"
./e2e/v1/autoscaling_utils.go:34:	api "k8s.io/kubernetes/pkg/apis/core"
./e2e/v1/autoscaling_utils.go:35:	"k8s.io/kubernetes/test/e2e/framework"
./e2e/v1/autoscaling_utils.go:36:	"k8s.io/kubernetes/test/e2e/framework/replicaset"
./e2e/v1/autoscaling_utils.go:37:	e2eservice "k8s.io/kubernetes/test/e2e/framework/service"
./e2e/v1/autoscaling_utils.go:38:	testutils "k8s.io/kubernetes/test/utils"
./e2e/v1/autoscaling_utils.go:42:	imageutils "k8s.io/kubernetes/test/utils/image"
./e2e/v1/e2e_test.go:33:	"k8s.io/kubernetes/test/e2e/framework"
./e2e/v1/e2e_test.go:34:	"k8s.io/kubernetes/test/e2e/framework/config"
./e2e/v1/e2e_test.go:35:	"k8s.io/kubernetes/test/e2e/framework/testfiles"
./e2e/v1/e2e_test.go:36:	"k8s.io/kubernetes/test/e2e/framework/viperconfig"
./e2e/v1/e2e_test.go:37:	"k8s.io/kubernetes/test/e2e/generated"
./e2e/v1/e2e_test.go:38:	"k8s.io/kubernetes/test/utils/image"
./e2e/v1/e2e_test.go:41:	_ "k8s.io/kubernetes/test/e2e/apimachinery"
./e2e/v1/e2e_test.go:42:	_ "k8s.io/kubernetes/test/e2e/apps"
./e2e/v1/e2e_test.go:43:	_ "k8s.io/kubernetes/test/e2e/auth"
./e2e/v1/e2e_test.go:44:	_ "k8s.io/kubernetes/test/e2e/autoscaling"
./e2e/v1/e2e_test.go:45:	_ "k8s.io/kubernetes/test/e2e/cloud"
./e2e/v1/e2e_test.go:46:	_ "k8s.io/kubernetes/test/e2e/common"
./e2e/v1/e2e_test.go:47:	_ "k8s.io/kubernetes/test/e2e/instrumentation"
./e2e/v1/e2e_test.go:48:	_ "k8s.io/kubernetes/test/e2e/kubectl"
./e2e/v1/e2e_test.go:49:	_ "k8s.io/kubernetes/test/e2e/lifecycle"
./e2e/v1/e2e_test.go:50:	_ "k8s.io/kubernetes/test/e2e/lifecycle/bootstrap"
./e2e/v1/e2e_test.go:51:	_ "k8s.io/kubernetes/test/e2e/network"
./e2e/v1/e2e_test.go:52:	_ "k8s.io/kubernetes/test/e2e/node"
./e2e/v1/e2e_test.go:53:	_ "k8s.io/kubernetes/test/e2e/scalability"
./e2e/v1/e2e_test.go:54:	_ "k8s.io/kubernetes/test/e2e/scheduling"
./e2e/v1/e2e_test.go:55:	_ "k8s.io/kubernetes/test/e2e/servicecatalog"
./e2e/v1/e2e_test.go:56:	_ "k8s.io/kubernetes/test/e2e/storage"
./e2e/v1/e2e_test.go:57:	_ "k8s.io/kubernetes/test/e2e/storage/external"
./e2e/v1/e2e_test.go:58:	_ "k8s.io/kubernetes/test/e2e/ui"
./e2e/v1/e2e_test.go:59:	_ "k8s.io/kubernetes/test/e2e/windows"
./e2e/v1/recommender.go:32:	"k8s.io/kubernetes/test/e2e/framework"
./e2e/v1/recommender.go:33:	framework_deployment "k8s.io/kubernetes/test/e2e/framework/deployment"
./e2e/v1/common.go:37:	"k8s.io/kubernetes/test/e2e/framework"
./e2e/v1/common.go:38:	framework_deployment "k8s.io/kubernetes/test/e2e/framework/deployment"
./e2e/v1/actuation.go:30:	"k8s.io/kubernetes/test/e2e/framework"
./e2e/v1/actuation.go:31:	framework_deployment "k8s.io/kubernetes/test/e2e/framework/deployment"
./e2e/v1/e2e.go:34:	commontest "k8s.io/kubernetes/test/e2e/common"
./e2e/v1/e2e.go:35:	"k8s.io/kubernetes/test/e2e/framework"
./e2e/v1/e2e.go:36:	e2elog "k8s.io/kubernetes/test/e2e/framework/log"
./e2e/v1/e2e.go:42:	_ "k8s.io/kubernetes/test/e2e/framework/providers/aws"
./e2e/v1/e2e.go:43:	_ "k8s.io/kubernetes/test/e2e/framework/providers/azure"
./e2e/v1/e2e.go:44:	_ "k8s.io/kubernetes/test/e2e/framework/providers/gce"
./e2e/v1/e2e.go:45:	_ "k8s.io/kubernetes/test/e2e/framework/providers/kubemark"
./e2e/v1/e2e.go:46:	_ "k8s.io/kubernetes/test/e2e/framework/providers/openstack"
./e2e/v1/e2e.go:47:	_ "k8s.io/kubernetes/test/e2e/framework/providers/vsphere"
./e2e/v1/admission_controller.go:27:	"k8s.io/kubernetes/test/e2e/framework"
./e2e/v1/admission_controller.go:28:	framework_deployment "k8s.io/kubernetes/test/e2e/framework/deployment"
./e2e/v1/full_vpa.go:29:	e2e_common "k8s.io/kubernetes/test/e2e/common"
./e2e/v1/full_vpa.go:30:	"k8s.io/kubernetes/test/e2e/framework"
./e2e/v1beta2/updater.go:33:	"k8s.io/kubernetes/test/e2e/framework"
./e2e/v1beta2/updater.go:34:	framework_deployment "k8s.io/kubernetes/test/e2e/framework/deployment"
./e2e/v1beta2/updater.go:35:	framework_job "k8s.io/kubernetes/test/e2e/framework/job"
./e2e/v1beta2/updater.go:36:	framework_rs "k8s.io/kubernetes/test/e2e/framework/replicaset"
./e2e/v1beta2/updater.go:37:	framework_ss "k8s.io/kubernetes/test/e2e/framework/statefulset"
./e2e/v1beta2/updater.go:38:	testutils "k8s.io/kubernetes/test/utils"
./e2e/v1beta2/autoscaling_utils.go:34:	api "k8s.io/kubernetes/pkg/apis/core"
./e2e/v1beta2/autoscaling_utils.go:35:	"k8s.io/kubernetes/test/e2e/framework"
./e2e/v1beta2/autoscaling_utils.go:36:	"k8s.io/kubernetes/test/e2e/framework/replicaset"
./e2e/v1beta2/autoscaling_utils.go:37:	e2eservice "k8s.io/kubernetes/test/e2e/framework/service"
./e2e/v1beta2/autoscaling_utils.go:38:	testutils "k8s.io/kubernetes/test/utils"
./e2e/v1beta2/autoscaling_utils.go:42:	imageutils "k8s.io/kubernetes/test/utils/image"
./e2e/v1beta2/e2e_test.go:33:	"k8s.io/kubernetes/test/e2e/framework"
./e2e/v1beta2/e2e_test.go:34:	"k8s.io/kubernetes/test/e2e/framework/config"
./e2e/v1beta2/e2e_test.go:35:	"k8s.io/kubernetes/test/e2e/framework/testfiles"
./e2e/v1beta2/e2e_test.go:36:	"k8s.io/kubernetes/test/e2e/framework/viperconfig"
./e2e/v1beta2/e2e_test.go:37:	"k8s.io/kubernetes/test/e2e/generated"
./e2e/v1beta2/e2e_test.go:38:	"k8s.io/kubernetes/test/utils/image"
./e2e/v1beta2/e2e_test.go:41:	_ "k8s.io/kubernetes/test/e2e/apimachinery"
./e2e/v1beta2/e2e_test.go:42:	_ "k8s.io/kubernetes/test/e2e/apps"
./e2e/v1beta2/e2e_test.go:43:	_ "k8s.io/kubernetes/test/e2e/auth"
./e2e/v1beta2/e2e_test.go:44:	_ "k8s.io/kubernetes/test/e2e/autoscaling"
./e2e/v1beta2/e2e_test.go:45:	_ "k8s.io/kubernetes/test/e2e/cloud"
./e2e/v1beta2/e2e_test.go:46:	_ "k8s.io/kubernetes/test/e2e/common"
./e2e/v1beta2/e2e_test.go:47:	_ "k8s.io/kubernetes/test/e2e/instrumentation"
./e2e/v1beta2/e2e_test.go:48:	_ "k8s.io/kubernetes/test/e2e/kubectl"
./e2e/v1beta2/e2e_test.go:49:	_ "k8s.io/kubernetes/test/e2e/lifecycle"
./e2e/v1beta2/e2e_test.go:50:	_ "k8s.io/kubernetes/test/e2e/lifecycle/bootstrap"
./e2e/v1beta2/e2e_test.go:51:	_ "k8s.io/kubernetes/test/e2e/network"
./e2e/v1beta2/e2e_test.go:52:	_ "k8s.io/kubernetes/test/e2e/node"
./e2e/v1beta2/e2e_test.go:53:	_ "k8s.io/kubernetes/test/e2e/scalability"
./e2e/v1beta2/e2e_test.go:54:	_ "k8s.io/kubernetes/test/e2e/scheduling"
./e2e/v1beta2/e2e_test.go:55:	_ "k8s.io/kubernetes/test/e2e/servicecatalog"
./e2e/v1beta2/e2e_test.go:56:	_ "k8s.io/kubernetes/test/e2e/storage"
./e2e/v1beta2/e2e_test.go:57:	_ "k8s.io/kubernetes/test/e2e/storage/external"
./e2e/v1beta2/e2e_test.go:58:	_ "k8s.io/kubernetes/test/e2e/ui"
./e2e/v1beta2/e2e_test.go:59:	_ "k8s.io/kubernetes/test/e2e/windows"
./e2e/v1beta2/recommender.go:32:	"k8s.io/kubernetes/test/e2e/framework"
./e2e/v1beta2/recommender.go:33:	framework_deployment "k8s.io/kubernetes/test/e2e/framework/deployment"
./e2e/v1beta2/common.go:37:	"k8s.io/kubernetes/test/e2e/framework"
./e2e/v1beta2/common.go:38:	framework_deployment "k8s.io/kubernetes/test/e2e/framework/deployment"
./e2e/v1beta2/actuation.go:30:	"k8s.io/kubernetes/test/e2e/framework"
./e2e/v1beta2/actuation.go:31:	framework_deployment "k8s.io/kubernetes/test/e2e/framework/deployment"
./e2e/v1beta2/e2e.go:34:	commontest "k8s.io/kubernetes/test/e2e/common"
./e2e/v1beta2/e2e.go:35:	"k8s.io/kubernetes/test/e2e/framework"
./e2e/v1beta2/e2e.go:36:	e2elog "k8s.io/kubernetes/test/e2e/framework/log"
./e2e/v1beta2/e2e.go:42:	_ "k8s.io/kubernetes/test/e2e/framework/providers/aws"
./e2e/v1beta2/e2e.go:43:	_ "k8s.io/kubernetes/test/e2e/framework/providers/azure"
./e2e/v1beta2/e2e.go:44:	_ "k8s.io/kubernetes/test/e2e/framework/providers/gce"
./e2e/v1beta2/e2e.go:45:	_ "k8s.io/kubernetes/test/e2e/framework/providers/kubemark"
./e2e/v1beta2/e2e.go:46:	_ "k8s.io/kubernetes/test/e2e/framework/providers/openstack"
./e2e/v1beta2/e2e.go:47:	_ "k8s.io/kubernetes/test/e2e/framework/providers/vsphere"
./e2e/v1beta2/admission_controller.go:27:	"k8s.io/kubernetes/test/e2e/framework"
./e2e/v1beta2/admission_controller.go:28:	framework_deployment "k8s.io/kubernetes/test/e2e/framework/deployment"
./e2e/v1beta2/full_vpa.go:29:	e2e_common "k8s.io/kubernetes/test/e2e/common"
./e2e/v1beta2/full_vpa.go:30:	"k8s.io/kubernetes/test/e2e/framework"
./vendor/k8s.io/kubelet/config/v1beta1/types.go:655:	// "k8s.io/kubernetes/pkg/features/kube_features.go".
./vendor/k8s.io/cloud-provider/service/helpers/helper.go:28:This file is duplicated from "k8s.io/kubernetes/pkg/api/v1/service/util.go"
./vendor/k8s.io/cli-runtime/pkg/printers/sourcechecker.go:29:		"k8s.io/kubernetes/pkg/apis/"

Closes: #2507

@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. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Nov 13, 2019
@wozniakjan wozniakjan mentioned this pull request Nov 13, 2019
1 task
@wozniakjan
Copy link
Member Author

cc: @tariq1890, @bskiba

@bskiba
Copy link
Member

bskiba commented Nov 15, 2019

I'm in favor of this change. Thank you for taking time to do this for us.

To make it easier for me to review this, can you split the change into 3 commits:

  • Vendor directory changes
  • go.mod and go.sum changes
  • Any changes to the code itself (there's probably not many, but at least the import in utils/metrics changed, right?)

One additional thing that needs changing is the Makefiles, we need to remove the godeps from building. However, I can do it in a followup PR. This one is huge as it is :)
(Example: https://github.com/kubernetes/autoscaler/blob/master/vertical-pod-autoscaler/pkg/recommender/Makefile#L15)

@bskiba
Copy link
Member

bskiba commented Nov 15, 2019

One more thing, I'd rather stick with go 1.12 for now if that's ok.

@wozniakjan wozniakjan changed the title [WIP] VPA: separate module for e2e tests VPA: separate module for e2e tests Nov 15, 2019
@wozniakjan wozniakjan marked this pull request as ready for review November 15, 2019 13:10
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 15, 2019
@wozniakjan
Copy link
Member Author

wozniakjan commented Nov 15, 2019

Thanks for a quick feedback. I split the PR out to multiple commits for easier review and added the k8s deps update script - 56a1c7a. With other dependencies, it should be fine using standard go get -u command.

One additional thing that needs changing is the Makefiles, we need to remove the godeps from building. However, I can do it in a followup PR. This one is huge as it is :)

I agree that a followup PR makes sense here if it isn't causing any problems in the interim

@bskiba
Copy link
Member

bskiba commented Nov 15, 2019

This is so good, thank you!
/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 15, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bskiba

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 Nov 15, 2019
@k8s-ci-robot k8s-ci-robot merged commit 4cf9610 into kubernetes:master Nov 15, 2019
wozniakjan added a commit to wozniakjan/autoscaler that referenced this pull request Dec 30, 2019
The `set` in `hack/update-kubernetes-deps-in-e2e.sh` contains redundant
options:
* `errexit` equals `-e`
* `nounset` equals `-u`

Also, I have misunderstood how to correctly set options in:
kubernetes#2531

Resource:
https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html
aksentyev pushed a commit to aksentyev/autoscaler that referenced this pull request Jan 28, 2020
The `set` in `hack/update-kubernetes-deps-in-e2e.sh` contains redundant
options:
* `errexit` equals `-e`
* `nounset` equals `-u`

Also, I have misunderstood how to correctly set options in:
kubernetes#2531

Resource:
https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html
aksentyev pushed a commit to aksentyev/autoscaler that referenced this pull request Apr 9, 2021
The `set` in `hack/update-kubernetes-deps-in-e2e.sh` contains redundant
options:
* `errexit` equals `-e`
* `nounset` equals `-u`

Also, I have misunderstood how to correctly set options in:
kubernetes#2531

Resource:
https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html
piotrnosek pushed a commit to piotrnosek/autoscaler that referenced this pull request Nov 30, 2021
The `set` in `hack/update-kubernetes-deps-in-e2e.sh` contains redundant
options:
* `errexit` equals `-e`
* `nounset` equals `-u`

Also, I have misunderstood how to correctly set options in:
kubernetes#2531

Resource:
https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html
tim-smart pushed a commit to arisechurch/autoscaler that referenced this pull request Nov 22, 2022
The `set` in `hack/update-kubernetes-deps-in-e2e.sh` contains redundant
options:
* `errexit` equals `-e`
* `nounset` equals `-u`

Also, I have misunderstood how to correctly set options in:
kubernetes#2531

Resource:
https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html
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.

VPA: go modules reference local files
3 participants