{"action":"created","comment":{"url":"https://api.github.com/repos/ubclaunchpad/rocket/pulls/comments/195946885","pull_request_review_id":129406321,"id":195946885,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NTk0Njg4NQ==","diff_hunk":"@@ -0,0 +1,26 @@\n+# This script handles local database creation to make testing easier.\n+# Run with `make db`\n+\n+postgres -V\n+if [ \"$?\" -gt \"0\" ]; then\n+  echo \"MAKE: Postgres not installed!\"\n+  exit 1\n+fi\n+\n+echo \"MAKE: Killing existing postgres processes...\"\n+pg_ctl -D /usr/local/var/postgres stop -s -m fast\n+pg_ctl -D /usr/local/var/postgres start\n+while true; do\n+  pg_ctl -D /usr/local/var/postgres status\n+  if [ \"$?\" -gt \"0\" ]; then\n+    echo \"MAKE: Waiting for postgres to start...\"\n+    sleep 3\n+  else\n+    break\n+  fi\n+done\n+\n+createuser -s rocket_test\n+createdb rocket_test_db\n+psql -d rocket_test_db -a -f ./schema/tables.sql\n+echo \"MAKE: Local database ready to go!\"","path":"mock_db.sh","position":26,"original_position":26,"commit_id":"d23defe4b3377c5da903108d58725a1e9b286080","original_commit_id":"d23defe4b3377c5da903108d58725a1e9b286080","user":{"login":"bfbachmann","id":9647946,"node_id":"MDQ6VXNlcjk2NDc5NDY=","avatar_url":"https://avatars1.githubusercontent.com/u/9647946?v=4","gravatar_id":"","url":"https://api.github.com/users/bfbachmann","html_url":"https://github.com/bfbachmann","followers_url":"https://api.github.com/users/bfbachmann/followers","following_url":"https://api.github.com/users/bfbachmann/following{/other_user}","gists_url":"https://api.github.com/users/bfbachmann/gists{/gist_id}","starred_url":"https://api.github.com/users/bfbachmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bfbachmann/subscriptions","organizations_url":"https://api.github.com/users/bfbachmann/orgs","repos_url":"https://api.github.com/users/bfbachmann/repos","events_url":"https://api.github.com/users/bfbachmann/events{/privacy}","received_events_url":"https://api.github.com/users/bfbachmann/received_events","type":"User","site_admin":false},"body":"I think we could get rid of most of this logic by just containerizing our DB for tests. Also, we don't need to wait for the DB to start with a script like this, go-pg does it for you: https://github.com/ubclaunchpad/rocket/blob/master/data/dal.go#L24.","created_at":"2018-06-18T00:24:56Z","updated_at":"2018-06-18T00:33:09Z","html_url":"https://github.com/ubclaunchpad/rocket/pull/76#discussion_r195946885","pull_request_url":"https://api.github.com/repos/ubclaunchpad/rocket/pulls/76","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/ubclaunchpad/rocket/pulls/comments/195946885"},"html":{"href":"https://github.com/ubclaunchpad/rocket/pull/76#discussion_r195946885"},"pull_request":{"href":"https://api.github.com/repos/ubclaunchpad/rocket/pulls/76"}}},"pull_request":{"url":"https://api.github.com/repos/ubclaunchpad/rocket/pulls/76","id":195398378,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1Mzk4Mzc4","html_url":"https://github.com/ubclaunchpad/rocket/pull/76","diff_url":"https://github.com/ubclaunchpad/rocket/pull/76.diff","patch_url":"https://github.com/ubclaunchpad/rocket/pull/76.patch","issue_url":"https://api.github.com/repos/ubclaunchpad/rocket/issues/76","number":76,"state":"open","locked":false,"title":"Create mock DB setup, postgres integration tests","user":{"login":"bobheadxi","id":23356519,"node_id":"MDQ6VXNlcjIzMzU2NTE5","avatar_url":"https://avatars2.githubusercontent.com/u/23356519?v=4","gravatar_id":"","url":"https://api.github.com/users/bobheadxi","html_url":"https://github.com/bobheadxi","followers_url":"https://api.github.com/users/bobheadxi/followers","following_url":"https://api.github.com/users/bobheadxi/following{/other_user}","gists_url":"https://api.github.com/users/bobheadxi/gists{/gist_id}","starred_url":"https://api.github.com/users/bobheadxi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bobheadxi/subscriptions","organizations_url":"https://api.github.com/users/bobheadxi/orgs","repos_url":"https://api.github.com/users/bobheadxi/repos","events_url":"https://api.github.com/users/bobheadxi/events{/privacy}","received_events_url":"https://api.github.com/users/bobheadxi/received_events","type":"User","site_admin":false},"body":"- Added mock DB setup, with `func newTestDBConnection() (*DAL, func(), error)` that begins transactions and rolls back after each test.\r\n\r\n- Bump postgres driver version (current one is more than a year old), update `Update()` functions accordingly with new `WherePK()` requirement. Read up on it a bit and there doesn't seem to be any other breaking changes.\r\n\r\n- Change `data.dal.db` type from `*pg.DB` to `orm.DB`, an interface shared between `pg.Tx` and `pg.DB` for testing purposes.\r\n\r\n- Updated README documentation.\r\n\r\n```\r\nmake test-integration\r\n```\r\n\r\nCoverage dropped a bit because a new package has been introduced to Coveralls (it doesn't automatically calculate coverage against all packages, only those that have at least one test)","created_at":"2018-06-17T22:27:20Z","updated_at":"2018-06-18T00:33:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1e4c426d82b868354a7f9a51d0f3b29b21f219c7","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":966293719,"node_id":"MDU6TGFiZWw5NjYyOTM3MTk=","url":"https://api.github.com/repos/ubclaunchpad/rocket/labels/status:%20review","name":"status: review","color":"0e8a16","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ubclaunchpad/rocket/pulls/76/commits","review_comments_url":"https://api.github.com/repos/ubclaunchpad/rocket/pulls/76/comments","review_comment_url":"https://api.github.com/repos/ubclaunchpad/rocket/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ubclaunchpad/rocket/issues/76/comments","statuses_url":"https://api.github.com/repos/ubclaunchpad/rocket/statuses/d23defe4b3377c5da903108d58725a1e9b286080","head":{"label":"ubclaunchpad:test-db","ref":"test-db","sha":"d23defe4b3377c5da903108d58725a1e9b286080","user":{"login":"ubclaunchpad","id":12406312,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNDA2MzEy","avatar_url":"https://avatars3.githubusercontent.com/u/12406312?v=4","gravatar_id":"","url":"https://api.github.com/users/ubclaunchpad","html_url":"https://github.com/ubclaunchpad","followers_url":"https://api.github.com/users/ubclaunchpad/followers","following_url":"https://api.github.com/users/ubclaunchpad/following{/other_user}","gists_url":"https://api.github.com/users/ubclaunchpad/gists{/gist_id}","starred_url":"https://api.github.com/users/ubclaunchpad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ubclaunchpad/subscriptions","organizations_url":"https://api.github.com/users/ubclaunchpad/orgs","repos_url":"https://api.github.com/users/ubclaunchpad/repos","events_url":"https://api.github.com/users/ubclaunchpad/events{/privacy}","received_events_url":"https://api.github.com/users/ubclaunchpad/received_events","type":"Organization","site_admin":false},"repo":{"id":93810980,"node_id":"MDEwOlJlcG9zaXRvcnk5MzgxMDk4MA==","name":"rocket","full_name":"ubclaunchpad/rocket","owner":{"login":"ubclaunchpad","id":12406312,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNDA2MzEy","avatar_url":"https://avatars3.githubusercontent.com/u/12406312?v=4","gravatar_id":"","url":"https://api.github.com/users/ubclaunchpad","html_url":"https://github.com/ubclaunchpad","followers_url":"https://api.github.com/users/ubclaunchpad/followers","following_url":"https://api.github.com/users/ubclaunchpad/following{/other_user}","gists_url":"https://api.github.com/users/ubclaunchpad/gists{/gist_id}","starred_url":"https://api.github.com/users/ubclaunchpad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ubclaunchpad/subscriptions","organizations_url":"https://api.github.com/users/ubclaunchpad/orgs","repos_url":"https://api.github.com/users/ubclaunchpad/repos","events_url":"https://api.github.com/users/ubclaunchpad/events{/privacy}","received_events_url":"https://api.github.com/users/ubclaunchpad/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ubclaunchpad/rocket","description":":rocket: Slack bot for UBC Launch Pad","fork":false,"url":"https://api.github.com/repos/ubclaunchpad/rocket","forks_url":"https://api.github.com/repos/ubclaunchpad/rocket/forks","keys_url":"https://api.github.com/repos/ubclaunchpad/rocket/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ubclaunchpad/rocket/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ubclaunchpad/rocket/teams","hooks_url":"https://api.github.com/repos/ubclaunchpad/rocket/hooks","issue_events_url":"https://api.github.com/repos/ubclaunchpad/rocket/issues/events{/number}","events_url":"https://api.github.com/repos/ubclaunchpad/rocket/events","assignees_url":"https://api.github.com/repos/ubclaunchpad/rocket/assignees{/user}","branches_url":"https://api.github.com/repos/ubclaunchpad/rocket/branches{/branch}","tags_url":"https://api.github.com/repos/ubclaunchpad/rocket/tags","blobs_url":"https://api.github.com/repos/ubclaunchpad/rocket/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ubclaunchpad/rocket/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ubclaunchpad/rocket/git/refs{/sha}","trees_url":"https://api.github.com/repos/ubclaunchpad/rocket/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ubclaunchpad/rocket/statuses/{sha}","languages_url":"https://api.github.com/repos/ubclaunchpad/rocket/languages","stargazers_url":"https://api.github.com/repos/ubclaunchpad/rocket/stargazers","contributors_url":"https://api.github.com/repos/ubclaunchpad/rocket/contributors","subscribers_url":"https://api.github.com/repos/ubclaunchpad/rocket/subscribers","subscription_url":"https://api.github.com/repos/ubclaunchpad/rocket/subscription","commits_url":"https://api.github.com/repos/ubclaunchpad/rocket/commits{/sha}","git_commits_url":"https://api.github.com/repos/ubclaunchpad/rocket/git/commits{/sha}","comments_url":"https://api.github.com/repos/ubclaunchpad/rocket/comments{/number}","issue_comment_url":"https://api.github.com/repos/ubclaunchpad/rocket/issues/comments{/number}","contents_url":"https://api.github.com/repos/ubclaunchpad/rocket/contents/{+path}","compare_url":"https://api.github.com/repos/ubclaunchpad/rocket/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ubclaunchpad/rocket/merges","archive_url":"https://api.github.com/repos/ubclaunchpad/rocket/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ubclaunchpad/rocket/downloads","issues_url":"https://api.github.com/repos/ubclaunchpad/rocket/issues{/number}","pulls_url":"https://api.github.com/repos/ubclaunchpad/rocket/pulls{/number}","milestones_url":"https://api.github.com/repos/ubclaunchpad/rocket/milestones{/number}","notifications_url":"https://api.github.com/repos/ubclaunchpad/rocket/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ubclaunchpad/rocket/labels{/name}","releases_url":"https://api.github.com/repos/ubclaunchpad/rocket/releases{/id}","deployments_url":"https://api.github.com/repos/ubclaunchpad/rocket/deployments","created_at":"2017-06-09T02:32:20Z","updated_at":"2018-06-17T22:32:45Z","pushed_at":"2018-06-17T23:54:31Z","git_url":"git://github.com/ubclaunchpad/rocket.git","ssh_url":"git@github.com:ubclaunchpad/rocket.git","clone_url":"https://github.com/ubclaunchpad/rocket.git","svn_url":"https://github.com/ubclaunchpad/rocket","homepage":"","size":172,"stargazers_count":2,"watchers_count":2,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":10,"license":null,"forks":0,"open_issues":10,"watchers":2,"default_branch":"master"}},"base":{"label":"ubclaunchpad:master","ref":"master","sha":"5992633490134cdf3c4303150ffe635ae67fc222","user":{"login":"ubclaunchpad","id":12406312,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNDA2MzEy","avatar_url":"https://avatars3.githubusercontent.com/u/12406312?v=4","gravatar_id":"","url":"https://api.github.com/users/ubclaunchpad","html_url":"https://github.com/ubclaunchpad","followers_url":"https://api.github.com/users/ubclaunchpad/followers","following_url":"https://api.github.com/users/ubclaunchpad/following{/other_user}","gists_url":"https://api.github.com/users/ubclaunchpad/gists{/gist_id}","starred_url":"https://api.github.com/users/ubclaunchpad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ubclaunchpad/subscriptions","organizations_url":"https://api.github.com/users/ubclaunchpad/orgs","repos_url":"https://api.github.com/users/ubclaunchpad/repos","events_url":"https://api.github.com/users/ubclaunchpad/events{/privacy}","received_events_url":"https://api.github.com/users/ubclaunchpad/received_events","type":"Organization","site_admin":false},"repo":{"id":93810980,"node_id":"MDEwOlJlcG9zaXRvcnk5MzgxMDk4MA==","name":"rocket","full_name":"ubclaunchpad/rocket","owner":{"login":"ubclaunchpad","id":12406312,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEyNDA2MzEy","avatar_url":"https://avatars3.githubusercontent.com/u/12406312?v=4","gravatar_id":"","url":"https://api.github.com/users/ubclaunchpad","html_url":"https://github.com/ubclaunchpad","followers_url":"https://api.github.com/users/ubclaunchpad/followers","following_url":"https://api.github.com/users/ubclaunchpad/following{/other_user}","gists_url":"https://api.github.com/users/ubclaunchpad/gists{/gist_id}","starred_url":"https://api.github.com/users/ubclaunchpad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ubclaunchpad/subscriptions","organizations_url":"https://api.github.com/users/ubclaunchpad/orgs","repos_url":"https://api.github.com/users/ubclaunchpad/repos","events_url":"https://api.github.com/users/ubclaunchpad/events{/privacy}","received_events_url":"https://api.github.com/users/ubclaunchpad/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ubclaunchpad/rocket","description":":rocket: Slack bot for UBC Launch Pad","fork":false,"url":"https://api.github.com/repos/ubclaunchpad/rocket","forks_url":"https://api.github.com/repos/ubclaunchpad/rocket/forks","keys_url":"https://api.github.com/repos/ubclaunchpad/rocket/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ubclaunchpad/rocket/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ubclaunchpad/rocket/teams","hooks_url":"https://api.github.com/repos/ubclaunchpad/rocket/hooks","issue_events_url":"https://api.github.com/repos/ubclaunchpad/rocket/issues/events{/number}","events_url":"https://api.github.com/repos/ubclaunchpad/rocket/events","assignees_url":"https://api.github.com/repos/ubclaunchpad/rocket/assignees{/user}","branches_url":"https://api.github.com/repos/ubclaunchpad/rocket/branches{/branch}","tags_url":"https://api.github.com/repos/ubclaunchpad/rocket/tags","blobs_url":"https://api.github.com/repos/ubclaunchpad/rocket/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ubclaunchpad/rocket/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ubclaunchpad/rocket/git/refs{/sha}","trees_url":"https://api.github.com/repos/ubclaunchpad/rocket/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ubclaunchpad/rocket/statuses/{sha}","languages_url":"https://api.github.com/repos/ubclaunchpad/rocket/languages","stargazers_url":"https://api.github.com/repos/ubclaunchpad/rocket/stargazers","contributors_url":"https://api.github.com/repos/ubclaunchpad/rocket/contributors","subscribers_url":"https://api.github.com/repos/ubclaunchpad/rocket/subscribers","subscription_url":"https://api.github.com/repos/ubclaunchpad/rocket/subscription","commits_url":"https://api.github.com/repos/ubclaunchpad/rocket/commits{/sha}","git_commits_url":"https://api.github.com/repos/ubclaunchpad/rocket/git/commits{/sha}","comments_url":"https://api.github.com/repos/ubclaunchpad/rocket/comments{/number}","issue_comment_url":"https://api.github.com/repos/ubclaunchpad/rocket/issues/comments{/number}","contents_url":"https://api.github.com/repos/ubclaunchpad/rocket/contents/{+path}","compare_url":"https://api.github.com/repos/ubclaunchpad/rocket/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ubclaunchpad/rocket/merges","archive_url":"https://api.github.com/repos/ubclaunchpad/rocket/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ubclaunchpad/rocket/downloads","issues_url":"https://api.github.com/repos/ubclaunchpad/rocket/issues{/number}","pulls_url":"https://api.github.com/repos/ubclaunchpad/rocket/pulls{/number}","milestones_url":"https://api.github.com/repos/ubclaunchpad/rocket/milestones{/number}","notifications_url":"https://api.github.com/repos/ubclaunchpad/rocket/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ubclaunchpad/rocket/labels{/name}","releases_url":"https://api.github.com/repos/ubclaunchpad/rocket/releases{/id}","deployments_url":"https://api.github.com/repos/ubclaunchpad/rocket/deployments","created_at":"2017-06-09T02:32:20Z","updated_at":"2018-06-17T22:32:45Z","pushed_at":"2018-06-17T23:54:31Z","git_url":"git://github.com/ubclaunchpad/rocket.git","ssh_url":"git@github.com:ubclaunchpad/rocket.git","clone_url":"https://github.com/ubclaunchpad/rocket.git","svn_url":"https://github.com/ubclaunchpad/rocket","homepage":"","size":172,"stargazers_count":2,"watchers_count":2,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":10,"license":null,"forks":0,"open_issues":10,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ubclaunchpad/rocket/pulls/76"},"html":{"href":"https://github.com/ubclaunchpad/rocket/pull/76"},"issue":{"href":"https://api.github.com/repos/ubclaunchpad/rocket/issues/76"},"comments":{"href":"https://api.github.com/repos/ubclaunchpad/rocket/issues/76/comments"},"review_comments":{"href":"https://api.github.com/repos/ubclaunchpad/rocket/pulls/76/comments"},"review_comment":{"href":"https://api.github.com/repos/ubclaunchpad/rocket/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ubclaunchpad/rocket/pulls/76/commits"},"statuses":{"href":"https://api.github.com/repos/ubclaunchpad/rocket/statuses/d23defe4b3377c5da903108d58725a1e9b286080"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"bfbachmann"}}