-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
Extend apiserver testserver #55548
Extend apiserver testserver #55548
Conversation
cc: @sttts |
/sig testing |
/test pull-kubernetes-unit |
1995e51
to
3f229ef
Compare
func StartTestServer(t *testing.T) (result *restclient.Config, tearDownForCaller TearDownFunc, err error) { | ||
var tmpDir string | ||
// | ||
func StartTestServer(t *testing.T, saPubKeyPath string, plugins []string, insecure bool) (result *restclient.Config, tearDownForCaller TearDownFunc, tmpDir string, err error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make a TestServer struct
out of all the return values?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please rebase onto #51685. I added a flags []string
to control the config. I don't want to get any more logic in here in this func. Flags enforce that we mostly have an e2e setup as with a real kube-apiserver.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay i guess you mean i wait for the PR to be merged? before continuing to work on this? If i rebase now wont this PR also get all the commits #51685 as its still not in the master yet? (Apologies for the silly question i have not rebased from a PR to a PR before, just confused)
How about a struct with methods?
type TestServer struct {
//All the return values
}
func (T *TestServer) Start(....)....
func (T *TestServer) StartTestServerOrDie(...)...
.
.
.
Okay?
If yes , I will update this PR to only make this pkg from set of functions
to struct with methods
along with updating all its invocations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just the return values, not the inputs, i.e. also no methods.
IMO we should not add anything to the inputs anymore, but use the flags instead (as done in my PR). Everything else results in non-standard apiserver instances again which this whole machanism was trying to fix (compared to the situation we have in integration tests).
/test pull-kubernetes-unit |
/unassign |
3f229ef
to
3161de4
Compare
/test pull-kubernetes-unit |
3161de4
to
585936e
Compare
/test pull-kubernetes-unit |
This test repetitively fails in spite of this PR not doing anything specific to scale api object, it also appears that this test takes more than 10 mins (600 sec ) in which case
more evidence
|
e05bf6d
to
17ccc1e
Compare
ee593c9
to
cf42170
Compare
cf42170
to
fd8758b
Compare
…ests abstract out etcd server creation test/integration/framework: cleanup master_utils.go kube-apiserver: move StartTestServer tests into test/integration/master Fix the failing scale test kube-apiserver's TestServer now returns a struct instead of individual values
/priority important-soon /kind feature. |
@sttts could you LGTM again please? i had to rebase. |
/kind feature |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dhilipkumars, dims, sttts Associated issue requirement bypassed by: sttts The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
@kubernetes/kubernetes-milestone-maintainers could someone say the below please |
You must be a member of the kubernetes/kubernetes-milestone-maintainers github team to add status labels. |
/status approved-for-milestone |
/status in-progress |
/priority critical-urgent /remove-priority important-soon adjusting priorities for code freeze |
[MILESTONENOTIFIER] Milestone Pull Request Current @dhilipkumars @mikedanese @sttts Note: This pull request is marked as Example update:
Pull Request Labels
|
Automatic merge from submit-queue (batch tested with PRs 55545, 55548, 55815, 56136, 56185). If you want to cherry-pick this change to another branch, please follow the instructions here. |
What this PR does / why we need it:
Extend the test pkg of api-server a little bit so that it can be used by others
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
Special notes for your reviewer:
We wanted to use this test pkg while creating a new integration test fixture, the idea of starting the api-server without actually starting a proper etcd (integration etcd ) is very useful, if would be great to extend this for other usecases such as
insecure
mode too.It will also be useful to get the working
tmpdir
returned so that we could store additional certs (such as service account public and private keys and kubeconf for this apiserver) if needed, which will be cleaned up automatically by theteardownFn
when the api server is terminating.Release note:
ref: #50144