-
Notifications
You must be signed in to change notification settings - Fork 38.8k
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
Implement first set of federated service e2e tests. #26636
Conversation
FEDERATION_IMAGE_REPO_BASE=${FEDERATION_IMAGE_REPO_BASE:-'gcr.io/google_containers'} | ||
FEDERATION_PUSH_REPO_BASE=${FEDERATION_PUSH_REPO_BASE:-"gcr.io/${PROJECT}"} |
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.
wonderful! thanks for doing that.
c13b2ca
to
2f3e978
Compare
@madhusudancs When do you think you'll have this one ready for review? We cut beta on June 10. |
@goltermann it is ready now. |
@madhusudancs e2e is failing due to #23545 |
@colhom Thanks for pointing it out. |
} | ||
|
||
By("Obtaining a list of all the clusters") | ||
clusterList, err := f.FederationClientset.Federation().Clusters().List(api.ListOptions{}) |
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.
I think you need a check here that the number of clusters matches the number of contexts above, with a few retries on the list operation, given that the cluster create call is theoretically asynchronous.
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.
Also, given that you register/create cluster objects in BeforeEach() (i.e. before every test, i.e. before every It() clause), you also need to unregister/delete the cluster objects after every test (i.e. in AfterEach()). Either that, or you need to register the clusters once before all the tests, and delete them once after all the tests (i.e in BeforeSuite() and AfterSuite()) See https://onsi.github.io/ginkgo/#global-setup-and-teardown-beforesuite-and-aftersuite
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.
Done. Didn't put it in Before/AfterSuite because that would run the setup for all the tests.
@quinton-hoole Addressed the comments, PTAL. |
Thanks @madhusudancs cc @mml who was trying to patch and run this. @mml or @madhusudancs Have you guys been able to verify that these pass? |
@nikhiljindal Which PR did you mean? This seems like a self-recursion :) |
Sorry I meant #26953. |
Ah Ok. Thanks. Yes, I will rebase on top of that PR. It shouldn't affect trying this PR though, since that commit is included here. I haven't been able to verify that the tests pass. I am trying to bring up a new federation based on the recent merges. |
Note that these tests are untested and there is no guarantee that they work. The ongoing auth problems is blocking these e2es from being tested and upon @quinton-hoole's request I am submitting them now.
748cd7c
to
839d98a
Compare
GCE e2e build/test passed for commit 839d98a. |
// service reaches the expected value, i.e. numSvcs in the given individual Kubernetes | ||
// cluster. If the shard count, i.e. numSvcs is expected to be at least one, then | ||
// it also checks if the first shard's name and spec matches that of the given service. | ||
func waitForFederatedServiceShard(cs *release_1_3.Clientset, namespace string, service *api.Service, numSvcs int) { |
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.
nit: I don't understand how one could ever have more than 1 instance of the service in a given cluster at the same time. There would be a name clash, right? In which case, is the numSvcs parameter essentially a boolean? Would it ever make sense to call this function with that parameter not equal to either 0 or 1?
Thanks @madhusudancs . All my remaining comments can be addressed in a followup PR. Please do. LGTM for this PR. |
framework.SkipUnlessFederated(f.Client) | ||
|
||
// TODO: Federation API server should be able to answer this. | ||
if federationName = os.Getenv("FEDERATION_NAME"); federationName == "" { |
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.
No one is setting this env var anywhere?
So the tests right now will definitely 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, I wasn't expecting this PR to merge before waking up.
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.
I have #27333 to fix this
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.
Thanks!
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit 839d98a. |
Automatic merge from submit-queue |
These tests are untested and there is no guarantee that they work. The ongoing auth problems is blocking these e2es from being tested and upon @quinton-hoole's request I am submitting them now.
Only the last commit here needs review.
Depends on #26953
cc @nikhiljindal @colhom @mfanjie @kubernetes/sig-cluster-federation