{"action":"created","comment":{"url":"https://api.github.com/repos/confluentinc/ducktape/pulls/comments/32476901","id":32476901,"diff_hunk":"@@ -12,98 +12,131 @@\n # See the License for the specific language governing permissions and\n # limitations under the License.\n \n+from ducktape.utils.terminal_size import get_terminal_size\n+\n import json\n import os\n import shutil\n import pkg_resources\n \n \n-class TestReporter(object):\n-    def __init__(self, results):\n-        \"\"\"\n-        :type results: ducktape.tests.result.TestResults\n-        \"\"\"\n-        self.results = results\n+DEFAULT_SEPARATOR_WIDTH = 100\n \n-    def pass_fail(self, success):\n-        \"\"\"Convenient helper. Converts boolean to PASS/FAIL.\"\"\"\n-        return \"PASS\" if success else \"FAIL\"\n \n-    def format_time(self, t):\n-        \"\"\"Return human-readable interval of time.\n-        Assumes t is in units of seconds.\n-        \"\"\"\n-        minutes = int(t / 60)\n-        seconds = t % 60\n+def pass_fail(success):\n+    \"\"\"Convenient helper. Converts boolean to PASS/FAIL.\"\"\"\n+    return \"PASS\" if success else \"FAIL\"\n+\n+\n+def format_time(t):\n+    \"\"\"Return human-readable interval of time.\n+    Assumes t is in units of seconds.\n+    \"\"\"\n+    minutes = int(t / 60)\n+    seconds = t % 60\n+\n+    r = \"\"\n+    if minutes > 0:\n+        r += \"%d minute%s \" % (minutes, \"\" if minutes == 1 else \"s\")\n+    r += \"%.3f seconds\" % seconds\n+    return r\n+\n+\n+class SingleResultReporter(object):\n+    \"\"\"Helper class for creating a view of results from a single test.\"\"\"\n+\n+    def __init__(self, result):\n+        self.result = result\n+        self.width = get_terminal_size()[0]\n+\n+    def result_string(self):\n+        \"\"\"Stringify single result\"\"\"\n+        result_lines = [\n+            \"test_id:    %s\" % self.result.test_context.test_id,\n+            \"status:     %s\" % pass_fail(self.result.success),\n+            \"run time:   %s\" % format_time(self.result.run_time),\n+        ]\n+\n+        if self.result.data is not None:\n+            result_lines.append(json.dumps(self.result.data))","path":"ducktape/tests/reporter.py","position":65,"original_position":65,"commit_id":"59667449f2b7188787d96cf3e63473ecc6ea7cdb","original_commit_id":"59667449f2b7188787d96cf3e63473ecc6ea7cdb","user":{"login":"granders","id":1295932,"avatar_url":"https://avatars.githubusercontent.com/u/1295932?v=3","gravatar_id":"","url":"https://api.github.com/users/granders","html_url":"https://github.com/granders","followers_url":"https://api.github.com/users/granders/followers","following_url":"https://api.github.com/users/granders/following{/other_user}","gists_url":"https://api.github.com/users/granders/gists{/gist_id}","starred_url":"https://api.github.com/users/granders/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/granders/subscriptions","organizations_url":"https://api.github.com/users/granders/orgs","repos_url":"https://api.github.com/users/granders/repos","events_url":"https://api.github.com/users/granders/events{/privacy}","received_events_url":"https://api.github.com/users/granders/received_events","type":"User","site_admin":false},"body":"At this stage of the game without any automatic checks on the content of this data, I think it's better for the data collected to be immediately visible without extra effort.\r\n\r\nOtherwise it is easy for \"false positives\" to slide by undiscovered as with tests using ConsumerPerformanceService","created_at":"2015-06-15T23:02:01Z","updated_at":"2015-06-15T23:02:01Z","html_url":"https://github.com/confluentinc/ducktape/pull/60#discussion_r32476901","pull_request_url":"https://api.github.com/repos/confluentinc/ducktape/pulls/60","_links":{"self":{"href":"https://api.github.com/repos/confluentinc/ducktape/pulls/comments/32476901"},"html":{"href":"https://github.com/confluentinc/ducktape/pull/60#discussion_r32476901"},"pull_request":{"href":"https://api.github.com/repos/confluentinc/ducktape/pulls/60"}}},"pull_request":{"url":"https://api.github.com/repos/confluentinc/ducktape/pulls/60","id":37433101,"html_url":"https://github.com/confluentinc/ducktape/pull/60","diff_url":"https://github.com/confluentinc/ducktape/pull/60.diff","patch_url":"https://github.com/confluentinc/ducktape/pull/60.patch","issue_url":"https://api.github.com/repos/confluentinc/ducktape/issues/60","number":60,"state":"open","locked":false,"title":"Move muckrake","user":{"login":"granders","id":1295932,"avatar_url":"https://avatars.githubusercontent.com/u/1295932?v=3","gravatar_id":"","url":"https://api.github.com/users/granders","html_url":"https://github.com/granders","followers_url":"https://api.github.com/users/granders/followers","following_url":"https://api.github.com/users/granders/following{/other_user}","gists_url":"https://api.github.com/users/granders/gists{/gist_id}","starred_url":"https://api.github.com/users/granders/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/granders/subscriptions","organizations_url":"https://api.github.com/users/granders/orgs","repos_url":"https://api.github.com/users/granders/repos","events_url":"https://api.github.com/users/granders/events{/privacy}","received_events_url":"https://api.github.com/users/granders/received_events","type":"User","site_admin":false},"body":"Parallel branch to move_muckrake in the kafka fork.\r\n\r\nNotable changes\r\n- Moved background_thread.py to ducktape\r\n- Added SingleTestReporter\r\n- Added per-test data output file (fixes #48)\r\n- Fixed #57 by initializing self.nodes = [] in Service","created_at":"2015-06-11T06:38:52Z","updated_at":"2015-06-15T23:02:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eba531ea49330a48c25a34164942ab12c9320d34","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/confluentinc/ducktape/pulls/60/commits","review_comments_url":"https://api.github.com/repos/confluentinc/ducktape/pulls/60/comments","review_comment_url":"https://api.github.com/repos/confluentinc/ducktape/pulls/comments{/number}","comments_url":"https://api.github.com/repos/confluentinc/ducktape/issues/60/comments","statuses_url":"https://api.github.com/repos/confluentinc/ducktape/statuses/59667449f2b7188787d96cf3e63473ecc6ea7cdb","head":{"label":"confluentinc:move-muckrake","ref":"move-muckrake","sha":"59667449f2b7188787d96cf3e63473ecc6ea7cdb","user":{"login":"confluentinc","id":9439498,"avatar_url":"https://avatars.githubusercontent.com/u/9439498?v=3","gravatar_id":"","url":"https://api.github.com/users/confluentinc","html_url":"https://github.com/confluentinc","followers_url":"https://api.github.com/users/confluentinc/followers","following_url":"https://api.github.com/users/confluentinc/following{/other_user}","gists_url":"https://api.github.com/users/confluentinc/gists{/gist_id}","starred_url":"https://api.github.com/users/confluentinc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/confluentinc/subscriptions","organizations_url":"https://api.github.com/users/confluentinc/orgs","repos_url":"https://api.github.com/users/confluentinc/repos","events_url":"https://api.github.com/users/confluentinc/events{/privacy}","received_events_url":"https://api.github.com/users/confluentinc/received_events","type":"Organization","site_admin":false},"repo":{"id":28360638,"name":"ducktape","full_name":"confluentinc/ducktape","owner":{"login":"confluentinc","id":9439498,"avatar_url":"https://avatars.githubusercontent.com/u/9439498?v=3","gravatar_id":"","url":"https://api.github.com/users/confluentinc","html_url":"https://github.com/confluentinc","followers_url":"https://api.github.com/users/confluentinc/followers","following_url":"https://api.github.com/users/confluentinc/following{/other_user}","gists_url":"https://api.github.com/users/confluentinc/gists{/gist_id}","starred_url":"https://api.github.com/users/confluentinc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/confluentinc/subscriptions","organizations_url":"https://api.github.com/users/confluentinc/orgs","repos_url":"https://api.github.com/users/confluentinc/repos","events_url":"https://api.github.com/users/confluentinc/events{/privacy}","received_events_url":"https://api.github.com/users/confluentinc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/confluentinc/ducktape","description":"System integration and performance tests","fork":false,"url":"https://api.github.com/repos/confluentinc/ducktape","forks_url":"https://api.github.com/repos/confluentinc/ducktape/forks","keys_url":"https://api.github.com/repos/confluentinc/ducktape/keys{/key_id}","collaborators_url":"https://api.github.com/repos/confluentinc/ducktape/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/confluentinc/ducktape/teams","hooks_url":"https://api.github.com/repos/confluentinc/ducktape/hooks","issue_events_url":"https://api.github.com/repos/confluentinc/ducktape/issues/events{/number}","events_url":"https://api.github.com/repos/confluentinc/ducktape/events","assignees_url":"https://api.github.com/repos/confluentinc/ducktape/assignees{/user}","branches_url":"https://api.github.com/repos/confluentinc/ducktape/branches{/branch}","tags_url":"https://api.github.com/repos/confluentinc/ducktape/tags","blobs_url":"https://api.github.com/repos/confluentinc/ducktape/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/confluentinc/ducktape/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/confluentinc/ducktape/git/refs{/sha}","trees_url":"https://api.github.com/repos/confluentinc/ducktape/git/trees{/sha}","statuses_url":"https://api.github.com/repos/confluentinc/ducktape/statuses/{sha}","languages_url":"https://api.github.com/repos/confluentinc/ducktape/languages","stargazers_url":"https://api.github.com/repos/confluentinc/ducktape/stargazers","contributors_url":"https://api.github.com/repos/confluentinc/ducktape/contributors","subscribers_url":"https://api.github.com/repos/confluentinc/ducktape/subscribers","subscription_url":"https://api.github.com/repos/confluentinc/ducktape/subscription","commits_url":"https://api.github.com/repos/confluentinc/ducktape/commits{/sha}","git_commits_url":"https://api.github.com/repos/confluentinc/ducktape/git/commits{/sha}","comments_url":"https://api.github.com/repos/confluentinc/ducktape/comments{/number}","issue_comment_url":"https://api.github.com/repos/confluentinc/ducktape/issues/comments{/number}","contents_url":"https://api.github.com/repos/confluentinc/ducktape/contents/{+path}","compare_url":"https://api.github.com/repos/confluentinc/ducktape/compare/{base}...{head}","merges_url":"https://api.github.com/repos/confluentinc/ducktape/merges","archive_url":"https://api.github.com/repos/confluentinc/ducktape/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/confluentinc/ducktape/downloads","issues_url":"https://api.github.com/repos/confluentinc/ducktape/issues{/number}","pulls_url":"https://api.github.com/repos/confluentinc/ducktape/pulls{/number}","milestones_url":"https://api.github.com/repos/confluentinc/ducktape/milestones{/number}","notifications_url":"https://api.github.com/repos/confluentinc/ducktape/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/confluentinc/ducktape/labels{/name}","releases_url":"https://api.github.com/repos/confluentinc/ducktape/releases{/id}","created_at":"2014-12-22T21:38:32Z","updated_at":"2015-06-04T20:41:54Z","pushed_at":"2015-06-15T21:39:38Z","git_url":"git://github.com/confluentinc/ducktape.git","ssh_url":"git@github.com:confluentinc/ducktape.git","clone_url":"https://github.com/confluentinc/ducktape.git","svn_url":"https://github.com/confluentinc/ducktape","homepage":null,"size":1073,"stargazers_count":6,"watchers_count":6,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":16,"forks":2,"open_issues":16,"watchers":6,"default_branch":"master"}},"base":{"label":"confluentinc:master","ref":"master","sha":"ae68e86cc77b495f7372c5dc12ba3ec216ffcb32","user":{"login":"confluentinc","id":9439498,"avatar_url":"https://avatars.githubusercontent.com/u/9439498?v=3","gravatar_id":"","url":"https://api.github.com/users/confluentinc","html_url":"https://github.com/confluentinc","followers_url":"https://api.github.com/users/confluentinc/followers","following_url":"https://api.github.com/users/confluentinc/following{/other_user}","gists_url":"https://api.github.com/users/confluentinc/gists{/gist_id}","starred_url":"https://api.github.com/users/confluentinc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/confluentinc/subscriptions","organizations_url":"https://api.github.com/users/confluentinc/orgs","repos_url":"https://api.github.com/users/confluentinc/repos","events_url":"https://api.github.com/users/confluentinc/events{/privacy}","received_events_url":"https://api.github.com/users/confluentinc/received_events","type":"Organization","site_admin":false},"repo":{"id":28360638,"name":"ducktape","full_name":"confluentinc/ducktape","owner":{"login":"confluentinc","id":9439498,"avatar_url":"https://avatars.githubusercontent.com/u/9439498?v=3","gravatar_id":"","url":"https://api.github.com/users/confluentinc","html_url":"https://github.com/confluentinc","followers_url":"https://api.github.com/users/confluentinc/followers","following_url":"https://api.github.com/users/confluentinc/following{/other_user}","gists_url":"https://api.github.com/users/confluentinc/gists{/gist_id}","starred_url":"https://api.github.com/users/confluentinc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/confluentinc/subscriptions","organizations_url":"https://api.github.com/users/confluentinc/orgs","repos_url":"https://api.github.com/users/confluentinc/repos","events_url":"https://api.github.com/users/confluentinc/events{/privacy}","received_events_url":"https://api.github.com/users/confluentinc/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/confluentinc/ducktape","description":"System integration and performance tests","fork":false,"url":"https://api.github.com/repos/confluentinc/ducktape","forks_url":"https://api.github.com/repos/confluentinc/ducktape/forks","keys_url":"https://api.github.com/repos/confluentinc/ducktape/keys{/key_id}","collaborators_url":"https://api.github.com/repos/confluentinc/ducktape/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/confluentinc/ducktape/teams","hooks_url":"https://api.github.com/repos/confluentinc/ducktape/hooks","issue_events_url":"https://api.github.com/repos/confluentinc/ducktape/issues/events{/number}","events_url":"https://api.github.com/repos/confluentinc/ducktape/events","assignees_url":"https://api.github.com/repos/confluentinc/ducktape/assignees{/user}","branches_url":"https://api.github.com/repos/confluentinc/ducktape/branches{/branch}","tags_url":"https://api.github.com/repos/confluentinc/ducktape/tags","blobs_url":"https://api.github.com/repos/confluentinc/ducktape/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/confluentinc/ducktape/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/confluentinc/ducktape/git/refs{/sha}","trees_url":"https://api.github.com/repos/confluentinc/ducktape/git/trees{/sha}","statuses_url":"https://api.github.com/repos/confluentinc/ducktape/statuses/{sha}","languages_url":"https://api.github.com/repos/confluentinc/ducktape/languages","stargazers_url":"https://api.github.com/repos/confluentinc/ducktape/stargazers","contributors_url":"https://api.github.com/repos/confluentinc/ducktape/contributors","subscribers_url":"https://api.github.com/repos/confluentinc/ducktape/subscribers","subscription_url":"https://api.github.com/repos/confluentinc/ducktape/subscription","commits_url":"https://api.github.com/repos/confluentinc/ducktape/commits{/sha}","git_commits_url":"https://api.github.com/repos/confluentinc/ducktape/git/commits{/sha}","comments_url":"https://api.github.com/repos/confluentinc/ducktape/comments{/number}","issue_comment_url":"https://api.github.com/repos/confluentinc/ducktape/issues/comments{/number}","contents_url":"https://api.github.com/repos/confluentinc/ducktape/contents/{+path}","compare_url":"https://api.github.com/repos/confluentinc/ducktape/compare/{base}...{head}","merges_url":"https://api.github.com/repos/confluentinc/ducktape/merges","archive_url":"https://api.github.com/repos/confluentinc/ducktape/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/confluentinc/ducktape/downloads","issues_url":"https://api.github.com/repos/confluentinc/ducktape/issues{/number}","pulls_url":"https://api.github.com/repos/confluentinc/ducktape/pulls{/number}","milestones_url":"https://api.github.com/repos/confluentinc/ducktape/milestones{/number}","notifications_url":"https://api.github.com/repos/confluentinc/ducktape/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/confluentinc/ducktape/labels{/name}","releases_url":"https://api.github.com/repos/confluentinc/ducktape/releases{/id}","created_at":"2014-12-22T21:38:32Z","updated_at":"2015-06-04T20:41:54Z","pushed_at":"2015-06-15T21:39:38Z","git_url":"git://github.com/confluentinc/ducktape.git","ssh_url":"git@github.com:confluentinc/ducktape.git","clone_url":"https://github.com/confluentinc/ducktape.git","svn_url":"https://github.com/confluentinc/ducktape","homepage":null,"size":1073,"stargazers_count":6,"watchers_count":6,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":16,"forks":2,"open_issues":16,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/confluentinc/ducktape/pulls/60"},"html":{"href":"https://github.com/confluentinc/ducktape/pull/60"},"issue":{"href":"https://api.github.com/repos/confluentinc/ducktape/issues/60"},"comments":{"href":"https://api.github.com/repos/confluentinc/ducktape/issues/60/comments"},"review_comments":{"href":"https://api.github.com/repos/confluentinc/ducktape/pulls/60/comments"},"review_comment":{"href":"https://api.github.com/repos/confluentinc/ducktape/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/confluentinc/ducktape/pulls/60/commits"},"statuses":{"href":"https://api.github.com/repos/confluentinc/ducktape/statuses/59667449f2b7188787d96cf3e63473ecc6ea7cdb"}}}}