kubernetes: Core e2e test framework should not import sub e2e test frameworks
What happened:
As https://kubernetes.slack.com/archives/C9NK9KFFW/p1565372337078100 Core e2e test framework(test/e2e/framework) should not import sub e2e test frameworks (e.g. test/e2e/framework/auth) for avoiding circular dependency.
This issue is for managing such issues.
The following files are in e2e core framework:
- cleanup.go (no dependency to sub packages)
- exec_util.go (no dependency to sub packages)
- expect.go (no dependency to sub packages)
- flake_reporting_util.go (no dependency to sub packages)
- framework.go (https://github.com/kubernetes/kubernetes/pull/86679 is a part, but still we should have more PRs)
- get-kubemark-resource-usage.go
- google_compute.go (no dependency to sub packages)
- log.go
- log_size_monitoring.go
- nodes_util.go
- pods.go
- profile_gatherer.go (https://github.com/kubernetes/kubernetes/pull/85304)
- provider.go (no dependency to sub packages)
- psp.go
- rc_util.go (no dependency to sub packages)
- resource_usage_gatherer.go
- size.go (no dependency to sub packages)
- skip.go (https://github.com/kubernetes/kubernetes/pull/87031 and https://github.com/kubernetes/kubernetes/issues/87047)
- suites.go (https://github.com/kubernetes/kubernetes/pull/85235)
- test_context.go (no dependency to sub packages)
- util.go
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 38 (31 by maintainers)
Commits related to this issue
- e2e: getCurrentKubeletConfig: move in subpkg Address review comments and move the helper function in the `framework/kubelet` package to avoid circular deps (see https://github.com/kubernetes/kubernet... — committed to ffromani/kubernetes by ffromani 4 years ago
- Use slow timeout for some volume tests running on Windows For windows, pod start up time is longer than Linux due to formatting and image downloading. This PR uses longer timeout for pod running on W... — committed to jingxu97/kubernetes by jingxu97 4 years ago
- restructure e2e framework and its sub-packages to solve potential cycle imports. Currently, many e2e functionalities are divided into sub packages from framework itself. The framework as a hub to it... — committed to kidlj/kubernetes by kidlj 2 years ago
@mauriciopoppe First, thanks for the well written proposal!
This sounds reasonable to me. My concern is potential code/rebase churn this may cause during the runup to code freeze in the next week.
So one suggestion I have is: go with the above plan, but don’t land anything that’s going to cause a lot of in-flight PR’s to need to rebase. After code freeze, go nuts, but need to complete prior to test freeze, and be prepared to back off if it’s too disruptive.
Another suggestion would be to try hiding
PodClient’s framework dependency behind a shim, e.g.Modify
Frameworkto expose some things via functions instead of direct struct access (this isn’t very golang, but bear with me)Use the shim instead of framework to implement
e2epod.PodClientThen progressively migrate tests to use the new client instead of the old one
I’m not 100% sure the shim approach lacks tangles? But I think it changes fewer function signatures, and could be landed without forcing a ton of code to migrate at once.