{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/49657602","id":49657602,"diff_hunk":"@@ -0,0 +1,202 @@\n+/*\n+Copyright 2015 The Kubernetes Authors All rights reserved.\n+\n+Licensed under the Apache License, Version 2.0 (the \"License\");\n+you may not use this file except in compliance with the License.\n+You may obtain a copy of the License at\n+\n+    http://www.apache.org/licenses/LICENSE-2.0\n+\n+Unless required by applicable law or agreed to in writing, software\n+distributed under the License is distributed on an \"AS IS\" BASIS,\n+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+See the License for the specific language governing permissions and\n+limitations under the License.\n+*/\n+\n+package e2e\n+\n+import (\n+\t\"flag\"\n+\t\"fmt\"\n+\t\"os\"\n+\t\"path\"\n+\t\"strings\"\n+\t\"testing\"\n+\t\"time\"\n+\n+\t\"github.com/golang/glog\"\n+\t\"github.com/onsi/ginkgo\"\n+\t\"github.com/onsi/ginkgo/config\"\n+\t\"github.com/onsi/ginkgo/reporters\"\n+\t\"github.com/onsi/gomega\"\n+\t\"golang.org/x/oauth2\"\n+\t\"golang.org/x/oauth2/google\"\n+\t\"k8s.io/kubernetes/pkg/api\"\n+\t\"k8s.io/kubernetes/pkg/client/unversioned/clientcmd\"\n+\t\"k8s.io/kubernetes/pkg/cloudprovider\"\n+\tgcecloud \"k8s.io/kubernetes/pkg/cloudprovider/providers/gce\"\n+\t\"k8s.io/kubernetes/pkg/util\"\n+)\n+\n+const (\n+\t// podStartupTimeout is the time to allow all pods in the cluster to become\n+\t// running and ready before any e2e tests run. It includes pulling all of\n+\t// the pods (as of 5/18/15 this is 8 pods).\n+\tpodStartupTimeout = 10 * time.Minute\n+)\n+\n+var (\n+\tcloudConfig = &testContext.CloudConfig\n+\n+\treportDir = flag.String(\"report-dir\", \"\", \"Path to the directory where the JUnit XML reports should be saved. Default is empty, which doesn't generate these reports.\")\n+)\n+\n+type E2ETests struct {\n+}\n+\n+func NewE2ETests() *E2ETests {\n+\ttests := &E2ETests{}\n+\ttests.RegisterE2EFlags()\n+\treturn tests\n+}\n+\n+// Sanity checks that the e2e's have the basic information required to run before launching them.\n+func (e2e *E2ETests) IsSetup() bool {\n+\tif &testContext.KubeConfig == nil || *&testContext.KubeConfig == \"\" {\n+\t\tglog.Warningf(\"KubeConfig value not configured.\")\n+\t\treturn false\n+\t}\n+\n+\t// Add more checks below...\n+\treturn true\n+}\n+\n+func (e2e *E2ETests) RegisterE2EFlags() {","path":"test/e2e/e2e.go","position":75,"original_position":75,"commit_id":"865bfeed20e41467b6430acf61822c26a1ef3e6d","original_commit_id":"865bfeed20e41467b6430acf61822c26a1ef3e6d","user":{"login":"jayunit100","id":826111,"avatar_url":"https://avatars.githubusercontent.com/u/826111?v=3","gravatar_id":"","url":"https://api.github.com/users/jayunit100","html_url":"https://github.com/jayunit100","followers_url":"https://api.github.com/users/jayunit100/followers","following_url":"https://api.github.com/users/jayunit100/following{/other_user}","gists_url":"https://api.github.com/users/jayunit100/gists{/gist_id}","starred_url":"https://api.github.com/users/jayunit100/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jayunit100/subscriptions","organizations_url":"https://api.github.com/users/jayunit100/orgs","repos_url":"https://api.github.com/users/jayunit100/repos","events_url":"https://api.github.com/users/jayunit100/events{/privacy}","received_events_url":"https://api.github.com/users/jayunit100/received_events","type":"User","site_admin":false},"body":"I've put this on the struct because over time we want the struct  to hold more info, and this allows us to contextualize the fact that all this method does is make sure the configuration params are written to an object.  \r\n\r\nRight now that object is external to the e2e struct,  but in general there is no reason to register these flags outside the context of an e2e struct.\r\n\r\nLet me know if that justifies it to you. If not I can make it a global function but I think this helps to move us away from global config dependencies , and towards a purely data-coupled configuration flow.","created_at":"2016-01-13T22:00:55Z","updated_at":"2016-01-13T22:00:55Z","html_url":"https://github.com/kubernetes/kubernetes/pull/19476#discussion_r49657602","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/19476","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/49657602"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/19476#discussion_r49657602"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/19476"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/19476","id":55630644,"html_url":"https://github.com/kubernetes/kubernetes/pull/19476","diff_url":"https://github.com/kubernetes/kubernetes/pull/19476.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/19476.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/19476","number":19476,"state":"open","locked":false,"title":"E2E libraryzation","user":{"login":"jayunit100","id":826111,"avatar_url":"https://avatars.githubusercontent.com/u/826111?v=3","gravatar_id":"","url":"https://api.github.com/users/jayunit100","html_url":"https://github.com/jayunit100","followers_url":"https://api.github.com/users/jayunit100/followers","following_url":"https://api.github.com/users/jayunit100/following{/other_user}","gists_url":"https://api.github.com/users/jayunit100/gists{/gist_id}","starred_url":"https://api.github.com/users/jayunit100/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jayunit100/subscriptions","organizations_url":"https://api.github.com/users/jayunit100/orgs","repos_url":"https://api.github.com/users/jayunit100/repos","events_url":"https://api.github.com/users/jayunit100/events{/privacy}","received_events_url":"https://api.github.com/users/jayunit100/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-01-11T14:49:35Z","updated_at":"2016-01-13T22:00:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fc2fc308adac09ddcb3b4cf3047c5f9f8fb8ebfc","assignee":{"login":"ixdy","id":8061296,"avatar_url":"https://avatars.githubusercontent.com/u/8061296?v=3","gravatar_id":"","url":"https://api.github.com/users/ixdy","html_url":"https://github.com/ixdy","followers_url":"https://api.github.com/users/ixdy/followers","following_url":"https://api.github.com/users/ixdy/following{/other_user}","gists_url":"https://api.github.com/users/ixdy/gists{/gist_id}","starred_url":"https://api.github.com/users/ixdy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ixdy/subscriptions","organizations_url":"https://api.github.com/users/ixdy/orgs","repos_url":"https://api.github.com/users/ixdy/repos","events_url":"https://api.github.com/users/ixdy/events{/privacy}","received_events_url":"https://api.github.com/users/ixdy/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/19476/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/19476/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/19476/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/865bfeed20e41467b6430acf61822c26a1ef3e6d","head":{"label":"jayunit100:e2e_lib","ref":"e2e_lib","sha":"865bfeed20e41467b6430acf61822c26a1ef3e6d","user":{"login":"jayunit100","id":826111,"avatar_url":"https://avatars.githubusercontent.com/u/826111?v=3","gravatar_id":"","url":"https://api.github.com/users/jayunit100","html_url":"https://github.com/jayunit100","followers_url":"https://api.github.com/users/jayunit100/followers","following_url":"https://api.github.com/users/jayunit100/following{/other_user}","gists_url":"https://api.github.com/users/jayunit100/gists{/gist_id}","starred_url":"https://api.github.com/users/jayunit100/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jayunit100/subscriptions","organizations_url":"https://api.github.com/users/jayunit100/orgs","repos_url":"https://api.github.com/users/jayunit100/repos","events_url":"https://api.github.com/users/jayunit100/events{/privacy}","received_events_url":"https://api.github.com/users/jayunit100/received_events","type":"User","site_admin":false},"repo":{"id":28862683,"name":"kubernetes","full_name":"jayunit100/kubernetes","owner":{"login":"jayunit100","id":826111,"avatar_url":"https://avatars.githubusercontent.com/u/826111?v=3","gravatar_id":"","url":"https://api.github.com/users/jayunit100","html_url":"https://github.com/jayunit100","followers_url":"https://api.github.com/users/jayunit100/followers","following_url":"https://api.github.com/users/jayunit100/following{/other_user}","gists_url":"https://api.github.com/users/jayunit100/gists{/gist_id}","starred_url":"https://api.github.com/users/jayunit100/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jayunit100/subscriptions","organizations_url":"https://api.github.com/users/jayunit100/orgs","repos_url":"https://api.github.com/users/jayunit100/repos","events_url":"https://api.github.com/users/jayunit100/events{/privacy}","received_events_url":"https://api.github.com/users/jayunit100/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jayunit100/kubernetes","description":"Container Cluster Manager","fork":true,"url":"https://api.github.com/repos/jayunit100/kubernetes","forks_url":"https://api.github.com/repos/jayunit100/kubernetes/forks","keys_url":"https://api.github.com/repos/jayunit100/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jayunit100/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jayunit100/kubernetes/teams","hooks_url":"https://api.github.com/repos/jayunit100/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/jayunit100/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/jayunit100/kubernetes/events","assignees_url":"https://api.github.com/repos/jayunit100/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/jayunit100/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/jayunit100/kubernetes/tags","blobs_url":"https://api.github.com/repos/jayunit100/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jayunit100/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jayunit100/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/jayunit100/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jayunit100/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/jayunit100/kubernetes/languages","stargazers_url":"https://api.github.com/repos/jayunit100/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/jayunit100/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/jayunit100/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/jayunit100/kubernetes/subscription","commits_url":"https://api.github.com/repos/jayunit100/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/jayunit100/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/jayunit100/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/jayunit100/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/jayunit100/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/jayunit100/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jayunit100/kubernetes/merges","archive_url":"https://api.github.com/repos/jayunit100/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jayunit100/kubernetes/downloads","issues_url":"https://api.github.com/repos/jayunit100/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/jayunit100/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/jayunit100/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/jayunit100/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jayunit100/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/jayunit100/kubernetes/releases{/id}","created_at":"2015-01-06T12:36:29Z","updated_at":"2015-08-01T13:36:57Z","pushed_at":"2016-01-12T21:56:30Z","git_url":"git://github.com/jayunit100/kubernetes.git","ssh_url":"git@github.com:jayunit100/kubernetes.git","clone_url":"https://github.com/jayunit100/kubernetes.git","svn_url":"https://github.com/jayunit100/kubernetes","homepage":null,"size":145307,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"kubernetes:master","ref":"master","sha":"0df7e695d4c28c481e490fd8d3c93b79c2851198","user":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"repo":{"id":20580498,"name":"kubernetes","full_name":"kubernetes/kubernetes","owner":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubernetes/kubernetes","description":"Container Cluster Manager from Google","fork":false,"url":"https://api.github.com/repos/kubernetes/kubernetes","forks_url":"https://api.github.com/repos/kubernetes/kubernetes/forks","keys_url":"https://api.github.com/repos/kubernetes/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes/kubernetes/teams","hooks_url":"https://api.github.com/repos/kubernetes/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes/kubernetes/events","assignees_url":"https://api.github.com/repos/kubernetes/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes/kubernetes/tags","blobs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes/kubernetes/languages","stargazers_url":"https://api.github.com/repos/kubernetes/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/kubernetes/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/kubernetes/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/kubernetes/kubernetes/subscription","commits_url":"https://api.github.com/repos/kubernetes/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes/kubernetes/merges","archive_url":"https://api.github.com/repos/kubernetes/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes/kubernetes/downloads","issues_url":"https://api.github.com/repos/kubernetes/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes/kubernetes/releases{/id}","created_at":"2014-06-06T22:56:04Z","updated_at":"2016-01-13T20:19:11Z","pushed_at":"2016-01-13T22:00:32Z","git_url":"git://github.com/kubernetes/kubernetes.git","ssh_url":"git@github.com:kubernetes/kubernetes.git","clone_url":"https://github.com/kubernetes/kubernetes.git","svn_url":"https://github.com/kubernetes/kubernetes","homepage":"http://kubernetes.io","size":304098,"stargazers_count":12113,"watchers_count":12113,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":3399,"mirror_url":null,"open_issues_count":2769,"forks":3399,"open_issues":2769,"watchers":12113,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/19476"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/19476"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/19476"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/19476/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/19476/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/19476/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/865bfeed20e41467b6430acf61822c26a1ef3e6d"}}}}