GitHub PullRequestReviewCommentEvent at 2014-12-03 14:29:56
Repository: elliptics
Actor: bioothod
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/reverbrain/elliptics/pulls/comments/21233918","id":21233918,"diff_hunk":"@@ -17,14 +15,211 @@\n \n import sys\n sys.path.insert(0, \"\")  # for running from cmake\n+from conftest import make_session\n import pytest\n+import md5\n+import elliptics\n \n \n-from conftest import set_property, simple_node, raises\n-from server import server\n-import elliptics\n+def format_result(node, backend, result, counter):\n+    return \"{0}, key: {1}, user_flags: {2}, timestamp: {3}, status: {4}, size: {5}, hashed_data: {6}, iterator_id: {7}\".format(\n+        format_stat(node, backend, result, counter),\n+        result.response.key,\n+        result.response.user_flags,\n+        result.response.timestamp,\n+        result.response.status,\n+        result.response.size,\n+        md5.new(result.response_data).hexdigest(),\n+        result.id)\n+\n+\n+def format_stat(node, backend, result, counter):\n+    return \"node: {0}/{1}: filtered_keys: {2} iterated_keys: {3}, total_keys: {4}\".format(\n+        node,\n+        backend,\n+        counter,\n+        result.response.iterated_keys,\n+        result.response.total_keys)\n+\n+\n+def check_iterator_results(node, backend, iterator, session, node_id, no_meta=False):\n+    counter = 0\n+    for result in iterator:\n+        assert result.status == 0, \"if iterator is ok status of result should be 0\"\n+        if result.response.status != 0:\n+            #this is one of keepalive response, we should skip it because it contains iterator statistics only\n+            print format_stat(node, backend, result, counter)\n+            continue\n+\n+        if no_meta:\n+            assert result.response.user_flags == 0\n+            assert result.response.timestamp == elliptics.Time(2 ** 64 - 1, 2 ** 64 - 1)\n+\n+        # Test flow control on after result\n+        if counter == 0:\n+            print \"Pause iterator\"\n+            session.pause_iterator(node_id, result.id)\n+            print \"Continue iterator\"\n+            session.continue_iterator(node_id, result.id)\n \n+        counter += 1\n+        print format_result(node, backend, result, counter)\n \n+\n+def convert_ranges(ranges):\n+    def make_range(begin, end):\n+        range = elliptics.IteratorRange()\n+        range.key_begin = begin\n+        range.key_end = end\n+        return range\n+    return (make_range(*r) for r in ranges)\n+\n+\n+def invert_ranges(ranges):\n+    inverted_ranges = []\n+    ID_MIN = elliptics.Id([0] * 64, 0)\n+    ID_MAX = elliptics.Id([255] * 64, 0)\n+\n+    if ranges[0][0] != ID_MIN:\n+        inverted_ranges.append((ID_MIN, ranges[0][0]))\n+    for i in xrange(1, len(ranges)):\n+        inverted_ranges.append((ranges[i - 1][1], ranges[i][0]))\n+    if ranges[-1][1] != ID_MAX:\n+        inverted_ranges.append((ranges[-1], [1], ID_MAX))\n+\n+    return convert_ranges(inverted_ranges)\n+\n+\n+@pytest.mark.trylast\n class TestSession:\n-    pass\n+    def test_iterate_default(self, server, simple_node):\n+        '''\n+        Runs iterator on first node/backend from route-list without specified ranges and special flags","path":"tests/pytests/test_session_iterator.py","position":93,"original_position":93,"commit_id":"0467a0abaf0aa33e17c5b772d795560178c47980","original_commit_id":"0467a0abaf0aa33e17c5b772d795560178c47980","user":{"login":"bioothod","id":1847575,"avatar_url":"https://avatars.githubusercontent.com/u/1847575?v=3","gravatar_id":"","url":"https://api.github.com/users/bioothod","html_url":"https://github.com/bioothod","followers_url":"https://api.github.com/users/bioothod/followers","following_url":"https://api.github.com/users/bioothod/following{/other_user}","gists_url":"https://api.github.com/users/bioothod/gists{/gist_id}","starred_url":"https://api.github.com/users/bioothod/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bioothod/subscriptions","organizations_url":"https://api.github.com/users/bioothod/orgs","repos_url":"https://api.github.com/users/bioothod/repos","events_url":"https://api.github.com/users/bioothod/events{/privacy}","received_events_url":"https://api.github.com/users/bioothod/received_events","type":"User","site_admin":false},"body":"What are the results of these tests? Do they check integrity of the keys returned? I.e. number of keys matched, key values matched to what is supposed to be returned?\r\nPlease describe these tests in much more details","created_at":"2014-12-03T14:29:56Z","updated_at":"2014-12-03T14:29:56Z","html_url":"https://github.com/reverbrain/elliptics/pull/565#discussion_r21233918","pull_request_url":"https://api.github.com/repos/reverbrain/elliptics/pulls/565","_links":{"self":{"href":"https://api.github.com/repos/reverbrain/elliptics/pulls/comments/21233918"},"html":{"href":"https://github.com/reverbrain/elliptics/pull/565#discussion_r21233918"},"pull_request":{"href":"https://api.github.com/repos/reverbrain/elliptics/pulls/565"}}},"pull_request":{"url":"https://api.github.com/repos/reverbrain/elliptics/pulls/565","id":25353140,"html_url":"https://github.com/reverbrain/elliptics/pull/565","diff_url":"https://github.com/reverbrain/elliptics/pull/565.diff","patch_url":"https://github.com/reverbrain/elliptics/pull/565.patch","issue_url":"https://api.github.com/repos/reverbrain/elliptics/issues/565","number":565,"state":"open","locked":false,"title":"Fixes & updates","user":{"login":"shaitan","id":446423,"avatar_url":"https://avatars.githubusercontent.com/u/446423?v=3","gravatar_id":"","url":"https://api.github.com/users/shaitan","html_url":"https://github.com/shaitan","followers_url":"https://api.github.com/users/shaitan/followers","following_url":"https://api.github.com/users/shaitan/following{/other_user}","gists_url":"https://api.github.com/users/shaitan/gists{/gist_id}","starred_url":"https://api.github.com/users/shaitan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shaitan/subscriptions","organizations_url":"https://api.github.com/users/shaitan/orgs","repos_url":"https://api.github.com/users/shaitan/repos","events_url":"https://api.github.com/users/shaitan/events{/privacy}","received_events_url":"https://api.github.com/users/shaitan/received_events","type":"User","site_admin":false},"body":"## Updates\r\n* allowed `elliptics.Id` to be initialized by any iterable object and group\r\n* replaced `cPickle` by `msgpack` for packing intermediate results in recovery - it speeded up merging phase\r\n* added new recovery statistics:\r\n  * `total_keys` - total number of keys that will be recovered / processed - available only at `dc` mode\r\n  * `recovery_speed` - average speed of recovering which is measured in keys per second\r\n  * `iteration_speed` - average speed of iteration which is also measured in keys per second\r\n* added ability to iterate keys without metadata (user_flags and timestamp):\r\n  * added `-M` option to `dnet_recovery` which speedups iteration phases of recovery but sacrifices checking metadata. Recovery with this option will not check metadata, will not replace old records by new ones, but will only copy some available replica of keys to groups which do not have these keys.\r\n\r\n## Fixes\r\n* fixed `elapsed_time` of async_result calculation and provided start/stop timestamps of async_result\r\n* fixed `PyEval_InitThreads` at `gil_guard()` - some times it crashes python on trusty\r\n* fixed parsing `group` from config - negative group is improper\r\n\r\n## Tests\r\n* disabled srw in the cluster for test_specific_cases\r\n* added tests of iteration\r\n* updated tests of recovery: made some cases to use new option `-M`\r\n\r\n## Others\r\n* cleaned up python scripts\r\n* moved server fixture to conftest and made server (elliptics testing cluster) session-wide - made pytests to control lifetime of all server nodes \r\n","created_at":"2014-12-02T16:15:55Z","updated_at":"2014-12-03T14:29:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8f3c576309d35869c12c9477006f78b3d9de5f8a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/reverbrain/elliptics/pulls/565/commits","review_comments_url":"https://api.github.com/repos/reverbrain/elliptics/pulls/565/comments","review_comment_url":"https://api.github.com/repos/reverbrain/elliptics/pulls/comments/{number}","comments_url":"https://api.github.com/repos/reverbrain/elliptics/issues/565/comments","statuses_url":"https://api.github.com/repos/reverbrain/elliptics/statuses/0467a0abaf0aa33e17c5b772d795560178c47980","head":{"label":"shaitan:master","ref":"master","sha":"0467a0abaf0aa33e17c5b772d795560178c47980","user":{"login":"shaitan","id":446423,"avatar_url":"https://avatars.githubusercontent.com/u/446423?v=3","gravatar_id":"","url":"https://api.github.com/users/shaitan","html_url":"https://github.com/shaitan","followers_url":"https://api.github.com/users/shaitan/followers","following_url":"https://api.github.com/users/shaitan/following{/other_user}","gists_url":"https://api.github.com/users/shaitan/gists{/gist_id}","starred_url":"https://api.github.com/users/shaitan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shaitan/subscriptions","organizations_url":"https://api.github.com/users/shaitan/orgs","repos_url":"https://api.github.com/users/shaitan/repos","events_url":"https://api.github.com/users/shaitan/events{/privacy}","received_events_url":"https://api.github.com/users/shaitan/received_events","type":"User","site_admin":false},"repo":{"id":10053124,"name":"elliptics","full_name":"shaitan/elliptics","owner":{"login":"shaitan","id":446423,"avatar_url":"https://avatars.githubusercontent.com/u/446423?v=3","gravatar_id":"","url":"https://api.github.com/users/shaitan","html_url":"https://github.com/shaitan","followers_url":"https://api.github.com/users/shaitan/followers","following_url":"https://api.github.com/users/shaitan/following{/other_user}","gists_url":"https://api.github.com/users/shaitan/gists{/gist_id}","starred_url":"https://api.github.com/users/shaitan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shaitan/subscriptions","organizations_url":"https://api.github.com/users/shaitan/orgs","repos_url":"https://api.github.com/users/shaitan/repos","events_url":"https://api.github.com/users/shaitan/events{/privacy}","received_events_url":"https://api.github.com/users/shaitan/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shaitan/elliptics","description":"Distributed hashtable storage","fork":true,"url":"https://api.github.com/repos/shaitan/elliptics","forks_url":"https://api.github.com/repos/shaitan/elliptics/forks","keys_url":"https://api.github.com/repos/shaitan/elliptics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shaitan/elliptics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shaitan/elliptics/teams","hooks_url":"https://api.github.com/repos/shaitan/elliptics/hooks","issue_events_url":"https://api.github.com/repos/shaitan/elliptics/issues/events{/number}","events_url":"https://api.github.com/repos/shaitan/elliptics/events","assignees_url":"https://api.github.com/repos/shaitan/elliptics/assignees{/user}","branches_url":"https://api.github.com/repos/shaitan/elliptics/branches{/branch}","tags_url":"https://api.github.com/repos/shaitan/elliptics/tags","blobs_url":"https://api.github.com/repos/shaitan/elliptics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shaitan/elliptics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shaitan/elliptics/git/refs{/sha}","trees_url":"https://api.github.com/repos/shaitan/elliptics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shaitan/elliptics/statuses/{sha}","languages_url":"https://api.github.com/repos/shaitan/elliptics/languages","stargazers_url":"https://api.github.com/repos/shaitan/elliptics/stargazers","contributors_url":"https://api.github.com/repos/shaitan/elliptics/contributors","subscribers_url":"https://api.github.com/repos/shaitan/elliptics/subscribers","subscription_url":"https://api.github.com/repos/shaitan/elliptics/subscription","commits_url":"https://api.github.com/repos/shaitan/elliptics/commits{/sha}","git_commits_url":"https://api.github.com/repos/shaitan/elliptics/git/commits{/sha}","comments_url":"https://api.github.com/repos/shaitan/elliptics/comments{/number}","issue_comment_url":"https://api.github.com/repos/shaitan/elliptics/issues/comments/{number}","contents_url":"https://api.github.com/repos/shaitan/elliptics/contents/{+path}","compare_url":"https://api.github.com/repos/shaitan/elliptics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shaitan/elliptics/merges","archive_url":"https://api.github.com/repos/shaitan/elliptics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shaitan/elliptics/downloads","issues_url":"https://api.github.com/repos/shaitan/elliptics/issues{/number}","pulls_url":"https://api.github.com/repos/shaitan/elliptics/pulls{/number}","milestones_url":"https://api.github.com/repos/shaitan/elliptics/milestones{/number}","notifications_url":"https://api.github.com/repos/shaitan/elliptics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shaitan/elliptics/labels{/name}","releases_url":"https://api.github.com/repos/shaitan/elliptics/releases{/id}","created_at":"2013-05-14T10:48:42Z","updated_at":"2014-12-03T12:50:35Z","pushed_at":"2014-12-03T12:50:35Z","git_url":"git://github.com/shaitan/elliptics.git","ssh_url":"git@github.com:shaitan/elliptics.git","clone_url":"https://github.com/shaitan/elliptics.git","svn_url":"https://github.com/shaitan/elliptics","homepage":null,"size":22739,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"reverbrain:master","ref":"master","sha":"b0882e66d733f8c31b386aed91465e1e2faceb5c","user":{"login":"reverbrain","id":1616511,"avatar_url":"https://avatars.githubusercontent.com/u/1616511?v=3","gravatar_id":"","url":"https://api.github.com/users/reverbrain","html_url":"https://github.com/reverbrain","followers_url":"https://api.github.com/users/reverbrain/followers","following_url":"https://api.github.com/users/reverbrain/following{/other_user}","gists_url":"https://api.github.com/users/reverbrain/gists{/gist_id}","starred_url":"https://api.github.com/users/reverbrain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reverbrain/subscriptions","organizations_url":"https://api.github.com/users/reverbrain/orgs","repos_url":"https://api.github.com/users/reverbrain/repos","events_url":"https://api.github.com/users/reverbrain/events{/privacy}","received_events_url":"https://api.github.com/users/reverbrain/received_events","type":"Organization","site_admin":false},"repo":{"id":4712089,"name":"elliptics","full_name":"reverbrain/elliptics","owner":{"login":"reverbrain","id":1616511,"avatar_url":"https://avatars.githubusercontent.com/u/1616511?v=3","gravatar_id":"","url":"https://api.github.com/users/reverbrain","html_url":"https://github.com/reverbrain","followers_url":"https://api.github.com/users/reverbrain/followers","following_url":"https://api.github.com/users/reverbrain/following{/other_user}","gists_url":"https://api.github.com/users/reverbrain/gists{/gist_id}","starred_url":"https://api.github.com/users/reverbrain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reverbrain/subscriptions","organizations_url":"https://api.github.com/users/reverbrain/orgs","repos_url":"https://api.github.com/users/reverbrain/repos","events_url":"https://api.github.com/users/reverbrain/events{/privacy}","received_events_url":"https://api.github.com/users/reverbrain/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/reverbrain/elliptics","description":"Distributed hashtable storage","fork":false,"url":"https://api.github.com/repos/reverbrain/elliptics","forks_url":"https://api.github.com/repos/reverbrain/elliptics/forks","keys_url":"https://api.github.com/repos/reverbrain/elliptics/keys{/key_id}","collaborators_url":"https://api.github.com/repos/reverbrain/elliptics/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/reverbrain/elliptics/teams","hooks_url":"https://api.github.com/repos/reverbrain/elliptics/hooks","issue_events_url":"https://api.github.com/repos/reverbrain/elliptics/issues/events{/number}","events_url":"https://api.github.com/repos/reverbrain/elliptics/events","assignees_url":"https://api.github.com/repos/reverbrain/elliptics/assignees{/user}","branches_url":"https://api.github.com/repos/reverbrain/elliptics/branches{/branch}","tags_url":"https://api.github.com/repos/reverbrain/elliptics/tags","blobs_url":"https://api.github.com/repos/reverbrain/elliptics/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/reverbrain/elliptics/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/reverbrain/elliptics/git/refs{/sha}","trees_url":"https://api.github.com/repos/reverbrain/elliptics/git/trees{/sha}","statuses_url":"https://api.github.com/repos/reverbrain/elliptics/statuses/{sha}","languages_url":"https://api.github.com/repos/reverbrain/elliptics/languages","stargazers_url":"https://api.github.com/repos/reverbrain/elliptics/stargazers","contributors_url":"https://api.github.com/repos/reverbrain/elliptics/contributors","subscribers_url":"https://api.github.com/repos/reverbrain/elliptics/subscribers","subscription_url":"https://api.github.com/repos/reverbrain/elliptics/subscription","commits_url":"https://api.github.com/repos/reverbrain/elliptics/commits{/sha}","git_commits_url":"https://api.github.com/repos/reverbrain/elliptics/git/commits{/sha}","comments_url":"https://api.github.com/repos/reverbrain/elliptics/comments{/number}","issue_comment_url":"https://api.github.com/repos/reverbrain/elliptics/issues/comments/{number}","contents_url":"https://api.github.com/repos/reverbrain/elliptics/contents/{+path}","compare_url":"https://api.github.com/repos/reverbrain/elliptics/compare/{base}...{head}","merges_url":"https://api.github.com/repos/reverbrain/elliptics/merges","archive_url":"https://api.github.com/repos/reverbrain/elliptics/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/reverbrain/elliptics/downloads","issues_url":"https://api.github.com/repos/reverbrain/elliptics/issues{/number}","pulls_url":"https://api.github.com/repos/reverbrain/elliptics/pulls{/number}","milestones_url":"https://api.github.com/repos/reverbrain/elliptics/milestones{/number}","notifications_url":"https://api.github.com/repos/reverbrain/elliptics/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/reverbrain/elliptics/labels{/name}","releases_url":"https://api.github.com/repos/reverbrain/elliptics/releases{/id}","created_at":"2012-06-19T10:05:10Z","updated_at":"2014-11-30T23:51:01Z","pushed_at":"2014-11-21T19:01:47Z","git_url":"git://github.com/reverbrain/elliptics.git","ssh_url":"git@github.com:reverbrain/elliptics.git","clone_url":"https://github.com/reverbrain/elliptics.git","svn_url":"https://github.com/reverbrain/elliptics","homepage":null,"size":30173,"stargazers_count":288,"watchers_count":288,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":47,"mirror_url":null,"open_issues_count":5,"forks":47,"open_issues":5,"watchers":288,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/reverbrain/elliptics/pulls/565"},"html":{"href":"https://github.com/reverbrain/elliptics/pull/565"},"issue":{"href":"https://api.github.com/repos/reverbrain/elliptics/issues/565"},"comments":{"href":"https://api.github.com/repos/reverbrain/elliptics/issues/565/comments"},"review_comments":{"href":"https://api.github.com/repos/reverbrain/elliptics/pulls/565/comments"},"review_comment":{"href":"https://api.github.com/repos/reverbrain/elliptics/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/reverbrain/elliptics/pulls/565/commits"},"statuses":{"href":"https://api.github.com/repos/reverbrain/elliptics/statuses/0467a0abaf0aa33e17c5b772d795560178c47980"}}}}