{"action":"created","issue":{"url":"https://api.github.com/repos/stripe/veneur/issues/68","repository_url":"https://api.github.com/repos/stripe/veneur","labels_url":"https://api.github.com/repos/stripe/veneur/issues/68/labels{/name}","comments_url":"https://api.github.com/repos/stripe/veneur/issues/68/comments","events_url":"https://api.github.com/repos/stripe/veneur/issues/68/events","html_url":"https://github.com/stripe/veneur/pull/68","id":179631664,"number":68,"title":"Add test for /import endpoint handler","user":{"login":"ChimeraCoder","id":376414,"avatar_url":"https://avatars.githubusercontent.com/u/376414?v=3","gravatar_id":"","url":"https://api.github.com/users/ChimeraCoder","html_url":"https://github.com/ChimeraCoder","followers_url":"https://api.github.com/users/ChimeraCoder/followers","following_url":"https://api.github.com/users/ChimeraCoder/following{/other_user}","gists_url":"https://api.github.com/users/ChimeraCoder/gists{/gist_id}","starred_url":"https://api.github.com/users/ChimeraCoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ChimeraCoder/subscriptions","organizations_url":"https://api.github.com/users/ChimeraCoder/orgs","repos_url":"https://api.github.com/users/ChimeraCoder/repos","events_url":"https://api.github.com/users/ChimeraCoder/events{/privacy}","received_events_url":"https://api.github.com/users/ChimeraCoder/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"tummychow","id":4285049,"avatar_url":"https://avatars.githubusercontent.com/u/4285049?v=3","gravatar_id":"","url":"https://api.github.com/users/tummychow","html_url":"https://github.com/tummychow","followers_url":"https://api.github.com/users/tummychow/followers","following_url":"https://api.github.com/users/tummychow/following{/other_user}","gists_url":"https://api.github.com/users/tummychow/gists{/gist_id}","starred_url":"https://api.github.com/users/tummychow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tummychow/subscriptions","organizations_url":"https://api.github.com/users/tummychow/orgs","repos_url":"https://api.github.com/users/tummychow/repos","events_url":"https://api.github.com/users/tummychow/events{/privacy}","received_events_url":"https://api.github.com/users/tummychow/received_events","type":"User","site_admin":false},"assignees":[{"login":"tummychow","id":4285049,"avatar_url":"https://avatars.githubusercontent.com/u/4285049?v=3","gravatar_id":"","url":"https://api.github.com/users/tummychow","html_url":"https://github.com/tummychow","followers_url":"https://api.github.com/users/tummychow/followers","following_url":"https://api.github.com/users/tummychow/following{/other_user}","gists_url":"https://api.github.com/users/tummychow/gists{/gist_id}","starred_url":"https://api.github.com/users/tummychow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tummychow/subscriptions","organizations_url":"https://api.github.com/users/tummychow/orgs","repos_url":"https://api.github.com/users/tummychow/repos","events_url":"https://api.github.com/users/tummychow/events{/privacy}","received_events_url":"https://api.github.com/users/tummychow/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2016-09-27T22:27:00Z","updated_at":"2016-09-28T19:20:15Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/stripe/veneur/pulls/68","html_url":"https://github.com/stripe/veneur/pull/68","diff_url":"https://github.com/stripe/veneur/pull/68.diff","patch_url":"https://github.com/stripe/veneur/pull/68.patch"},"body":"#### Summary\r\n\r\nAdd a test that the server can properly handle the `/import` endpoint, both when passed uncompressed data and when passed compressed data. This takes `http.go` to 97% test coverage, and the new file `handlers_global.go` is at 57% coverage. (Previously, the `/import` endpoint was not tested).\r\n\r\nThis is the beginning of what I described earlier this week/last week with regards to symmetric testing. The ultimate goal is for us to ensure that the interfaces between all communicating components are well-tested, that our tests degrade gracefully, and that updating our tests if the API changes later on is a straightforward and pain-free path. In the long run, using this strategy will also reduce our lines of code, but we're not at that point yet.\r\n\r\nThere are a couple of hacks I did in order to make our refactoring minimal - the immediate goal is to get solid test coverage of the existing code while making minimal changes, before we start refactoring it. I expect the `contextHandler` type to be removed/replaced shortly; likewise, the `handleImport` helper function will be reworked within the next couple of PRs. \r\n\r\nThe key thing that we're doing here is that we've recorded the exact data that the client (local veneur) sends to the server (global veneur) when making a request to `/import`. We're recording the actual client behavior from the flush in order to provide the handler with a canonical request when we test the server handler's behavior. (See 466df9b5fb0a27484f9ba13a7c517a35c2264a6d, in which I removed the recording - I left this as a separate commit intentionally to illustrate it).\r\n\r\nIn the general case, this approach means that we don't even need to spin up a server in order to test the handlers on the server. (As it stands, we do, but that's because the handler needs a viable `Server` in order to complete its execution properly - we could work around this dependency later on).\r\n\r\n#### Motivation\r\n\r\n`Tests || stseT`\r\n\r\n#### Test plan\r\n\r\nAdded tests. Builds are currently failing due to issues running on 1.5 (and the ambiguity of `context` packages. I'll fix that in the morning. I'm heading out in a moment (EOD) but wanted to send this your way beforehand.\r\n\r\n#### Rollout/monitoring/revert plan\r\nN/A\r\n\r\nr? @tummychow \r\ncc @rhwlo (pair)\r\n"},"comment":{"url":"https://api.github.com/repos/stripe/veneur/issues/comments/250271246","html_url":"https://github.com/stripe/veneur/pull/68#issuecomment-250271246","issue_url":"https://api.github.com/repos/stripe/veneur/issues/68","id":250271246,"user":{"login":"tummychow","id":4285049,"avatar_url":"https://avatars.githubusercontent.com/u/4285049?v=3","gravatar_id":"","url":"https://api.github.com/users/tummychow","html_url":"https://github.com/tummychow","followers_url":"https://api.github.com/users/tummychow/followers","following_url":"https://api.github.com/users/tummychow/following{/other_user}","gists_url":"https://api.github.com/users/tummychow/gists{/gist_id}","starred_url":"https://api.github.com/users/tummychow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tummychow/subscriptions","organizations_url":"https://api.github.com/users/tummychow/orgs","repos_url":"https://api.github.com/users/tummychow/repos","events_url":"https://api.github.com/users/tummychow/events{/privacy}","received_events_url":"https://api.github.com/users/tummychow/received_events","type":"User","site_admin":false},"created_at":"2016-09-28T19:20:15Z","updated_at":"2016-09-28T19:20:15Z","body":"i assume you'll be rebasing over #70 once that's merged? (to make tests pass) if the diff is the same before and after rebase, cibot will retain this approval:\r\n\r\nlgtm"}}
{"actor":{"display_login":"tummychow"}}