{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/contrib/pulls/comments/65139124","id":65139124,"diff_hunk":"@@ -0,0 +1,73 @@\n+/*\n+Copyright 2016 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 main\n+\n+import (\n+\t\"testing\"\n+\t\"time\"\n+\n+\t\"k8s.io/contrib/cluster-autoscaler/simulator\"\n+\t. \"k8s.io/contrib/cluster-autoscaler/utils/test\"\n+\n+\tkube_api \"k8s.io/kubernetes/pkg/api\"\n+\n+\t\"github.com/stretchr/testify/assert\"\n+)\n+\n+func TestCalculateUnderutilizedNodes(t *testing.T) {\n+\tp1 := BuildTestPod(\"p1\", 100, 0)\n+\tp1.Spec.NodeName = \"n1\"\n+\n+\tp2 := BuildTestPod(\"p2\", 300, 0)\n+\tp2.Spec.NodeName = \"n2\"\n+\tp2.Annotations = map[string]string{\n+\t\t\"kubernetes.io/created-by\": \"{\\\"kind\\\":\\\"SerializedReference\\\",\\\"apiVersion\\\":\\\"v1\\\",\\\"reference\\\":{\\\"kind\\\":\\\"ReplicaSet\\\"}}\",\n+\t}\n+\n+\tp3 := BuildTestPod(\"p3\", 400, 0)\n+\tp3.Annotations = map[string]string{\n+\t\t\"kubernetes.io/created-by\": \"{\\\"kind\\\":\\\"SerializedReference\\\",\\\"apiVersion\\\":\\\"v1\\\",\\\"reference\\\":{\\\"kind\\\":\\\"ReplicaSet\\\"}}\",\n+\t}\n+\tp3.Spec.NodeName = \"n3\"\n+\n+\tp4 := BuildTestPod(\"p3\", 2000, 0)","path":"cluster-autoscaler/scale_down_test.go","position":47,"original_position":47,"commit_id":"3610c7254cc081f96825594a61cb80f4e010bc24","original_commit_id":"3610c7254cc081f96825594a61cb80f4e010bc24","user":{"login":"piosz","id":10819974,"avatar_url":"https://avatars.githubusercontent.com/u/10819974?v=3","gravatar_id":"","url":"https://api.github.com/users/piosz","html_url":"https://github.com/piosz","followers_url":"https://api.github.com/users/piosz/followers","following_url":"https://api.github.com/users/piosz/following{/other_user}","gists_url":"https://api.github.com/users/piosz/gists{/gist_id}","starred_url":"https://api.github.com/users/piosz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piosz/subscriptions","organizations_url":"https://api.github.com/users/piosz/orgs","repos_url":"https://api.github.com/users/piosz/repos","events_url":"https://api.github.com/users/piosz/events{/privacy}","received_events_url":"https://api.github.com/users/piosz/received_events","type":"User","site_admin":false},"body":"p4","created_at":"2016-05-31T08:15:22Z","updated_at":"2016-05-31T08:15:22Z","html_url":"https://github.com/kubernetes/contrib/pull/1089#discussion_r65139124","pull_request_url":"https://api.github.com/repos/kubernetes/contrib/pulls/1089","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/contrib/pulls/comments/65139124"},"html":{"href":"https://github.com/kubernetes/contrib/pull/1089#discussion_r65139124"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/contrib/pulls/1089"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/contrib/pulls/1089","id":71744164,"html_url":"https://github.com/kubernetes/contrib/pull/1089","diff_url":"https://github.com/kubernetes/contrib/pull/1089.diff","patch_url":"https://github.com/kubernetes/contrib/pull/1089.patch","issue_url":"https://api.github.com/repos/kubernetes/contrib/issues/1089","number":1089,"state":"open","locked":false,"title":"Cluster-autoscaler: Tests for utilization calculator in scale down","user":{"login":"mwielgus","id":11994812,"avatar_url":"https://avatars.githubusercontent.com/u/11994812?v=3","gravatar_id":"","url":"https://api.github.com/users/mwielgus","html_url":"https://github.com/mwielgus","followers_url":"https://api.github.com/users/mwielgus/followers","following_url":"https://api.github.com/users/mwielgus/following{/other_user}","gists_url":"https://api.github.com/users/mwielgus/gists{/gist_id}","starred_url":"https://api.github.com/users/mwielgus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwielgus/subscriptions","organizations_url":"https://api.github.com/users/mwielgus/orgs","repos_url":"https://api.github.com/users/mwielgus/repos","events_url":"https://api.github.com/users/mwielgus/events{/privacy}","received_events_url":"https://api.github.com/users/mwielgus/received_events","type":"User","site_admin":false},"body":"cc: @piosz @fgrzadkowski ","created_at":"2016-05-27T17:07:33Z","updated_at":"2016-05-31T08:15:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"32eafcff6f71c2213c3daa0c7390442912ddb6de","assignee":{"login":"piosz","id":10819974,"avatar_url":"https://avatars.githubusercontent.com/u/10819974?v=3","gravatar_id":"","url":"https://api.github.com/users/piosz","html_url":"https://github.com/piosz","followers_url":"https://api.github.com/users/piosz/followers","following_url":"https://api.github.com/users/piosz/following{/other_user}","gists_url":"https://api.github.com/users/piosz/gists{/gist_id}","starred_url":"https://api.github.com/users/piosz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piosz/subscriptions","organizations_url":"https://api.github.com/users/piosz/orgs","repos_url":"https://api.github.com/users/piosz/repos","events_url":"https://api.github.com/users/piosz/events{/privacy}","received_events_url":"https://api.github.com/users/piosz/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/contrib/pulls/1089/commits","review_comments_url":"https://api.github.com/repos/kubernetes/contrib/pulls/1089/comments","review_comment_url":"https://api.github.com/repos/kubernetes/contrib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/contrib/issues/1089/comments","statuses_url":"https://api.github.com/repos/kubernetes/contrib/statuses/3610c7254cc081f96825594a61cb80f4e010bc24","head":{"label":"mwielgus:scale-down-test-1","ref":"scale-down-test-1","sha":"3610c7254cc081f96825594a61cb80f4e010bc24","user":{"login":"mwielgus","id":11994812,"avatar_url":"https://avatars.githubusercontent.com/u/11994812?v=3","gravatar_id":"","url":"https://api.github.com/users/mwielgus","html_url":"https://github.com/mwielgus","followers_url":"https://api.github.com/users/mwielgus/followers","following_url":"https://api.github.com/users/mwielgus/following{/other_user}","gists_url":"https://api.github.com/users/mwielgus/gists{/gist_id}","starred_url":"https://api.github.com/users/mwielgus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwielgus/subscriptions","organizations_url":"https://api.github.com/users/mwielgus/orgs","repos_url":"https://api.github.com/users/mwielgus/repos","events_url":"https://api.github.com/users/mwielgus/events{/privacy}","received_events_url":"https://api.github.com/users/mwielgus/received_events","type":"User","site_admin":false},"repo":{"id":56583152,"name":"contrib","full_name":"mwielgus/contrib","owner":{"login":"mwielgus","id":11994812,"avatar_url":"https://avatars.githubusercontent.com/u/11994812?v=3","gravatar_id":"","url":"https://api.github.com/users/mwielgus","html_url":"https://github.com/mwielgus","followers_url":"https://api.github.com/users/mwielgus/followers","following_url":"https://api.github.com/users/mwielgus/following{/other_user}","gists_url":"https://api.github.com/users/mwielgus/gists{/gist_id}","starred_url":"https://api.github.com/users/mwielgus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mwielgus/subscriptions","organizations_url":"https://api.github.com/users/mwielgus/orgs","repos_url":"https://api.github.com/users/mwielgus/repos","events_url":"https://api.github.com/users/mwielgus/events{/privacy}","received_events_url":"https://api.github.com/users/mwielgus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mwielgus/contrib","description":"This is a place for various components in the Kubernetes ecosystem that aren't part of the Kubernetes core.","fork":true,"url":"https://api.github.com/repos/mwielgus/contrib","forks_url":"https://api.github.com/repos/mwielgus/contrib/forks","keys_url":"https://api.github.com/repos/mwielgus/contrib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mwielgus/contrib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mwielgus/contrib/teams","hooks_url":"https://api.github.com/repos/mwielgus/contrib/hooks","issue_events_url":"https://api.github.com/repos/mwielgus/contrib/issues/events{/number}","events_url":"https://api.github.com/repos/mwielgus/contrib/events","assignees_url":"https://api.github.com/repos/mwielgus/contrib/assignees{/user}","branches_url":"https://api.github.com/repos/mwielgus/contrib/branches{/branch}","tags_url":"https://api.github.com/repos/mwielgus/contrib/tags","blobs_url":"https://api.github.com/repos/mwielgus/contrib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mwielgus/contrib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mwielgus/contrib/git/refs{/sha}","trees_url":"https://api.github.com/repos/mwielgus/contrib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mwielgus/contrib/statuses/{sha}","languages_url":"https://api.github.com/repos/mwielgus/contrib/languages","stargazers_url":"https://api.github.com/repos/mwielgus/contrib/stargazers","contributors_url":"https://api.github.com/repos/mwielgus/contrib/contributors","subscribers_url":"https://api.github.com/repos/mwielgus/contrib/subscribers","subscription_url":"https://api.github.com/repos/mwielgus/contrib/subscription","commits_url":"https://api.github.com/repos/mwielgus/contrib/commits{/sha}","git_commits_url":"https://api.github.com/repos/mwielgus/contrib/git/commits{/sha}","comments_url":"https://api.github.com/repos/mwielgus/contrib/comments{/number}","issue_comment_url":"https://api.github.com/repos/mwielgus/contrib/issues/comments{/number}","contents_url":"https://api.github.com/repos/mwielgus/contrib/contents/{+path}","compare_url":"https://api.github.com/repos/mwielgus/contrib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mwielgus/contrib/merges","archive_url":"https://api.github.com/repos/mwielgus/contrib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mwielgus/contrib/downloads","issues_url":"https://api.github.com/repos/mwielgus/contrib/issues{/number}","pulls_url":"https://api.github.com/repos/mwielgus/contrib/pulls{/number}","milestones_url":"https://api.github.com/repos/mwielgus/contrib/milestones{/number}","notifications_url":"https://api.github.com/repos/mwielgus/contrib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mwielgus/contrib/labels{/name}","releases_url":"https://api.github.com/repos/mwielgus/contrib/releases{/id}","deployments_url":"https://api.github.com/repos/mwielgus/contrib/deployments","created_at":"2016-04-19T09:23:15Z","updated_at":"2016-04-19T09:23:18Z","pushed_at":"2016-05-27T17:06:26Z","git_url":"git://github.com/mwielgus/contrib.git","ssh_url":"git@github.com:mwielgus/contrib.git","clone_url":"https://github.com/mwielgus/contrib.git","svn_url":"https://github.com/mwielgus/contrib","homepage":"","size":28741,"stargazers_count":0,"watchers_count":0,"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":0,"default_branch":"master"}},"base":{"label":"kubernetes:master","ref":"master","sha":"1dbecea4b2bffea0e72e66c6082a34cd45b134a4","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":40686014,"name":"contrib","full_name":"kubernetes/contrib","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/contrib","description":"This is a place for various components in the Kubernetes ecosystem that aren't part of the Kubernetes core. Consider creating a new repo instead.","fork":false,"url":"https://api.github.com/repos/kubernetes/contrib","forks_url":"https://api.github.com/repos/kubernetes/contrib/forks","keys_url":"https://api.github.com/repos/kubernetes/contrib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes/contrib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes/contrib/teams","hooks_url":"https://api.github.com/repos/kubernetes/contrib/hooks","issue_events_url":"https://api.github.com/repos/kubernetes/contrib/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes/contrib/events","assignees_url":"https://api.github.com/repos/kubernetes/contrib/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes/contrib/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes/contrib/tags","blobs_url":"https://api.github.com/repos/kubernetes/contrib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes/contrib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes/contrib/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes/contrib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes/contrib/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes/contrib/languages","stargazers_url":"https://api.github.com/repos/kubernetes/contrib/stargazers","contributors_url":"https://api.github.com/repos/kubernetes/contrib/contributors","subscribers_url":"https://api.github.com/repos/kubernetes/contrib/subscribers","subscription_url":"https://api.github.com/repos/kubernetes/contrib/subscription","commits_url":"https://api.github.com/repos/kubernetes/contrib/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes/contrib/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes/contrib/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes/contrib/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes/contrib/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes/contrib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes/contrib/merges","archive_url":"https://api.github.com/repos/kubernetes/contrib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes/contrib/downloads","issues_url":"https://api.github.com/repos/kubernetes/contrib/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes/contrib/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes/contrib/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes/contrib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes/contrib/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes/contrib/releases{/id}","deployments_url":"https://api.github.com/repos/kubernetes/contrib/deployments","created_at":"2015-08-13T23:18:26Z","updated_at":"2016-05-31T03:03:35Z","pushed_at":"2016-05-31T05:26:58Z","git_url":"git://github.com/kubernetes/contrib.git","ssh_url":"git@github.com:kubernetes/contrib.git","clone_url":"https://github.com/kubernetes/contrib.git","svn_url":"https://github.com/kubernetes/contrib","homepage":"","size":57796,"stargazers_count":307,"watchers_count":307,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":288,"mirror_url":null,"open_issues_count":230,"forks":288,"open_issues":230,"watchers":307,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/contrib/pulls/1089"},"html":{"href":"https://github.com/kubernetes/contrib/pull/1089"},"issue":{"href":"https://api.github.com/repos/kubernetes/contrib/issues/1089"},"comments":{"href":"https://api.github.com/repos/kubernetes/contrib/issues/1089/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/contrib/pulls/1089/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/contrib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/contrib/pulls/1089/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/contrib/statuses/3610c7254cc081f96825594a61cb80f4e010bc24"}}}}
{"actor":{"display_login":"piosz"}}