{"action":"created","comment":{"url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/pulls/comments/103884423","pull_request_review_id":24687594,"id":103884423,"diff_hunk":"@@ -0,0 +1,115 @@\n+var MongoClient = require('mongodb').MongoClient;\n+var assert = require('assert');\n+var sinon = require('sinon');\n+var _ = require('underscore');\n+var defaultDataHandlersModule = require('../../lib/sync/default-dataHandlers');\n+var dataHandlersModule = require('../../lib/sync/dataHandlers');\n+\n+var DATASETID = \"collisionHandlersTest\";\n+var MONGODB_URL = \"mongodb://127.0.0.1:27017/test\";\n+\n+var mongodb;\n+var dataHandlers;\n+var defaultHandlers;\n+\n+function getCollisionData() {\n+  return {\n+    pre: { test: 'test1' },\n+    post: { test: 'test2' },\n+    hash: 'testhash',\n+    ts: Date.now(),\n+    uid: 'testUid'\n+  };\n+}\n+\n+module.exports = {\n+  'before': function(done) {\n+    MongoClient.connect(MONGODB_URL, function(err, db){\n+      if (err) {\n+        console.log('mongodb connection error', err);\n+        return done(err);\n+      }\n+      mongodb = db;\n+      mongodb.dropCollection(DATASETID + '_collision');\n+      defaultHandlers = defaultDataHandlersModule(mongodb);\n+      dataHandlers = dataHandlersModule({\n+        defaultHandlers: defaultHandlers\n+      });\n+      return done(err);\n+    });\n+  },\n+  'afterEach': function(done) {","path":"integration/sync/test_collision-handlers.js","position":41,"original_position":41,"commit_id":"8a4beedc65ba5fd483e5cd58e14fc4252f9f2f50","original_commit_id":"8a4beedc65ba5fd483e5cd58e14fc4252f9f2f50","user":{"login":"wei-lee","id":912729,"avatar_url":"https://avatars0.githubusercontent.com/u/912729?v=3","gravatar_id":"","url":"https://api.github.com/users/wei-lee","html_url":"https://github.com/wei-lee","followers_url":"https://api.github.com/users/wei-lee/followers","following_url":"https://api.github.com/users/wei-lee/following{/other_user}","gists_url":"https://api.github.com/users/wei-lee/gists{/gist_id}","starred_url":"https://api.github.com/users/wei-lee/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wei-lee/subscriptions","organizations_url":"https://api.github.com/users/wei-lee/orgs","repos_url":"https://api.github.com/users/wei-lee/repos","events_url":"https://api.github.com/users/wei-lee/events{/privacy}","received_events_url":"https://api.github.com/users/wei-lee/received_events","type":"User","site_admin":false},"body":"similarly to the above, put this inside another object. Otherwise this will run before every test","created_at":"2017-03-02T09:41:58Z","updated_at":"2017-03-02T09:41:58Z","html_url":"https://github.com/feedhenry/fh-mbaas-api/pull/72#discussion_r103884423","pull_request_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/pulls/72","_links":{"self":{"href":"https://api.github.com/repos/feedhenry/fh-mbaas-api/pulls/comments/103884423"},"html":{"href":"https://github.com/feedhenry/fh-mbaas-api/pull/72#discussion_r103884423"},"pull_request":{"href":"https://api.github.com/repos/feedhenry/fh-mbaas-api/pulls/72"}}},"pull_request":{"url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/pulls/72","id":108578902,"html_url":"https://github.com/feedhenry/fh-mbaas-api/pull/72","diff_url":"https://github.com/feedhenry/fh-mbaas-api/pull/72.diff","patch_url":"https://github.com/feedhenry/fh-mbaas-api/pull/72.patch","issue_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/issues/72","number":72,"state":"open","locked":false,"title":"FH-3198 Test collision handlers","user":{"login":"aidenkeating","id":8698527,"avatar_url":"https://avatars0.githubusercontent.com/u/8698527?v=3","gravatar_id":"","url":"https://api.github.com/users/aidenkeating","html_url":"https://github.com/aidenkeating","followers_url":"https://api.github.com/users/aidenkeating/followers","following_url":"https://api.github.com/users/aidenkeating/following{/other_user}","gists_url":"https://api.github.com/users/aidenkeating/gists{/gist_id}","starred_url":"https://api.github.com/users/aidenkeating/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aidenkeating/subscriptions","organizations_url":"https://api.github.com/users/aidenkeating/orgs","repos_url":"https://api.github.com/users/aidenkeating/repos","events_url":"https://api.github.com/users/aidenkeating/events{/privacy}","received_events_url":"https://api.github.com/users/aidenkeating/received_events","type":"User","site_admin":false},"body":"This adds tests for overriding the collision handlers and the default\r\ncollision handlers.\r\n\r\nThis also includes fixes for the collision handling itself that were\r\nuncovered during testing.","created_at":"2017-03-01T16:43:32Z","updated_at":"2017-03-02T09:41:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a3aa517b73723a8d76781d7dd26262b1bfdac826","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/pulls/72/commits","review_comments_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/pulls/72/comments","review_comment_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/issues/72/comments","statuses_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/statuses/8a4beedc65ba5fd483e5cd58e14fc4252f9f2f50","head":{"label":"aidenkeating:FH-3198_collision-tests","ref":"FH-3198_collision-tests","sha":"8a4beedc65ba5fd483e5cd58e14fc4252f9f2f50","user":{"login":"aidenkeating","id":8698527,"avatar_url":"https://avatars0.githubusercontent.com/u/8698527?v=3","gravatar_id":"","url":"https://api.github.com/users/aidenkeating","html_url":"https://github.com/aidenkeating","followers_url":"https://api.github.com/users/aidenkeating/followers","following_url":"https://api.github.com/users/aidenkeating/following{/other_user}","gists_url":"https://api.github.com/users/aidenkeating/gists{/gist_id}","starred_url":"https://api.github.com/users/aidenkeating/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aidenkeating/subscriptions","organizations_url":"https://api.github.com/users/aidenkeating/orgs","repos_url":"https://api.github.com/users/aidenkeating/repos","events_url":"https://api.github.com/users/aidenkeating/events{/privacy}","received_events_url":"https://api.github.com/users/aidenkeating/received_events","type":"User","site_admin":false},"repo":{"id":79214908,"name":"fh-mbaas-api","full_name":"aidenkeating/fh-mbaas-api","owner":{"login":"aidenkeating","id":8698527,"avatar_url":"https://avatars0.githubusercontent.com/u/8698527?v=3","gravatar_id":"","url":"https://api.github.com/users/aidenkeating","html_url":"https://github.com/aidenkeating","followers_url":"https://api.github.com/users/aidenkeating/followers","following_url":"https://api.github.com/users/aidenkeating/following{/other_user}","gists_url":"https://api.github.com/users/aidenkeating/gists{/gist_id}","starred_url":"https://api.github.com/users/aidenkeating/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aidenkeating/subscriptions","organizations_url":"https://api.github.com/users/aidenkeating/orgs","repos_url":"https://api.github.com/users/aidenkeating/repos","events_url":"https://api.github.com/users/aidenkeating/events{/privacy}","received_events_url":"https://api.github.com/users/aidenkeating/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aidenkeating/fh-mbaas-api","description":null,"fork":true,"url":"https://api.github.com/repos/aidenkeating/fh-mbaas-api","forks_url":"https://api.github.com/repos/aidenkeating/fh-mbaas-api/forks","keys_url":"https://api.github.com/repos/aidenkeating/fh-mbaas-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aidenkeating/fh-mbaas-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aidenkeating/fh-mbaas-api/teams","hooks_url":"https://api.github.com/repos/aidenkeating/fh-mbaas-api/hooks","issue_events_url":"https://api.github.com/repos/aidenkeating/fh-mbaas-api/issues/events{/number}","events_url":"https://api.github.com/repos/aidenkeating/fh-mbaas-api/events","assignees_url":"https://api.github.com/repos/aidenkeating/fh-mbaas-api/assignees{/user}","branches_url":"https://api.github.com/repos/aidenkeating/fh-mbaas-api/branches{/branch}","tags_url":"https://api.github.com/repos/aidenkeating/fh-mbaas-api/tags","blobs_url":"https://api.github.com/repos/aidenkeating/fh-mbaas-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aidenkeating/fh-mbaas-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aidenkeating/fh-mbaas-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/aidenkeating/fh-mbaas-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aidenkeating/fh-mbaas-api/statuses/{sha}","languages_url":"https://api.github.com/repos/aidenkeating/fh-mbaas-api/languages","stargazers_url":"https://api.github.com/repos/aidenkeating/fh-mbaas-api/stargazers","contributors_url":"https://api.github.com/repos/aidenkeating/fh-mbaas-api/contributors","subscribers_url":"https://api.github.com/repos/aidenkeating/fh-mbaas-api/subscribers","subscription_url":"https://api.github.com/repos/aidenkeating/fh-mbaas-api/subscription","commits_url":"https://api.github.com/repos/aidenkeating/fh-mbaas-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/aidenkeating/fh-mbaas-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/aidenkeating/fh-mbaas-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/aidenkeating/fh-mbaas-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/aidenkeating/fh-mbaas-api/contents/{+path}","compare_url":"https://api.github.com/repos/aidenkeating/fh-mbaas-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aidenkeating/fh-mbaas-api/merges","archive_url":"https://api.github.com/repos/aidenkeating/fh-mbaas-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aidenkeating/fh-mbaas-api/downloads","issues_url":"https://api.github.com/repos/aidenkeating/fh-mbaas-api/issues{/number}","pulls_url":"https://api.github.com/repos/aidenkeating/fh-mbaas-api/pulls{/number}","milestones_url":"https://api.github.com/repos/aidenkeating/fh-mbaas-api/milestones{/number}","notifications_url":"https://api.github.com/repos/aidenkeating/fh-mbaas-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aidenkeating/fh-mbaas-api/labels{/name}","releases_url":"https://api.github.com/repos/aidenkeating/fh-mbaas-api/releases{/id}","deployments_url":"https://api.github.com/repos/aidenkeating/fh-mbaas-api/deployments","created_at":"2017-01-17T10:11:21Z","updated_at":"2017-01-17T10:11:24Z","pushed_at":"2017-03-02T09:27:49Z","git_url":"git://github.com/aidenkeating/fh-mbaas-api.git","ssh_url":"git@github.com:aidenkeating/fh-mbaas-api.git","clone_url":"https://github.com/aidenkeating/fh-mbaas-api.git","svn_url":"https://github.com/aidenkeating/fh-mbaas-api","homepage":null,"size":1062,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"feedhenry:FH-3123-sync-horizontal-scaling","ref":"FH-3123-sync-horizontal-scaling","sha":"b99d55f1fbdcb46346a3680a4e8c9f5fb0c981b6","user":{"login":"feedhenry","id":772226,"avatar_url":"https://avatars3.githubusercontent.com/u/772226?v=3","gravatar_id":"","url":"https://api.github.com/users/feedhenry","html_url":"https://github.com/feedhenry","followers_url":"https://api.github.com/users/feedhenry/followers","following_url":"https://api.github.com/users/feedhenry/following{/other_user}","gists_url":"https://api.github.com/users/feedhenry/gists{/gist_id}","starred_url":"https://api.github.com/users/feedhenry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feedhenry/subscriptions","organizations_url":"https://api.github.com/users/feedhenry/orgs","repos_url":"https://api.github.com/users/feedhenry/repos","events_url":"https://api.github.com/users/feedhenry/events{/privacy}","received_events_url":"https://api.github.com/users/feedhenry/received_events","type":"Organization","site_admin":false},"repo":{"id":62570841,"name":"fh-mbaas-api","full_name":"feedhenry/fh-mbaas-api","owner":{"login":"feedhenry","id":772226,"avatar_url":"https://avatars3.githubusercontent.com/u/772226?v=3","gravatar_id":"","url":"https://api.github.com/users/feedhenry","html_url":"https://github.com/feedhenry","followers_url":"https://api.github.com/users/feedhenry/followers","following_url":"https://api.github.com/users/feedhenry/following{/other_user}","gists_url":"https://api.github.com/users/feedhenry/gists{/gist_id}","starred_url":"https://api.github.com/users/feedhenry/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feedhenry/subscriptions","organizations_url":"https://api.github.com/users/feedhenry/orgs","repos_url":"https://api.github.com/users/feedhenry/repos","events_url":"https://api.github.com/users/feedhenry/events{/privacy}","received_events_url":"https://api.github.com/users/feedhenry/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/feedhenry/fh-mbaas-api","description":null,"fork":false,"url":"https://api.github.com/repos/feedhenry/fh-mbaas-api","forks_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/forks","keys_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/teams","hooks_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/hooks","issue_events_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/issues/events{/number}","events_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/events","assignees_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/assignees{/user}","branches_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/branches{/branch}","tags_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/tags","blobs_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/statuses/{sha}","languages_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/languages","stargazers_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/stargazers","contributors_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/contributors","subscribers_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/subscribers","subscription_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/subscription","commits_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/contents/{+path}","compare_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/merges","archive_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/downloads","issues_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/issues{/number}","pulls_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/pulls{/number}","milestones_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/milestones{/number}","notifications_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/labels{/name}","releases_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/releases{/id}","deployments_url":"https://api.github.com/repos/feedhenry/fh-mbaas-api/deployments","created_at":"2016-07-04T15:09:45Z","updated_at":"2016-11-07T23:00:04Z","pushed_at":"2017-03-02T09:37:41Z","git_url":"git://github.com/feedhenry/fh-mbaas-api.git","ssh_url":"git@github.com:feedhenry/fh-mbaas-api.git","clone_url":"https://github.com/feedhenry/fh-mbaas-api.git","svn_url":"https://github.com/feedhenry/fh-mbaas-api","homepage":null,"size":976,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":22,"mirror_url":null,"open_issues_count":7,"forks":22,"open_issues":7,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/feedhenry/fh-mbaas-api/pulls/72"},"html":{"href":"https://github.com/feedhenry/fh-mbaas-api/pull/72"},"issue":{"href":"https://api.github.com/repos/feedhenry/fh-mbaas-api/issues/72"},"comments":{"href":"https://api.github.com/repos/feedhenry/fh-mbaas-api/issues/72/comments"},"review_comments":{"href":"https://api.github.com/repos/feedhenry/fh-mbaas-api/pulls/72/comments"},"review_comment":{"href":"https://api.github.com/repos/feedhenry/fh-mbaas-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/feedhenry/fh-mbaas-api/pulls/72/commits"},"statuses":{"href":"https://api.github.com/repos/feedhenry/fh-mbaas-api/statuses/8a4beedc65ba5fd483e5cd58e14fc4252f9f2f50"}}}}
{"actor":{"display_login":"wei-lee"}}