{"action":"created","issue":{"url":"https://api.github.com/repos/alibaba/pouch/issues/392","repository_url":"https://api.github.com/repos/alibaba/pouch","labels_url":"https://api.github.com/repos/alibaba/pouch/issues/392/labels{/name}","comments_url":"https://api.github.com/repos/alibaba/pouch/issues/392/comments","events_url":"https://api.github.com/repos/alibaba/pouch/issues/392/events","html_url":"https://github.com/alibaba/pouch/pull/392","id":284064403,"number":392,"title":"refatcor: make test case write much easier","user":{"login":"allencloud","id":9465626,"avatar_url":"https://avatars3.githubusercontent.com/u/9465626?v=4","gravatar_id":"","url":"https://api.github.com/users/allencloud","html_url":"https://github.com/allencloud","followers_url":"https://api.github.com/users/allencloud/followers","following_url":"https://api.github.com/users/allencloud/following{/other_user}","gists_url":"https://api.github.com/users/allencloud/gists{/gist_id}","starred_url":"https://api.github.com/users/allencloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allencloud/subscriptions","organizations_url":"https://api.github.com/users/allencloud/orgs","repos_url":"https://api.github.com/users/allencloud/repos","events_url":"https://api.github.com/users/allencloud/events{/privacy}","received_events_url":"https://api.github.com/users/allencloud/received_events","type":"User","site_admin":false},"labels":[{"id":722339975,"url":"https://api.github.com/repos/alibaba/pouch/labels/areas/test","name":"areas/test","color":"1d76db","default":false},{"id":722344260,"url":"https://api.github.com/repos/alibaba/pouch/labels/conflict/needs-rebase","name":"conflict/needs-rebase","color":"cccccc","default":false},{"id":722355278,"url":"https://api.github.com/repos/alibaba/pouch/labels/size/XL","name":"size/XL","color":"f4abdb","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-12-22T03:36:10Z","updated_at":"2017-12-22T03:56:49Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/alibaba/pouch/pulls/392","html_url":"https://github.com/alibaba/pouch/pull/392","diff_url":"https://github.com/alibaba/pouch/pull/392.diff","patch_url":"https://github.com/alibaba/pouch/pull/392.patch"},"body":"Signed-off-by: Allen Sun <allensun.shl@alibaba-inc.com>\r\n\r\n**1.Describe what this PR did**\r\n\r\nI think we need to prepare to reduce the cost of contributors to write test case as much as we can. Maybe contributors are very familiar with your code, but not so familiar with your test case code. While I think test is the same important as the software implementation code.\r\n\r\nIn go's design, we need to always do error checking which has already evoked lots of debate in the community. This PR reduces lots of useful but redundant err checking and asserting.\r\n\r\nIn pkg request, I introduces a global checker to detect error in function's implementation. So in the detailed test cases, they do not need to assert error to be nil frequently.\r\n\r\nWhen our test cases grows very fast. I think this way will reduce much test code in pouch.\r\n\r\nWDYT? @Letty5411 @sunyuan3 @0x04C2 \r\n\r\n**2.Does this pull request fix one issue?** \r\nNONE\r\n\r\n**3.Describe how you did it**\r\nIn pkg request, I introduces a global checker to detect error in function's implementation. So in the detailed test cases, they do not need to assert error to be nil frequently.\r\n\r\n**4.Describe how to verify it**\r\nNONE\r\n\r\n**5.Special notes for reviews**\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/alibaba/pouch/issues/comments/353516617","html_url":"https://github.com/alibaba/pouch/pull/392#issuecomment-353516617","issue_url":"https://api.github.com/repos/alibaba/pouch/issues/392","id":353516617,"user":{"login":"pouchrobot","id":33292901,"avatar_url":"https://avatars1.githubusercontent.com/u/33292901?v=4","gravatar_id":"","url":"https://api.github.com/users/pouchrobot","html_url":"https://github.com/pouchrobot","followers_url":"https://api.github.com/users/pouchrobot/followers","following_url":"https://api.github.com/users/pouchrobot/following{/other_user}","gists_url":"https://api.github.com/users/pouchrobot/gists{/gist_id}","starred_url":"https://api.github.com/users/pouchrobot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pouchrobot/subscriptions","organizations_url":"https://api.github.com/users/pouchrobot/orgs","repos_url":"https://api.github.com/users/pouchrobot/repos","events_url":"https://api.github.com/users/pouchrobot/events{/privacy}","received_events_url":"https://api.github.com/users/pouchrobot/received_events","type":"User","site_admin":false},"created_at":"2017-12-22T03:56:49Z","updated_at":"2017-12-22T03:56:49Z","author_association":"COLLABORATOR","body":"ping @allencloud \nConflict happens after merging a previous commit. \nPlease rebase the branch against master and push it back again. Thanks a lot.\n"}}
{"actor":{"display_login":"pouchrobot"}}