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

Break up and Refactor test/e2e/framework/util.go #77095

Closed
5 of 10 tasks
andrewsykim opened this issue Apr 25, 2019 · 56 comments
Closed
5 of 10 tasks

Break up and Refactor test/e2e/framework/util.go #77095

andrewsykim opened this issue Apr 25, 2019 · 56 comments
Assignees
Labels
area/e2e-test-framework Issues or PRs related to refactoring the kubernetes e2e test framework help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature. priority/backlog Higher priority than priority/awaiting-more-evidence. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. sig/testing Categorizes an issue or PR as relevant to SIG Testing.

Comments

@andrewsykim
Copy link
Member

andrewsykim commented Apr 25, 2019

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 #76206 there were some discussions for how to break up this file. The proposed package structure was:

test/e2e/framework/

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 #76206 & #75601

@andrewsykim andrewsykim added the kind/feature Categorizes issue or PR as related to a new feature. label Apr 25, 2019
@k8s-ci-robot k8s-ci-robot added the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Apr 25, 2019
@andrewsykim
Copy link
Member Author

/sig testing
/area e2e-framework

@k8s-ci-robot k8s-ci-robot added sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Apr 25, 2019
@andrewsykim
Copy link
Member Author

/area e2e-test-framework

@k8s-ci-robot k8s-ci-robot added the area/e2e-test-framework Issues or PRs related to refactoring the kubernetes e2e test framework label Apr 25, 2019
@johnSchnake
Copy link
Contributor

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.

@draveness
Copy link
Contributor

I'd like to take the files as below :)

service/*
endpoints/*
resource/*

@alejandrox1
Copy link
Contributor

alejandrox1 commented Apr 26, 2019

I’d like to take kubectl/, node/, and pod/* :)

@WanLinghao
Copy link
Contributor

WanLinghao commented Apr 26, 2019

I would like to take cluster and log

@WanLinghao
Copy link
Contributor

WanLinghao commented Apr 26, 2019

Hi, all. When I try handle cluster thing, I found there are many functions containing k8s-component. Like

CheckNodesReady
RestartControllerManager
WaitForApiserverUp

Should we combine node/ and cluster/, maybe something like:

  • cluster/
    - kubelet.go
    - kube-proxy.go
    - controller-manager.go
    - api-server.go

What do you think?

@draveness
Copy link
Contributor

Hi, all. When I try handle cluster thing, I found there are many functions containing k8s-component. Like

Maybe we could leave these for now and see what we could do after the major part of this is done.

@andrewsykim
Copy link
Member Author

Should we combine node/ and cluster/, maybe something like:

test/e2e/framework/nodes should be for anything handling the node resource. So CheckNodesReady should go there if it gets and checks node objects from the apiserver.

RestartControllerManager and WaitForApiserverUp should go into test/e2e/framework/restart.go or test/e2e/framework/cluster/state.go IMO. What do you think?

@andrewsykim
Copy link
Member Author

andrewsykim commented Apr 26, 2019

@WanLinghao updated test/e2e/framework/cluster to test/e2e/framework/lifecycle as per @jiatongw's suggestion and moved restart.go under lifecycle.

@draveness
Copy link
Contributor

draveness commented Apr 27, 2019

Hi @SataQiu, how is the process of refactoring networking_util going on?

I'm working on service related functions in utils.go #77155. Some of the functions have to import framework package since it calls some common functions like Logf. And networking_util.go is calling WaitForServiceEndpointsNum and WaitForService which means it could cause the import cycle problem.

Do you have the time to work on the networking_util? If you do not have the time, I could take it over from here, many thanks. :)

@MorrisLaw
Copy link
Member

I can work on wrappers and providers if they’re still available.

@johnSchnake
Copy link
Contributor

@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.

@MorrisLaw
Copy link
Member

MorrisLaw commented Apr 27, 2019

Should provider related things go into test/e2e/framework/providers? Or, is it actually intended for provider related methods to be broken into a test/e2e/framework/providers.go file despite there already being a test/e2e/framework/provider.go file? @andrewsykim

@andrewsykim
Copy link
Member Author

Should provider related things go into test/e2e/framework/providers? Or, is it actually intended for provider related methods to be broken into a test/e2e/framework/providers.go file despite there already being a test/e2e/framework/provider.go file? @andrewsykim

I think everything in test/e2e/framework/providers should be the provider implementations and test/e2e/framework/providers.go should have methods like ProviderIsand variables like ProvidersWithSSH in it. We can consider moving that up to test/e2e/framework/providers/provider.go but a lot of other methods in test/e2e/framework depend on it so I think keeping it in the same package at least for now makes sense. What do you think?

@SataQiu
Copy link
Member

SataQiu commented Apr 27, 2019

Hi @SataQiu, how is the process of refactoring networking_util going on?

I'm working on service related functions in utils.go #77155. Some of the functions have to import framework package since it calls some common functions like Logf. And networking_util.go is calling WaitForServiceEndpointsNum and WaitForService which means it could cause the import cycle problem.

Do you have the time to work on the networking_util? If you do not have the time, I could take it over from here, many thanks. :)

@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.

@andrewsykim
Copy link
Member Author

@SataQiu that's why we're breaking up test/e2e/framework/util.go first. If we can move methods like Logf and WaitForService into 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

@WanLinghao
Copy link
Contributor

WanLinghao commented Apr 28, 2019

I think we need move log functions and ssh functions to their own packages first to avoid cycle import.
They are widely referred in test/e2e/framework package .
I have create PR #77181 to solve this.

WanLinghao added a commit to WanLinghao/kubernetes that referenced this issue Apr 28, 2019
It moves log function and ssh function to their own packages:
test/e2e/framework/log/
test/e2e/framework/ssh/
For more detail, please refer:kubernetes#77095
@tanjunchen
Copy link
Member

/cc

@oomichi
Copy link
Member

oomichi commented Mar 23, 2020

Fixed a typo in the title

/retitle Break up and Refactor test/e2e/framework/util.go

@k8s-ci-robot k8s-ci-robot changed the title Break up and Refactor test/e2e/framework/utils.go Break up and Refactor test/e2e/framework/util.go Mar 23, 2020
@gavinfish
Copy link
Contributor

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.

@tanjunchen
Copy link
Member

/help

@k8s-ci-robot
Copy link
Contributor

@tanjunchen:
This request has been marked as needing help from a contributor.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.

In response to this:

/help

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Apr 14, 2020
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 13, 2020
@oomichi
Copy link
Member

oomichi commented Jul 13, 2020

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/e2e-test-framework Issues or PRs related to refactoring the kubernetes e2e test framework help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature. priority/backlog Higher priority than priority/awaiting-more-evidence. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. sig/testing Categorizes an issue or PR as relevant to SIG Testing.
Projects
None yet
Development

Successfully merging a pull request may close this issue.