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/

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)

Commits related to this issue

Most upvoted comments

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 kubectl related stuff out to the framework/kubectl subpkg. Should have that out soon. Then that part will be done @jtslear

Time 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:

  • resource/runtime.go is done (I accidentally took it from @draveness) in #79150
  • pods/* is largely done in #77526 - there are some leftover functions waiting for kubectl-related functions to be refactored.

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

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.

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

service/*
endpoints/*
resource/*

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.