kubernetes: Break up and Refactor test/e2e/framework/util.go
What would you like to be added:
There are a lot of methods in test/e2e/framework/util.go that can be cleaned up or moved into it’s own package for easier consumption/discovery. In https://github.com/kubernetes/kubernetes/issues/76206 there were some discussions for how to break up this file. The proposed package structure was:
test/e2e/framework/
- kubectl/ (@MorrisLaw) - builder.go - runner.go
- log/ (@draveness) - logger.go
- pod/ (@alejandrox1) - wait.go - resource.go
- node/ (@jiatongw) - wait.go - resource.go
- service/ (@draveness) - resource.go
- endpoints/ (@draveness) - resource.go
- resource/ (@alejandrox1) - runtime.go
- lifecycle/ (@jiatongw) - versions.go - state.go - restart
- wrappers.go (@MorrisLaw)
- providers.go (@alejandrox1)
I think each package & top level file can be it’s own task. Pick a package above, go through each method in test/e2e/framework/util.go and move it to that package/file if it makes sense. The above is just a guideline, feel free to introduce new packages/files where it makes sense.
Why is this needed: This is a part of https://github.com/kubernetes/kubernetes/issues/76206 & https://github.com/kubernetes/kubernetes/issues/75601
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 1
- Comments: 56 (52 by maintainers)
It seems most node related work has been done. I will continue to follow up node related refactor. Share it here to avoid unnecessary conflicts.
Fixed a typo in the title
/retitle Break up and Refactor test/e2e/framework/util.go
Not sure of the others, but I’m working on another PR to move the rest of
kubectlrelated stuff out to theframework/kubectlsubpkg. Should have that out soon. Then that part will be done @jtslearTime to bump it up. Code freeze starts this week. This won’t be done by then and we won;t be able to move forward until code thaw (tentatively September 10). /milestone v1.17
@alejandrox1 please do, assigned it to you
Update: First step of refactoring node package is node. Following up PRs are on the way @alejandrox1
updates:
I can work on the kubectl package @andrewsykim
@draveness, hope you don’t mind I created the issue here https://github.com/kubernetes/kubernetes/issues/77359
@SataQiu that’s why we’re breaking up
test/e2e/framework/util.gofirst. If we can move methods likeLogfandWaitForServiceinto their own packages we would avoid import cycles. Correct me if I’m wrong though, maybe there’s another import cycle I’m not seeing@draveness I have tried to solve this problem before, but it was suspended for some reason. If you have the time, feel free to take it over. Thanks a lot.
@draveness I have a WIP for extracting the logging into its own package. It is a very heavily used set of functions though so I am running into a few issues. All solvable though I think. I’ll let you know when that is done.
I would like to take cluster and log
I’d like to take kubectl/, node/, and pod/* 😃
I’d like to take the files as below 😃
There are also ssh utilities that should probably move into their own package; I’ll take that one as I think it is also a reasonable step in #69373 which is assigned to me (reducing reliance on ssh in tests). Step 1, figure out where it really bubbles up to, step 2, do something about it.