{"action":"created","comment":{"url":"https://api.github.com/repos/fog/fog-google/pulls/comments/124133799","pull_request_review_id":46397664,"id":124133799,"diff_hunk":"@@ -50,117 +62,131 @@ def some_topic_name\n     @some_topic ||= new_topic_name.tap do |t|\n       @client.create_topic(t)\n     end\n-    @some_topic\n   end\n \n   def some_subscription_name\n     # create lazily to speed tests up\n     @some_subscription ||= new_subscription_name.tap do |s|\n       @client.create_subscription(s, some_topic_name)\n     end\n-    @some_subscription\n   end\n \n-  def test_create_topic\n-    result = @client.create_topic(new_topic_name)\n+  # retry_times attempts the given block up to tries times.\n+  # A failed attempt to considered to be any point where the block yields\n+  # and a Google::Apis::Error or StandardError is rescued.\n+  def retry_times(tries, &block)\n+    begin\n+      block.call\n+    rescue Google::Apis::Error, StandardError => e\n+      if tries <= 1\n+        raise e\n+      end\n+      retry_times(tries  - 1, &block)\n+    end\n+  end\n \n-    assert_equal(200, result.status, \"request should be successful\")\n-    assert_includes(result[:body].keys, \"name\", \"resulting body should contain expected keys\")\n+  def test_create_topic\n+    name = new_topic_name\n+    result = @client.create_topic(name)\n+    assert_equal(result.name, name)\n   end\n \n   def test_get_topic\n     result = @client.get_topic(some_topic_name)\n-\n-    assert_equal(200, result.status, \"request should be successful\")\n-    assert_includes(result[:body].keys, \"name\", \"resulting body should contain expected keys\")\n+    assert_equal(result.name, some_topic_name)\n   end\n \n   def test_list_topics\n     # Force a topic to be created just so we have at least 1 to list\n-    @client.create_topic(new_topic_name)\n-    result = @client.list_topics\n-\n-    assert_equal(200, result.status, \"request should be successful\")\n-    assert_includes(result[:body].keys, \"topics\", \"resulting body should contain expected keys\")\n-    assert_operator(result[:body][\"topics\"].size, :>, 0, \"topic count should be positive\")\n+    name = new_topic_name\n+    @client.create_topic(name)\n+\n+    retry_times(3) do\n+      result = @client.list_topics\n+      if result.topics.nil?\n+        raise StandardError('no topics found')\n+      end\n+\n+      result.topics.any? {","path":"test/integration/pubsub/test_pubsub_requests.rb","position":115,"original_position":115,"commit_id":"906dcbdb543e6155bb052a7f41f86195e8c76d20","original_commit_id":"906dcbdb543e6155bb052a7f41f86195e8c76d20","user":{"login":"houndci-bot","id":6697940,"avatar_url":"https://avatars3.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci-bot","html_url":"https://github.com/houndci-bot","followers_url":"https://api.github.com/users/houndci-bot/followers","following_url":"https://api.github.com/users/houndci-bot/following{/other_user}","gists_url":"https://api.github.com/users/houndci-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci-bot/subscriptions","organizations_url":"https://api.github.com/users/houndci-bot/orgs","repos_url":"https://api.github.com/users/houndci-bot/repos","events_url":"https://api.github.com/users/houndci-bot/events{/privacy}","received_events_url":"https://api.github.com/users/houndci-bot/received_events","type":"User","site_admin":false},"body":"Avoid using {...} for multi-line blocks.","created_at":"2017-06-26T22:04:22Z","updated_at":"2017-06-26T22:04:23Z","html_url":"https://github.com/fog/fog-google/pull/227#discussion_r124133799","pull_request_url":"https://api.github.com/repos/fog/fog-google/pulls/227","_links":{"self":{"href":"https://api.github.com/repos/fog/fog-google/pulls/comments/124133799"},"html":{"href":"https://github.com/fog/fog-google/pull/227#discussion_r124133799"},"pull_request":{"href":"https://api.github.com/repos/fog/fog-google/pulls/227"}}},"pull_request":{"url":"https://api.github.com/repos/fog/fog-google/pulls/227","id":127573584,"html_url":"https://github.com/fog/fog-google/pull/227","diff_url":"https://github.com/fog/fog-google/pull/227.diff","patch_url":"https://github.com/fog/fog-google/pull/227.patch","issue_url":"https://api.github.com/repos/fog/fog-google/issues/227","number":227,"state":"open","locked":false,"title":"Upgrade PubSub requests to >= 0.11","user":{"login":"Everlag","id":2524459,"avatar_url":"https://avatars0.githubusercontent.com/u/2524459?v=3","gravatar_id":"","url":"https://api.github.com/users/Everlag","html_url":"https://github.com/Everlag","followers_url":"https://api.github.com/users/Everlag/followers","following_url":"https://api.github.com/users/Everlag/following{/other_user}","gists_url":"https://api.github.com/users/Everlag/gists{/gist_id}","starred_url":"https://api.github.com/users/Everlag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Everlag/subscriptions","organizations_url":"https://api.github.com/users/Everlag/orgs","repos_url":"https://api.github.com/users/Everlag/repos","events_url":"https://api.github.com/users/Everlag/events{/privacy}","received_events_url":"https://api.github.com/users/Everlag/received_events","type":"User","site_admin":false},"body":"This breaks compatibility with the previous excon based approach\r\nas keeping it would require us to manually wrap every API\r\nclient operation in an excon response.\r\nAdditionally, all mocks have been deleted and left unimplemented.\r\n\r\nHowever, the tests have been migrated and currently pass.\r\n\r\nLooking for review to make sure this style is fine to continue with for the pubsub models. Thanks!","created_at":"2017-06-26T22:04:04Z","updated_at":"2017-06-26T22:04:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1477c664497fb3c6f7e2d866e6fd86aecdd27a57","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/fog/fog-google/pulls/227/commits","review_comments_url":"https://api.github.com/repos/fog/fog-google/pulls/227/comments","review_comment_url":"https://api.github.com/repos/fog/fog-google/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fog/fog-google/issues/227/comments","statuses_url":"https://api.github.com/repos/fog/fog-google/statuses/906dcbdb543e6155bb052a7f41f86195e8c76d20","head":{"label":"Everlag:pr1-pubsub","ref":"pr1-pubsub","sha":"906dcbdb543e6155bb052a7f41f86195e8c76d20","user":{"login":"Everlag","id":2524459,"avatar_url":"https://avatars0.githubusercontent.com/u/2524459?v=3","gravatar_id":"","url":"https://api.github.com/users/Everlag","html_url":"https://github.com/Everlag","followers_url":"https://api.github.com/users/Everlag/followers","following_url":"https://api.github.com/users/Everlag/following{/other_user}","gists_url":"https://api.github.com/users/Everlag/gists{/gist_id}","starred_url":"https://api.github.com/users/Everlag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Everlag/subscriptions","organizations_url":"https://api.github.com/users/Everlag/orgs","repos_url":"https://api.github.com/users/Everlag/repos","events_url":"https://api.github.com/users/Everlag/events{/privacy}","received_events_url":"https://api.github.com/users/Everlag/received_events","type":"User","site_admin":false},"repo":{"id":95493135,"name":"fog-google","full_name":"Everlag/fog-google","owner":{"login":"Everlag","id":2524459,"avatar_url":"https://avatars0.githubusercontent.com/u/2524459?v=3","gravatar_id":"","url":"https://api.github.com/users/Everlag","html_url":"https://github.com/Everlag","followers_url":"https://api.github.com/users/Everlag/followers","following_url":"https://api.github.com/users/Everlag/following{/other_user}","gists_url":"https://api.github.com/users/Everlag/gists{/gist_id}","starred_url":"https://api.github.com/users/Everlag/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Everlag/subscriptions","organizations_url":"https://api.github.com/users/Everlag/orgs","repos_url":"https://api.github.com/users/Everlag/repos","events_url":"https://api.github.com/users/Everlag/events{/privacy}","received_events_url":"https://api.github.com/users/Everlag/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Everlag/fog-google","description":"Fog for Google Cloud Platform","fork":true,"url":"https://api.github.com/repos/Everlag/fog-google","forks_url":"https://api.github.com/repos/Everlag/fog-google/forks","keys_url":"https://api.github.com/repos/Everlag/fog-google/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Everlag/fog-google/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Everlag/fog-google/teams","hooks_url":"https://api.github.com/repos/Everlag/fog-google/hooks","issue_events_url":"https://api.github.com/repos/Everlag/fog-google/issues/events{/number}","events_url":"https://api.github.com/repos/Everlag/fog-google/events","assignees_url":"https://api.github.com/repos/Everlag/fog-google/assignees{/user}","branches_url":"https://api.github.com/repos/Everlag/fog-google/branches{/branch}","tags_url":"https://api.github.com/repos/Everlag/fog-google/tags","blobs_url":"https://api.github.com/repos/Everlag/fog-google/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Everlag/fog-google/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Everlag/fog-google/git/refs{/sha}","trees_url":"https://api.github.com/repos/Everlag/fog-google/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Everlag/fog-google/statuses/{sha}","languages_url":"https://api.github.com/repos/Everlag/fog-google/languages","stargazers_url":"https://api.github.com/repos/Everlag/fog-google/stargazers","contributors_url":"https://api.github.com/repos/Everlag/fog-google/contributors","subscribers_url":"https://api.github.com/repos/Everlag/fog-google/subscribers","subscription_url":"https://api.github.com/repos/Everlag/fog-google/subscription","commits_url":"https://api.github.com/repos/Everlag/fog-google/commits{/sha}","git_commits_url":"https://api.github.com/repos/Everlag/fog-google/git/commits{/sha}","comments_url":"https://api.github.com/repos/Everlag/fog-google/comments{/number}","issue_comment_url":"https://api.github.com/repos/Everlag/fog-google/issues/comments{/number}","contents_url":"https://api.github.com/repos/Everlag/fog-google/contents/{+path}","compare_url":"https://api.github.com/repos/Everlag/fog-google/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Everlag/fog-google/merges","archive_url":"https://api.github.com/repos/Everlag/fog-google/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Everlag/fog-google/downloads","issues_url":"https://api.github.com/repos/Everlag/fog-google/issues{/number}","pulls_url":"https://api.github.com/repos/Everlag/fog-google/pulls{/number}","milestones_url":"https://api.github.com/repos/Everlag/fog-google/milestones{/number}","notifications_url":"https://api.github.com/repos/Everlag/fog-google/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Everlag/fog-google/labels{/name}","releases_url":"https://api.github.com/repos/Everlag/fog-google/releases{/id}","deployments_url":"https://api.github.com/repos/Everlag/fog-google/deployments","created_at":"2017-06-26T22:01:03Z","updated_at":"2017-06-26T22:01:05Z","pushed_at":"2017-06-26T22:01:50Z","git_url":"git://github.com/Everlag/fog-google.git","ssh_url":"git@github.com:Everlag/fog-google.git","clone_url":"https://github.com/Everlag/fog-google.git","svn_url":"https://github.com/Everlag/fog-google","homepage":"","size":828,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"fog:upgrade-google-client","ref":"upgrade-google-client","sha":"909bb5fb4745e9ba8048bc88cec908592e11323a","user":{"login":"fog","id":991149,"avatar_url":"https://avatars0.githubusercontent.com/u/991149?v=3","gravatar_id":"","url":"https://api.github.com/users/fog","html_url":"https://github.com/fog","followers_url":"https://api.github.com/users/fog/followers","following_url":"https://api.github.com/users/fog/following{/other_user}","gists_url":"https://api.github.com/users/fog/gists{/gist_id}","starred_url":"https://api.github.com/users/fog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fog/subscriptions","organizations_url":"https://api.github.com/users/fog/orgs","repos_url":"https://api.github.com/users/fog/repos","events_url":"https://api.github.com/users/fog/events{/privacy}","received_events_url":"https://api.github.com/users/fog/received_events","type":"Organization","site_admin":false},"repo":{"id":29195078,"name":"fog-google","full_name":"fog/fog-google","owner":{"login":"fog","id":991149,"avatar_url":"https://avatars0.githubusercontent.com/u/991149?v=3","gravatar_id":"","url":"https://api.github.com/users/fog","html_url":"https://github.com/fog","followers_url":"https://api.github.com/users/fog/followers","following_url":"https://api.github.com/users/fog/following{/other_user}","gists_url":"https://api.github.com/users/fog/gists{/gist_id}","starred_url":"https://api.github.com/users/fog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fog/subscriptions","organizations_url":"https://api.github.com/users/fog/orgs","repos_url":"https://api.github.com/users/fog/repos","events_url":"https://api.github.com/users/fog/events{/privacy}","received_events_url":"https://api.github.com/users/fog/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fog/fog-google","description":"Fog for Google Cloud Platform","fork":false,"url":"https://api.github.com/repos/fog/fog-google","forks_url":"https://api.github.com/repos/fog/fog-google/forks","keys_url":"https://api.github.com/repos/fog/fog-google/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fog/fog-google/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fog/fog-google/teams","hooks_url":"https://api.github.com/repos/fog/fog-google/hooks","issue_events_url":"https://api.github.com/repos/fog/fog-google/issues/events{/number}","events_url":"https://api.github.com/repos/fog/fog-google/events","assignees_url":"https://api.github.com/repos/fog/fog-google/assignees{/user}","branches_url":"https://api.github.com/repos/fog/fog-google/branches{/branch}","tags_url":"https://api.github.com/repos/fog/fog-google/tags","blobs_url":"https://api.github.com/repos/fog/fog-google/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fog/fog-google/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fog/fog-google/git/refs{/sha}","trees_url":"https://api.github.com/repos/fog/fog-google/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fog/fog-google/statuses/{sha}","languages_url":"https://api.github.com/repos/fog/fog-google/languages","stargazers_url":"https://api.github.com/repos/fog/fog-google/stargazers","contributors_url":"https://api.github.com/repos/fog/fog-google/contributors","subscribers_url":"https://api.github.com/repos/fog/fog-google/subscribers","subscription_url":"https://api.github.com/repos/fog/fog-google/subscription","commits_url":"https://api.github.com/repos/fog/fog-google/commits{/sha}","git_commits_url":"https://api.github.com/repos/fog/fog-google/git/commits{/sha}","comments_url":"https://api.github.com/repos/fog/fog-google/comments{/number}","issue_comment_url":"https://api.github.com/repos/fog/fog-google/issues/comments{/number}","contents_url":"https://api.github.com/repos/fog/fog-google/contents/{+path}","compare_url":"https://api.github.com/repos/fog/fog-google/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fog/fog-google/merges","archive_url":"https://api.github.com/repos/fog/fog-google/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fog/fog-google/downloads","issues_url":"https://api.github.com/repos/fog/fog-google/issues{/number}","pulls_url":"https://api.github.com/repos/fog/fog-google/pulls{/number}","milestones_url":"https://api.github.com/repos/fog/fog-google/milestones{/number}","notifications_url":"https://api.github.com/repos/fog/fog-google/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fog/fog-google/labels{/name}","releases_url":"https://api.github.com/repos/fog/fog-google/releases{/id}","deployments_url":"https://api.github.com/repos/fog/fog-google/deployments","created_at":"2015-01-13T15:02:24Z","updated_at":"2017-06-25T05:49:02Z","pushed_at":"2017-06-26T22:04:05Z","git_url":"git://github.com/fog/fog-google.git","ssh_url":"git@github.com:fog/fog-google.git","clone_url":"https://github.com/fog/fog-google.git","svn_url":"https://github.com/fog/fog-google","homepage":"","size":828,"stargazers_count":40,"watchers_count":40,"language":"Ruby","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":57,"mirror_url":null,"open_issues_count":47,"forks":57,"open_issues":47,"watchers":40,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fog/fog-google/pulls/227"},"html":{"href":"https://github.com/fog/fog-google/pull/227"},"issue":{"href":"https://api.github.com/repos/fog/fog-google/issues/227"},"comments":{"href":"https://api.github.com/repos/fog/fog-google/issues/227/comments"},"review_comments":{"href":"https://api.github.com/repos/fog/fog-google/pulls/227/comments"},"review_comment":{"href":"https://api.github.com/repos/fog/fog-google/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fog/fog-google/pulls/227/commits"},"statuses":{"href":"https://api.github.com/repos/fog/fog-google/statuses/906dcbdb543e6155bb052a7f41f86195e8c76d20"}}}}
{"actor":{"display_login":"houndci-bot"}}