-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Multiversion client tests #25566
Multiversion client tests #25566
Conversation
GCE e2e build/test failed for commit a78a6ec. Please reference the list of currently known flakes when examining this failure. If you request a re-test, you must reference the issue describing the flake. |
if serializer.Serializer == nil { | ||
if g.IsEnabledVersion(gv) { |
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.
If I requested a specific version and I can't have it, shouldn't I fail?
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.
Yeah the overall lack of error handling or panic (it's just tests) is something I've struggled while working on this.
@soltysh could you remind me the context? I don't remember why can't we use the KUBE_TEST_API_VERSIONS environment variable to control what version to test. |
@caesarxuchao the problem with enabling just |
I must have missed something: it seems if you only put
Sorry I cannot recall our discussion in the other PR.. |
That's not quite the way it works, iirc. I can't remember the full details, since that was a while, but in general this line will allow only this version, but since batch/install.go is called it installs all the versions internally and that is later the root cause of all the problems. I think the case was for the situation where you don't specify any of batch versions and then all are installed, which is why the tests were failing (and one of the groups installs extensions but no batch, see the first group in KUBE_TEST_API_VERSIONS. |
Just to reiterate, so you agree that if only batck/v1beta2 is specified in "KUBE_API_TEST", then there will be no problem?
In that case, calling |
Hmmm... lemme check that again. I think there was more than just that. |
@caesarxuchao so here's the problem I've stumbled upon, when I've enabled just
I remember I was trying to fix it, but failed badly. See that although |
Identical problems in
|
Maybe I'm missing a better solution here, I don't deny it, that's why I've opened this issue to discuss possible approaches :) |
After second thought, we could install in the testapi only the version that is specified and ignore everything else. I need to give it a try, since it looks like it might help here. |
Current state is that I've reverted the changes I've did in |
Thanks @soltysh! Yes, those master_test should only be run for a certain KUBE_API_TEST_VERSION. |
Automatic merge from submit-queue Scheduledjob storage This builds on top of #25475 so only last commit is significant. There's still one small problem with conversions, I'm currently working, but the biggest is still multi-version client tests. Read on... @erictune unfortunately the multi-version tests are biting again, this time in `pkg/registry/scheduledjob/etcd`. If I run the tests with just `batch/v2alpha1` then these are working correctly, but we can't have only `batch/v2alpha1` enabled since `batch/v1` is the preferred version for the entire `batch/` group. We either going to skip the tests here like we did with the scheduledjob client (I'm talking about `pkg/registry/scheduledjob/etcd/etcd_test.go`) or fix it. I've talked with @deads2k about how we can plumb the tests so it just passes, but there's no simple solution we can come up with 😞 (other than the one from #25566), unless @caesarxuchao can chime in and propose something. ```release-note Introducing ScheduledJobs as described in [the proposal](https://github.com/kubernetes/kubernetes/blob/master/docs/proposals/scheduledjob.md) as part of `batch/v2alpha1` version (experimental feature). ``` [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
Automatic merge from submit-queue ScheduledJob tests This builds on top of #25569, so only the last two commits matter ([Revert commit a31ca0d and move batch/v2alpha1 tests to separate group](e7f6ba7) and [ScheduledJob client and storage tests](c59c045)). This also supersedes #25566 with simpler approach to testing, by testing single version at a time. @caesarxuchao I've reverted the changes I've did previously to enable multi-version tests and introduced new group where `batch/v2alpha1` is tested (see 1st commit). I've also added back the necessary tests for scheduledjob related stuff (2nd commit) that are already in queue (@erictune fyi - I can't stand having code without tests 😉). [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/.github/PULL_REQUEST_TEMPLATE.md?pixel)]()
@caesarxuchao this is a follow up to the discussion we've had while I was working on the
JobTemplate
, esp. the part about introducingbatch/v2alpha1
(#21675). I've split this from #25475 not to block progress onScheduledJobs
, so look only at the last commit. We need some sort of solution for the multi-version client testing and I'm willing to work on it but will need your help.In the aforementioned commit I've extended
simpletest_client.go
'sConfig with
GroupVersionwhich allows you to specify which version you want to test. This required some additional changes in
testapi.goto be able to specify which specific version we're testing. See
jobs_test.go, since with those changes I was easily able to test all possible versions
Job` exists in.I'm open to suggestions how to improve the code, this is just a dirty plumbing I did to make the test work, while mostly focusing on ScheduledJobs.
@erictune also mentioned there's a plan to get rid of manually writing those clients, in that case it might make sense just to ignore the problems for now and wait for the generated clients make their way. The only question is when will that happen?