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

Implement first set of federated service e2e tests. #26636

Merged
merged 2 commits into from
Jun 13, 2016

Conversation

madhusudancs
Copy link
Contributor

@madhusudancs madhusudancs commented Jun 1, 2016

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

@madhusudancs madhusudancs assigned ghost Jun 1, 2016
@madhusudancs madhusudancs added this to the v1.3 milestone Jun 1, 2016
@k8s-github-robot k8s-github-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. release-note-label-needed labels Jun 1, 2016
FEDERATION_IMAGE_REPO_BASE=${FEDERATION_IMAGE_REPO_BASE:-'gcr.io/google_containers'}
FEDERATION_PUSH_REPO_BASE=${FEDERATION_PUSH_REPO_BASE:-"gcr.io/${PROJECT}"}
Copy link

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.

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 2, 2016
@madhusudancs madhusudancs force-pushed the fed-svc-e2e branch 2 times, most recently from c13b2ca to 2f3e978 Compare June 2, 2016 20:23
@goltermann
Copy link
Contributor

@madhusudancs When do you think you'll have this one ready for review? We cut beta on June 10.

@madhusudancs madhusudancs changed the title [WIP] Federated Service Controller e2e Implement first set of federated service e2e tests. Jun 7, 2016
@madhusudancs
Copy link
Contributor Author

@goltermann it is ready now.

@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 7, 2016
@colhom
Copy link

colhom commented Jun 7, 2016

@madhusudancs e2e is failing due to #23545

@madhusudancs
Copy link
Contributor Author

@colhom Thanks for pointing it out.

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 8, 2016
}

By("Obtaining a list of all the clusters")
clusterList, err := f.FederationClientset.Federation().Clusters().List(api.ListOptions{})
Copy link

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.

Copy link

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

Copy link
Contributor Author

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.

@madhusudancs
Copy link
Contributor Author

@quinton-hoole Addressed the comments, PTAL.

@nikhiljindal
Copy link
Contributor

Thanks @madhusudancs
Can you please rebase now that #26636 is merged.

cc @mml who was trying to patch and run this.

@mml or @madhusudancs Have you guys been able to verify that these pass?

@madhusudancs
Copy link
Contributor Author

Can you please rebase now that #26636 is merged.

@nikhiljindal Which PR did you mean? This seems like a self-recursion :)

@nikhiljindal
Copy link
Contributor

Sorry I meant #26953.
The first commit in this PR is already submitted right?

@madhusudancs
Copy link
Contributor Author

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.
@k8s-bot
Copy link

k8s-bot commented Jun 13, 2016

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) {
Copy link

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?

@ghost
Copy link

ghost commented Jun 13, 2016

Thanks @madhusudancs . All my remaining comments can be addressed in a followup PR. Please do. LGTM for this PR.

@ghost ghost added lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. labels Jun 13, 2016
framework.SkipUnlessFederated(f.Client)

// TODO: Federation API server should be able to answer this.
if federationName = os.Getenv("FEDERATION_NAME"); federationName == "" {
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-bot
Copy link

k8s-bot commented Jun 13, 2016

GCE e2e build/test passed for commit 839d98a.

@k8s-github-robot
Copy link

Automatic merge from submit-queue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants