{"action":"created","comment":{"url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/pulls/comments/44599915","id":44599915,"diff_hunk":"@@ -1,11 +1,25 @@\n import pytest\n \n from lib.cluster import Cluster\n-\n+from provision.fetch_sg_logs import fetch_sync_gateway_logs\n \n @pytest.fixture()\n-def cluster():\n+def cluster(request):\n+\n+    def fetch_logs():\n+\n+        # Fetch logs if a test fails\n+        if request.node.rep_call.failed:\n+            # example nodeid: tests/test_single_user_multiple_channels.py::test_1\n+            remove_slash = request.node.nodeid.replace(\"/\", \"-\")\n+            test_id_elements = remove_slash.split(\"::\")\n+            log_zip_prefix = \"{0}-{1}\".format(test_id_elements[0], test_id_elements[1])\n+            fetch_sync_gateway_logs(log_zip_prefix)\n+\n+    request.addfinalizer(fetch_logs)\n+","path":"functional_tests/cluster_setup.py","position":22,"original_position":22,"commit_id":"ac8325b28c9f11fc2667f241010502f6aa33b645","original_commit_id":"ac8325b28c9f11fc2667f241010502f6aa33b645","user":{"login":"ashvindersingh","id":2374160,"avatar_url":"https://avatars.githubusercontent.com/u/2374160?v=3","gravatar_id":"","url":"https://api.github.com/users/ashvindersingh","html_url":"https://github.com/ashvindersingh","followers_url":"https://api.github.com/users/ashvindersingh/followers","following_url":"https://api.github.com/users/ashvindersingh/following{/other_user}","gists_url":"https://api.github.com/users/ashvindersingh/gists{/gist_id}","starred_url":"https://api.github.com/users/ashvindersingh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashvindersingh/subscriptions","organizations_url":"https://api.github.com/users/ashvindersingh/orgs","repos_url":"https://api.github.com/users/ashvindersingh/repos","events_url":"https://api.github.com/users/ashvindersingh/events{/privacy}","received_events_url":"https://api.github.com/users/ashvindersingh/received_events","type":"User","site_admin":false},"body":"Is there an option to disable collecting logs at the end of tests. For example, while developing tests, need to run script multiple times and may not need to collect any logs on failure. ","created_at":"2015-11-11T22:59:58Z","updated_at":"2015-11-11T22:59:58Z","html_url":"https://github.com/couchbaselabs/sync-gateway-testcluster/pull/10#discussion_r44599915","pull_request_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/pulls/10","_links":{"self":{"href":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/pulls/comments/44599915"},"html":{"href":"https://github.com/couchbaselabs/sync-gateway-testcluster/pull/10#discussion_r44599915"},"pull_request":{"href":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/pulls/10"}}},"pull_request":{"url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/pulls/10","id":50213450,"html_url":"https://github.com/couchbaselabs/sync-gateway-testcluster/pull/10","diff_url":"https://github.com/couchbaselabs/sync-gateway-testcluster/pull/10.diff","patch_url":"https://github.com/couchbaselabs/sync-gateway-testcluster/pull/10.patch","issue_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/issues/10","number":10,"state":"open","locked":false,"title":"Support smarter logging / Request timeouts","user":{"login":"sethrosetter","id":1365736,"avatar_url":"https://avatars.githubusercontent.com/u/1365736?v=3","gravatar_id":"","url":"https://api.github.com/users/sethrosetter","html_url":"https://github.com/sethrosetter","followers_url":"https://api.github.com/users/sethrosetter/followers","following_url":"https://api.github.com/users/sethrosetter/following{/other_user}","gists_url":"https://api.github.com/users/sethrosetter/gists{/gist_id}","starred_url":"https://api.github.com/users/sethrosetter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sethrosetter/subscriptions","organizations_url":"https://api.github.com/users/sethrosetter/orgs","repos_url":"https://api.github.com/users/sethrosetter/repos","events_url":"https://api.github.com/users/sethrosetter/events{/privacy}","received_events_url":"https://api.github.com/users/sethrosetter/received_events","type":"User","site_admin":false},"body":"- If a test fails, the framework will snapshot the logs from sync_gateways from that test to /tmp\r\n- Add 30 sec timeout on user requests","created_at":"2015-11-10T04:34:48Z","updated_at":"2015-11-11T22:59:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0c49f33e8a2aedbc297a58c786d2263430c4d3ac","assignee":{"login":"ashvindersingh","id":2374160,"avatar_url":"https://avatars.githubusercontent.com/u/2374160?v=3","gravatar_id":"","url":"https://api.github.com/users/ashvindersingh","html_url":"https://github.com/ashvindersingh","followers_url":"https://api.github.com/users/ashvindersingh/followers","following_url":"https://api.github.com/users/ashvindersingh/following{/other_user}","gists_url":"https://api.github.com/users/ashvindersingh/gists{/gist_id}","starred_url":"https://api.github.com/users/ashvindersingh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashvindersingh/subscriptions","organizations_url":"https://api.github.com/users/ashvindersingh/orgs","repos_url":"https://api.github.com/users/ashvindersingh/repos","events_url":"https://api.github.com/users/ashvindersingh/events{/privacy}","received_events_url":"https://api.github.com/users/ashvindersingh/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/pulls/10/commits","review_comments_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/pulls/10/comments","review_comment_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/pulls/comments{/number}","comments_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/issues/10/comments","statuses_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/statuses/ac8325b28c9f11fc2667f241010502f6aa33b645","head":{"label":"couchbaselabs:smarter-log-snapshots","ref":"smarter-log-snapshots","sha":"ac8325b28c9f11fc2667f241010502f6aa33b645","user":{"login":"couchbaselabs","id":636956,"avatar_url":"https://avatars.githubusercontent.com/u/636956?v=3","gravatar_id":"","url":"https://api.github.com/users/couchbaselabs","html_url":"https://github.com/couchbaselabs","followers_url":"https://api.github.com/users/couchbaselabs/followers","following_url":"https://api.github.com/users/couchbaselabs/following{/other_user}","gists_url":"https://api.github.com/users/couchbaselabs/gists{/gist_id}","starred_url":"https://api.github.com/users/couchbaselabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/couchbaselabs/subscriptions","organizations_url":"https://api.github.com/users/couchbaselabs/orgs","repos_url":"https://api.github.com/users/couchbaselabs/repos","events_url":"https://api.github.com/users/couchbaselabs/events{/privacy}","received_events_url":"https://api.github.com/users/couchbaselabs/received_events","type":"Organization","site_admin":false},"repo":{"id":45864773,"name":"sync-gateway-testcluster","full_name":"couchbaselabs/sync-gateway-testcluster","owner":{"login":"couchbaselabs","id":636956,"avatar_url":"https://avatars.githubusercontent.com/u/636956?v=3","gravatar_id":"","url":"https://api.github.com/users/couchbaselabs","html_url":"https://github.com/couchbaselabs","followers_url":"https://api.github.com/users/couchbaselabs/followers","following_url":"https://api.github.com/users/couchbaselabs/following{/other_user}","gists_url":"https://api.github.com/users/couchbaselabs/gists{/gist_id}","starred_url":"https://api.github.com/users/couchbaselabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/couchbaselabs/subscriptions","organizations_url":"https://api.github.com/users/couchbaselabs/orgs","repos_url":"https://api.github.com/users/couchbaselabs/repos","events_url":"https://api.github.com/users/couchbaselabs/events{/privacy}","received_events_url":"https://api.github.com/users/couchbaselabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/couchbaselabs/sync-gateway-testcluster","description":"Setup a Sync Gateway + Couchbase Server test cluster for functional and performance testing purposes ","fork":false,"url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster","forks_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/forks","keys_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/keys{/key_id}","collaborators_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/teams","hooks_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/hooks","issue_events_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/issues/events{/number}","events_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/events","assignees_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/assignees{/user}","branches_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/branches{/branch}","tags_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/tags","blobs_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/git/refs{/sha}","trees_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/git/trees{/sha}","statuses_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/statuses/{sha}","languages_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/languages","stargazers_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/stargazers","contributors_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/contributors","subscribers_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/subscribers","subscription_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/subscription","commits_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/commits{/sha}","git_commits_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/git/commits{/sha}","comments_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/comments{/number}","issue_comment_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/issues/comments{/number}","contents_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/contents/{+path}","compare_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/compare/{base}...{head}","merges_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/merges","archive_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/downloads","issues_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/issues{/number}","pulls_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/pulls{/number}","milestones_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/milestones{/number}","notifications_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/labels{/name}","releases_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/releases{/id}","created_at":"2015-11-09T20:28:01Z","updated_at":"2015-11-09T20:28:43Z","pushed_at":"2015-11-11T20:29:16Z","git_url":"git://github.com/couchbaselabs/sync-gateway-testcluster.git","ssh_url":"git@github.com:couchbaselabs/sync-gateway-testcluster.git","clone_url":"https://github.com/couchbaselabs/sync-gateway-testcluster.git","svn_url":"https://github.com/couchbaselabs/sync-gateway-testcluster","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":11,"forks":0,"open_issues":11,"watchers":0,"default_branch":"master"}},"base":{"label":"couchbaselabs:master","ref":"master","sha":"5ed0554760e17ef1a24f9cba6f0a97085be09f1f","user":{"login":"couchbaselabs","id":636956,"avatar_url":"https://avatars.githubusercontent.com/u/636956?v=3","gravatar_id":"","url":"https://api.github.com/users/couchbaselabs","html_url":"https://github.com/couchbaselabs","followers_url":"https://api.github.com/users/couchbaselabs/followers","following_url":"https://api.github.com/users/couchbaselabs/following{/other_user}","gists_url":"https://api.github.com/users/couchbaselabs/gists{/gist_id}","starred_url":"https://api.github.com/users/couchbaselabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/couchbaselabs/subscriptions","organizations_url":"https://api.github.com/users/couchbaselabs/orgs","repos_url":"https://api.github.com/users/couchbaselabs/repos","events_url":"https://api.github.com/users/couchbaselabs/events{/privacy}","received_events_url":"https://api.github.com/users/couchbaselabs/received_events","type":"Organization","site_admin":false},"repo":{"id":45864773,"name":"sync-gateway-testcluster","full_name":"couchbaselabs/sync-gateway-testcluster","owner":{"login":"couchbaselabs","id":636956,"avatar_url":"https://avatars.githubusercontent.com/u/636956?v=3","gravatar_id":"","url":"https://api.github.com/users/couchbaselabs","html_url":"https://github.com/couchbaselabs","followers_url":"https://api.github.com/users/couchbaselabs/followers","following_url":"https://api.github.com/users/couchbaselabs/following{/other_user}","gists_url":"https://api.github.com/users/couchbaselabs/gists{/gist_id}","starred_url":"https://api.github.com/users/couchbaselabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/couchbaselabs/subscriptions","organizations_url":"https://api.github.com/users/couchbaselabs/orgs","repos_url":"https://api.github.com/users/couchbaselabs/repos","events_url":"https://api.github.com/users/couchbaselabs/events{/privacy}","received_events_url":"https://api.github.com/users/couchbaselabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/couchbaselabs/sync-gateway-testcluster","description":"Setup a Sync Gateway + Couchbase Server test cluster for functional and performance testing purposes ","fork":false,"url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster","forks_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/forks","keys_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/keys{/key_id}","collaborators_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/teams","hooks_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/hooks","issue_events_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/issues/events{/number}","events_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/events","assignees_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/assignees{/user}","branches_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/branches{/branch}","tags_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/tags","blobs_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/git/refs{/sha}","trees_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/git/trees{/sha}","statuses_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/statuses/{sha}","languages_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/languages","stargazers_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/stargazers","contributors_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/contributors","subscribers_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/subscribers","subscription_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/subscription","commits_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/commits{/sha}","git_commits_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/git/commits{/sha}","comments_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/comments{/number}","issue_comment_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/issues/comments{/number}","contents_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/contents/{+path}","compare_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/compare/{base}...{head}","merges_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/merges","archive_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/downloads","issues_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/issues{/number}","pulls_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/pulls{/number}","milestones_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/milestones{/number}","notifications_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/labels{/name}","releases_url":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/releases{/id}","created_at":"2015-11-09T20:28:01Z","updated_at":"2015-11-09T20:28:43Z","pushed_at":"2015-11-11T20:29:16Z","git_url":"git://github.com/couchbaselabs/sync-gateway-testcluster.git","ssh_url":"git@github.com:couchbaselabs/sync-gateway-testcluster.git","clone_url":"https://github.com/couchbaselabs/sync-gateway-testcluster.git","svn_url":"https://github.com/couchbaselabs/sync-gateway-testcluster","homepage":null,"size":0,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":11,"forks":0,"open_issues":11,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/pulls/10"},"html":{"href":"https://github.com/couchbaselabs/sync-gateway-testcluster/pull/10"},"issue":{"href":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/issues/10"},"comments":{"href":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/issues/10/comments"},"review_comments":{"href":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/pulls/10/comments"},"review_comment":{"href":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/pulls/10/commits"},"statuses":{"href":"https://api.github.com/repos/couchbaselabs/sync-gateway-testcluster/statuses/ac8325b28c9f11fc2667f241010502f6aa33b645"}}}}