{"action":"created","comment":{"url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/pulls/comments/91218069","pull_request_review_id":11727556,"id":91218069,"diff_hunk":"@@ -0,0 +1,164 @@\n+package utils_test\n+\n+import (\n+\t\"testing\"\n+\n+\t\"fmt\"\n+\t\"os\"\n+\n+\t\"errors\"\n+\n+\t\"github.com/golang/mock/gomock\"\n+\t\"github.com/racker/rackspace-monitoring-poller/mocks\"\n+\t\"github.com/racker/rackspace-monitoring-poller/utils\"\n+)\n+\n+func NewHeartbeat() *HeartbeatTest {\n+\tf := &HeartbeatTest{}\n+\tf.Channel = \"test\"\n+\tf.EntityId = \"test2\"\n+\treturn f\n+}\n+\n+type HeartbeatTest struct {\n+\tChannel  string\n+\tEntityId string\n+}\n+\n+func getMockedConnection(t *testing.T) *poller_mock.MockConn {\n+\tmockCtrl := gomock.NewController(t)\n+\tdefer mockCtrl.Finish()\n+\treturn poller_mock.NewMockConn(mockCtrl)\n+}\n+\n+func TestStart(t *testing.T) {\n+\tmock_conn := getMockedConnection(t)\n+\terr := utils.NewSmartConn(mock_conn).Start()\n+\tif err != nil {\n+\t\tt.Fatal(fmt.Fprintf(os.Stdout, \"We threw back an error: %s\", err))\n+\t}\n+}\n+\n+func TestStartWithReadKeepalive(t *testing.T) {\n+\tmock_conn := getMockedConnection(t)\n+\tmock_conn.EXPECT().SetReadDeadline(gomock.Any()).Return(nil)\n+\tsmartConn := utils.NewSmartConn(mock_conn)\n+\tsmartConn.ReadKeepalive = 1\n+\terr := smartConn.Start()\n+\tif err != nil {\n+\t\tt.Fatal(fmt.Fprintf(os.Stdout, \"We threw back an error: %s\", err))\n+\t}\n+}\n+\n+func TestStartWithReadKeepaliveReadDeadlineFail(t *testing.T) {\n+\tmock_conn := getMockedConnection(t)\n+\tmock_conn.EXPECT().SetReadDeadline(gomock.Any()).Return(\n+\t\terrors.New(\"Failure\"))\n+\tsmartConn := utils.NewSmartConn(mock_conn)\n+\tsmartConn.ReadKeepalive = 1\n+\terr := smartConn.Start()\n+\tif err == nil || err.Error() != \"Failure\" {\n+\t\tt.Fatal(fmt.Fprintf(os.Stdout, \"We threw back the wrong error: %s\", err))\n+\t}\n+\n+}\n+\n+func TestStartHeartbeatSendSet(t *testing.T) {","path":"utils/smart_conn_test.go","position":66,"original_position":66,"commit_id":"5e48bd2fb3f1d19a34c6a58f57ecdf5c7c1f4d61","original_commit_id":"7869355689439021cd883c47696e98cda7a7f78b","user":{"login":"dimtruck","id":1155525,"avatar_url":"https://avatars.githubusercontent.com/u/1155525?v=3","gravatar_id":"","url":"https://api.github.com/users/dimtruck","html_url":"https://github.com/dimtruck","followers_url":"https://api.github.com/users/dimtruck/followers","following_url":"https://api.github.com/users/dimtruck/following{/other_user}","gists_url":"https://api.github.com/users/dimtruck/gists{/gist_id}","starred_url":"https://api.github.com/users/dimtruck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimtruck/subscriptions","organizations_url":"https://api.github.com/users/dimtruck/orgs","repos_url":"https://api.github.com/users/dimtruck/repos","events_url":"https://api.github.com/users/dimtruck/events{/privacy}","received_events_url":"https://api.github.com/users/dimtruck/received_events","type":"User","site_admin":false},"body":"I had one but it hung up on me.  I wanted to finish up other tests before coming back to this one.  ","created_at":"2016-12-07T02:50:26Z","updated_at":"2016-12-07T02:50:26Z","html_url":"https://github.com/racker/rackspace-monitoring-poller/pull/41#discussion_r91218069","pull_request_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/pulls/41","_links":{"self":{"href":"https://api.github.com/repos/racker/rackspace-monitoring-poller/pulls/comments/91218069"},"html":{"href":"https://github.com/racker/rackspace-monitoring-poller/pull/41#discussion_r91218069"},"pull_request":{"href":"https://api.github.com/repos/racker/rackspace-monitoring-poller/pulls/41"}}},"pull_request":{"url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/pulls/41","id":96667612,"html_url":"https://github.com/racker/rackspace-monitoring-poller/pull/41","diff_url":"https://github.com/racker/rackspace-monitoring-poller/pull/41.diff","patch_url":"https://github.com/racker/rackspace-monitoring-poller/pull/41.patch","issue_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/issues/41","number":41,"state":"open","locked":false,"title":"(feat): Add utils unit tests","user":{"login":"dimtruck","id":1155525,"avatar_url":"https://avatars.githubusercontent.com/u/1155525?v=3","gravatar_id":"","url":"https://api.github.com/users/dimtruck","html_url":"https://github.com/dimtruck","followers_url":"https://api.github.com/users/dimtruck/followers","following_url":"https://api.github.com/users/dimtruck/following{/other_user}","gists_url":"https://api.github.com/users/dimtruck/gists{/gist_id}","starred_url":"https://api.github.com/users/dimtruck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dimtruck/subscriptions","organizations_url":"https://api.github.com/users/dimtruck/orgs","repos_url":"https://api.github.com/users/dimtruck/repos","events_url":"https://api.github.com/users/dimtruck/events{/privacy}","received_events_url":"https://api.github.com/users/dimtruck/received_events","type":"User","site_admin":false},"body":"- added utils unit tests\r\n- added Dockerfile and docker-compose to spin up demo in docker","created_at":"2016-12-06T06:21:05Z","updated_at":"2016-12-07T02:50:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7c526dc79b21fbfc20e1c8c4a9a3fb02f9f62a77","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/pulls/41/commits","review_comments_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/pulls/41/comments","review_comment_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/pulls/comments{/number}","comments_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/issues/41/comments","statuses_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/statuses/5e48bd2fb3f1d19a34c6a58f57ecdf5c7c1f4d61","head":{"label":"racker:dimtruck/add-unit-tests","ref":"dimtruck/add-unit-tests","sha":"5e48bd2fb3f1d19a34c6a58f57ecdf5c7c1f4d61","user":{"login":"racker","id":556922,"avatar_url":"https://avatars.githubusercontent.com/u/556922?v=3","gravatar_id":"","url":"https://api.github.com/users/racker","html_url":"https://github.com/racker","followers_url":"https://api.github.com/users/racker/followers","following_url":"https://api.github.com/users/racker/following{/other_user}","gists_url":"https://api.github.com/users/racker/gists{/gist_id}","starred_url":"https://api.github.com/users/racker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/racker/subscriptions","organizations_url":"https://api.github.com/users/racker/orgs","repos_url":"https://api.github.com/users/racker/repos","events_url":"https://api.github.com/users/racker/events{/privacy}","received_events_url":"https://api.github.com/users/racker/received_events","type":"Organization","site_admin":false},"repo":{"id":73305378,"name":"rackspace-monitoring-poller","full_name":"racker/rackspace-monitoring-poller","owner":{"login":"racker","id":556922,"avatar_url":"https://avatars.githubusercontent.com/u/556922?v=3","gravatar_id":"","url":"https://api.github.com/users/racker","html_url":"https://github.com/racker","followers_url":"https://api.github.com/users/racker/followers","following_url":"https://api.github.com/users/racker/following{/other_user}","gists_url":"https://api.github.com/users/racker/gists{/gist_id}","starred_url":"https://api.github.com/users/racker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/racker/subscriptions","organizations_url":"https://api.github.com/users/racker/orgs","repos_url":"https://api.github.com/users/racker/repos","events_url":"https://api.github.com/users/racker/events{/privacy}","received_events_url":"https://api.github.com/users/racker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/racker/rackspace-monitoring-poller","description":"Rackspace Monitoring Poller","fork":false,"url":"https://api.github.com/repos/racker/rackspace-monitoring-poller","forks_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/forks","keys_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/keys{/key_id}","collaborators_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/teams","hooks_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/hooks","issue_events_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/issues/events{/number}","events_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/events","assignees_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/assignees{/user}","branches_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/branches{/branch}","tags_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/tags","blobs_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/git/refs{/sha}","trees_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/git/trees{/sha}","statuses_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/statuses/{sha}","languages_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/languages","stargazers_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/stargazers","contributors_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/contributors","subscribers_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/subscribers","subscription_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/subscription","commits_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/commits{/sha}","git_commits_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/git/commits{/sha}","comments_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/comments{/number}","issue_comment_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/issues/comments{/number}","contents_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/contents/{+path}","compare_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/compare/{base}...{head}","merges_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/merges","archive_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/downloads","issues_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/issues{/number}","pulls_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/pulls{/number}","milestones_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/milestones{/number}","notifications_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/labels{/name}","releases_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/releases{/id}","deployments_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/deployments","created_at":"2016-11-09T17:23:22Z","updated_at":"2016-11-30T22:18:56Z","pushed_at":"2016-12-07T02:38:10Z","git_url":"git://github.com/racker/rackspace-monitoring-poller.git","ssh_url":"git@github.com:racker/rackspace-monitoring-poller.git","clone_url":"https://github.com/racker/rackspace-monitoring-poller.git","svn_url":"https://github.com/racker/rackspace-monitoring-poller","homepage":"","size":137,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":9,"forks":0,"open_issues":9,"watchers":1,"default_branch":"master"}},"base":{"label":"racker:master","ref":"master","sha":"5056b54220ad8b611d5354f22a10fc15ae9df3a6","user":{"login":"racker","id":556922,"avatar_url":"https://avatars.githubusercontent.com/u/556922?v=3","gravatar_id":"","url":"https://api.github.com/users/racker","html_url":"https://github.com/racker","followers_url":"https://api.github.com/users/racker/followers","following_url":"https://api.github.com/users/racker/following{/other_user}","gists_url":"https://api.github.com/users/racker/gists{/gist_id}","starred_url":"https://api.github.com/users/racker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/racker/subscriptions","organizations_url":"https://api.github.com/users/racker/orgs","repos_url":"https://api.github.com/users/racker/repos","events_url":"https://api.github.com/users/racker/events{/privacy}","received_events_url":"https://api.github.com/users/racker/received_events","type":"Organization","site_admin":false},"repo":{"id":73305378,"name":"rackspace-monitoring-poller","full_name":"racker/rackspace-monitoring-poller","owner":{"login":"racker","id":556922,"avatar_url":"https://avatars.githubusercontent.com/u/556922?v=3","gravatar_id":"","url":"https://api.github.com/users/racker","html_url":"https://github.com/racker","followers_url":"https://api.github.com/users/racker/followers","following_url":"https://api.github.com/users/racker/following{/other_user}","gists_url":"https://api.github.com/users/racker/gists{/gist_id}","starred_url":"https://api.github.com/users/racker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/racker/subscriptions","organizations_url":"https://api.github.com/users/racker/orgs","repos_url":"https://api.github.com/users/racker/repos","events_url":"https://api.github.com/users/racker/events{/privacy}","received_events_url":"https://api.github.com/users/racker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/racker/rackspace-monitoring-poller","description":"Rackspace Monitoring Poller","fork":false,"url":"https://api.github.com/repos/racker/rackspace-monitoring-poller","forks_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/forks","keys_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/keys{/key_id}","collaborators_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/teams","hooks_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/hooks","issue_events_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/issues/events{/number}","events_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/events","assignees_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/assignees{/user}","branches_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/branches{/branch}","tags_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/tags","blobs_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/git/refs{/sha}","trees_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/git/trees{/sha}","statuses_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/statuses/{sha}","languages_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/languages","stargazers_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/stargazers","contributors_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/contributors","subscribers_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/subscribers","subscription_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/subscription","commits_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/commits{/sha}","git_commits_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/git/commits{/sha}","comments_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/comments{/number}","issue_comment_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/issues/comments{/number}","contents_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/contents/{+path}","compare_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/compare/{base}...{head}","merges_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/merges","archive_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/downloads","issues_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/issues{/number}","pulls_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/pulls{/number}","milestones_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/milestones{/number}","notifications_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/labels{/name}","releases_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/releases{/id}","deployments_url":"https://api.github.com/repos/racker/rackspace-monitoring-poller/deployments","created_at":"2016-11-09T17:23:22Z","updated_at":"2016-11-30T22:18:56Z","pushed_at":"2016-12-07T02:38:10Z","git_url":"git://github.com/racker/rackspace-monitoring-poller.git","ssh_url":"git@github.com:racker/rackspace-monitoring-poller.git","clone_url":"https://github.com/racker/rackspace-monitoring-poller.git","svn_url":"https://github.com/racker/rackspace-monitoring-poller","homepage":"","size":137,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":9,"forks":0,"open_issues":9,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/racker/rackspace-monitoring-poller/pulls/41"},"html":{"href":"https://github.com/racker/rackspace-monitoring-poller/pull/41"},"issue":{"href":"https://api.github.com/repos/racker/rackspace-monitoring-poller/issues/41"},"comments":{"href":"https://api.github.com/repos/racker/rackspace-monitoring-poller/issues/41/comments"},"review_comments":{"href":"https://api.github.com/repos/racker/rackspace-monitoring-poller/pulls/41/comments"},"review_comment":{"href":"https://api.github.com/repos/racker/rackspace-monitoring-poller/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/racker/rackspace-monitoring-poller/pulls/41/commits"},"statuses":{"href":"https://api.github.com/repos/racker/rackspace-monitoring-poller/statuses/5e48bd2fb3f1d19a34c6a58f57ecdf5c7c1f4d61"}}}}
{"actor":{"display_login":"dimtruck"}}