{"action":"created","comment":{"url":"https://api.github.com/repos/marco-c/coverage-crawler/pulls/comments/196072912","pull_request_review_id":129555875,"id":196072912,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NjA3MjkxMg==","diff_hunk":"@@ -265,3 +266,62 @@ def run_all(driver, data_folder):\n \n     for filename in ['code-coverage-gcda.zip', jsvm_output_file]:\n         os.remove(filename)\n+\n+    with open('{}/diff.json'.format(data_folder), 'r') as report:\n+        parsed_json = json.load(report)\n+\n+    file_obj = open('{}/report.info'.format(data_folder), 'w')\n+\n+    source_files = parsed_json['source_files']\n+\n+    file_obj.write('TN\\n')\n+    for source_file in source_files:\n+        file_obj.write('SF:{}\\n'.format(source_file['name']))\n+        executed = 0\n+\n+        # Functions\n+        if len(source_file['functions']) != 0:\n+            for function in source_file['functions']:\n+                file_obj.write('FN:{},{}\\n'.format(function['start'], function['name']))\n+            for function in source_file['functions']:\n+                if function['exec'] is True:\n+                    file_obj.write('FNDA:{},{}\\n'.format(1, function['name']))\n+                    executed += 1\n+                else:\n+                    file_obj.write('FNDA:{},{}\\n'.format(0, function['name']))\n+        file_obj.write('FNF:{}\\n'.format(len(source_file['functions'])))\n+        file_obj.write('FNH:{}\\n'.format(executed))\n+\n+        # Branches\n+        branch_hits = 0\n+        if len(source_file['branches']) != 0:\n+            for branch in source_file['branches']:\n+                if branch['taken'] is True:\n+                    file_obj.write('BRDA:{},0,{},{}\\n'.format(branch['line'], branch['number'], 1))\n+                    branch_hits += 1\n+                else:\n+                    file_obj.write('BRDA:{},0,{},{}\\n'.format(branch['line'], branch['number'], '-'))\n+        file_obj.write('BRF:{}\\n'.format(len(source_file['branches'])))\n+        file_obj.write('BRH:{}\\n'.format(branch_hits))\n+\n+        # Lines\n+        line_number = 0\n+        cov_line_count = 0\n+        if len(source_file['coverage']) != 0:\n+            for line in source_file['coverage']:\n+                line_number += 1\n+                if line is not None:\n+                    file_obj.write('DA:{},{}\\n'.format(line_number, line))\n+                    if line > 0:\n+                        cov_line_count += 1\n+        file_obj.write('LF:{}\\n'.format(len(source_file['coverage'])))\n+        file_obj.write('LH:{}\\n'.format(cov_line_count))\n+        file_obj.write('end_of_record\\n')\n+    file_obj.close()\n+\n+    codecoverage.download_genhtml()\n+\n+    ret = subprocess.call(['lcov-bin/usr/local/bin/genhtml', '-o', os.path.join(data_folder, 'report'), '--show-details', '--highlight', '--ignore-errors', 'source', '--legend', os.path.join(data_folder, 'report.info'), '--prefix', 'tools/firefox'])","path":"crawler.py","position":67,"original_position":67,"commit_id":"0ee4ea51d8d9ef87d875df6fc0e25ae50571aac5","original_commit_id":"0ee4ea51d8d9ef87d875df6fc0e25ae50571aac5","user":{"login":"marco-c","id":1616846,"node_id":"MDQ6VXNlcjE2MTY4NDY=","avatar_url":"https://avatars1.githubusercontent.com/u/1616846?v=4","gravatar_id":"","url":"https://api.github.com/users/marco-c","html_url":"https://github.com/marco-c","followers_url":"https://api.github.com/users/marco-c/followers","following_url":"https://api.github.com/users/marco-c/following{/other_user}","gists_url":"https://api.github.com/users/marco-c/gists{/gist_id}","starred_url":"https://api.github.com/users/marco-c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marco-c/subscriptions","organizations_url":"https://api.github.com/users/marco-c/orgs","repos_url":"https://api.github.com/users/marco-c/repos","events_url":"https://api.github.com/users/marco-c/events{/privacy}","received_events_url":"https://api.github.com/users/marco-c/received_events","type":"User","site_admin":false},"body":"And you'll need to clone the Firefox source code repository (the \"tools/firefox\" directory doesn't contain the source files, right?)","created_at":"2018-06-18T13:16:58Z","updated_at":"2018-06-18T13:16:58Z","html_url":"https://github.com/marco-c/coverage-crawler/pull/74#discussion_r196072912","pull_request_url":"https://api.github.com/repos/marco-c/coverage-crawler/pulls/74","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/marco-c/coverage-crawler/pulls/comments/196072912"},"html":{"href":"https://github.com/marco-c/coverage-crawler/pull/74#discussion_r196072912"},"pull_request":{"href":"https://api.github.com/repos/marco-c/coverage-crawler/pulls/74"}},"in_reply_to_id":196072494},"pull_request":{"url":"https://api.github.com/repos/marco-c/coverage-crawler/pulls/74","id":195515471,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk1NTE1NDcx","html_url":"https://github.com/marco-c/coverage-crawler/pull/74","diff_url":"https://github.com/marco-c/coverage-crawler/pull/74.diff","patch_url":"https://github.com/marco-c/coverage-crawler/pull/74.patch","issue_url":"https://api.github.com/repos/marco-c/coverage-crawler/issues/74","number":74,"state":"open","locked":false,"title":"Generate HTML report from JSON report","user":{"login":"rhcu","id":24638220,"node_id":"MDQ6VXNlcjI0NjM4MjIw","avatar_url":"https://avatars0.githubusercontent.com/u/24638220?v=4","gravatar_id":"","url":"https://api.github.com/users/rhcu","html_url":"https://github.com/rhcu","followers_url":"https://api.github.com/users/rhcu/followers","following_url":"https://api.github.com/users/rhcu/following{/other_user}","gists_url":"https://api.github.com/users/rhcu/gists{/gist_id}","starred_url":"https://api.github.com/users/rhcu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhcu/subscriptions","organizations_url":"https://api.github.com/users/rhcu/orgs","repos_url":"https://api.github.com/users/rhcu/repos","events_url":"https://api.github.com/users/rhcu/events{/privacy}","received_events_url":"https://api.github.com/users/rhcu/received_events","type":"User","site_admin":false},"body":"Fixes #58 \r\nI've made it in Python instead of working with https://github.com/marco-c/grcov/issues/94 but I can try to change it later. \r\nThe report is now generated in the folder that contains `diff.json` file.","created_at":"2018-06-18T12:54:33Z","updated_at":"2018-06-18T13:16:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"451383291882792c6991e4790de883cd7d54199f","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/marco-c/coverage-crawler/pulls/74/commits","review_comments_url":"https://api.github.com/repos/marco-c/coverage-crawler/pulls/74/comments","review_comment_url":"https://api.github.com/repos/marco-c/coverage-crawler/pulls/comments{/number}","comments_url":"https://api.github.com/repos/marco-c/coverage-crawler/issues/74/comments","statuses_url":"https://api.github.com/repos/marco-c/coverage-crawler/statuses/0ee4ea51d8d9ef87d875df6fc0e25ae50571aac5","head":{"label":"rhcu:lock","ref":"lock","sha":"0ee4ea51d8d9ef87d875df6fc0e25ae50571aac5","user":{"login":"rhcu","id":24638220,"node_id":"MDQ6VXNlcjI0NjM4MjIw","avatar_url":"https://avatars0.githubusercontent.com/u/24638220?v=4","gravatar_id":"","url":"https://api.github.com/users/rhcu","html_url":"https://github.com/rhcu","followers_url":"https://api.github.com/users/rhcu/followers","following_url":"https://api.github.com/users/rhcu/following{/other_user}","gists_url":"https://api.github.com/users/rhcu/gists{/gist_id}","starred_url":"https://api.github.com/users/rhcu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhcu/subscriptions","organizations_url":"https://api.github.com/users/rhcu/orgs","repos_url":"https://api.github.com/users/rhcu/repos","events_url":"https://api.github.com/users/rhcu/events{/privacy}","received_events_url":"https://api.github.com/users/rhcu/received_events","type":"User","site_admin":false},"repo":{"id":125048195,"node_id":"MDEwOlJlcG9zaXRvcnkxMjUwNDgxOTU=","name":"coverage-crawler","full_name":"rhcu/coverage-crawler","owner":{"login":"rhcu","id":24638220,"node_id":"MDQ6VXNlcjI0NjM4MjIw","avatar_url":"https://avatars0.githubusercontent.com/u/24638220?v=4","gravatar_id":"","url":"https://api.github.com/users/rhcu","html_url":"https://github.com/rhcu","followers_url":"https://api.github.com/users/rhcu/followers","following_url":"https://api.github.com/users/rhcu/following{/other_user}","gists_url":"https://api.github.com/users/rhcu/gists{/gist_id}","starred_url":"https://api.github.com/users/rhcu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhcu/subscriptions","organizations_url":"https://api.github.com/users/rhcu/orgs","repos_url":"https://api.github.com/users/rhcu/repos","events_url":"https://api.github.com/users/rhcu/events{/privacy}","received_events_url":"https://api.github.com/users/rhcu/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rhcu/coverage-crawler","description":"A crawler to find websites that exercise code in Firefox that is not covered by unit tests","fork":true,"url":"https://api.github.com/repos/rhcu/coverage-crawler","forks_url":"https://api.github.com/repos/rhcu/coverage-crawler/forks","keys_url":"https://api.github.com/repos/rhcu/coverage-crawler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rhcu/coverage-crawler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rhcu/coverage-crawler/teams","hooks_url":"https://api.github.com/repos/rhcu/coverage-crawler/hooks","issue_events_url":"https://api.github.com/repos/rhcu/coverage-crawler/issues/events{/number}","events_url":"https://api.github.com/repos/rhcu/coverage-crawler/events","assignees_url":"https://api.github.com/repos/rhcu/coverage-crawler/assignees{/user}","branches_url":"https://api.github.com/repos/rhcu/coverage-crawler/branches{/branch}","tags_url":"https://api.github.com/repos/rhcu/coverage-crawler/tags","blobs_url":"https://api.github.com/repos/rhcu/coverage-crawler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rhcu/coverage-crawler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rhcu/coverage-crawler/git/refs{/sha}","trees_url":"https://api.github.com/repos/rhcu/coverage-crawler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rhcu/coverage-crawler/statuses/{sha}","languages_url":"https://api.github.com/repos/rhcu/coverage-crawler/languages","stargazers_url":"https://api.github.com/repos/rhcu/coverage-crawler/stargazers","contributors_url":"https://api.github.com/repos/rhcu/coverage-crawler/contributors","subscribers_url":"https://api.github.com/repos/rhcu/coverage-crawler/subscribers","subscription_url":"https://api.github.com/repos/rhcu/coverage-crawler/subscription","commits_url":"https://api.github.com/repos/rhcu/coverage-crawler/commits{/sha}","git_commits_url":"https://api.github.com/repos/rhcu/coverage-crawler/git/commits{/sha}","comments_url":"https://api.github.com/repos/rhcu/coverage-crawler/comments{/number}","issue_comment_url":"https://api.github.com/repos/rhcu/coverage-crawler/issues/comments{/number}","contents_url":"https://api.github.com/repos/rhcu/coverage-crawler/contents/{+path}","compare_url":"https://api.github.com/repos/rhcu/coverage-crawler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rhcu/coverage-crawler/merges","archive_url":"https://api.github.com/repos/rhcu/coverage-crawler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rhcu/coverage-crawler/downloads","issues_url":"https://api.github.com/repos/rhcu/coverage-crawler/issues{/number}","pulls_url":"https://api.github.com/repos/rhcu/coverage-crawler/pulls{/number}","milestones_url":"https://api.github.com/repos/rhcu/coverage-crawler/milestones{/number}","notifications_url":"https://api.github.com/repos/rhcu/coverage-crawler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rhcu/coverage-crawler/labels{/name}","releases_url":"https://api.github.com/repos/rhcu/coverage-crawler/releases{/id}","deployments_url":"https://api.github.com/repos/rhcu/coverage-crawler/deployments","created_at":"2018-03-13T12:28:43Z","updated_at":"2018-06-14T04:50:21Z","pushed_at":"2018-06-18T12:50:59Z","git_url":"git://github.com/rhcu/coverage-crawler.git","ssh_url":"git@github.com:rhcu/coverage-crawler.git","clone_url":"https://github.com/rhcu/coverage-crawler.git","svn_url":"https://github.com/rhcu/coverage-crawler","homepage":null,"size":35,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"marco-c:master","ref":"master","sha":"66863ac6aa0530d98fbde5d9589475a465a5519e","user":{"login":"marco-c","id":1616846,"node_id":"MDQ6VXNlcjE2MTY4NDY=","avatar_url":"https://avatars1.githubusercontent.com/u/1616846?v=4","gravatar_id":"","url":"https://api.github.com/users/marco-c","html_url":"https://github.com/marco-c","followers_url":"https://api.github.com/users/marco-c/followers","following_url":"https://api.github.com/users/marco-c/following{/other_user}","gists_url":"https://api.github.com/users/marco-c/gists{/gist_id}","starred_url":"https://api.github.com/users/marco-c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marco-c/subscriptions","organizations_url":"https://api.github.com/users/marco-c/orgs","repos_url":"https://api.github.com/users/marco-c/repos","events_url":"https://api.github.com/users/marco-c/events{/privacy}","received_events_url":"https://api.github.com/users/marco-c/received_events","type":"User","site_admin":false},"repo":{"id":121634506,"node_id":"MDEwOlJlcG9zaXRvcnkxMjE2MzQ1MDY=","name":"coverage-crawler","full_name":"marco-c/coverage-crawler","owner":{"login":"marco-c","id":1616846,"node_id":"MDQ6VXNlcjE2MTY4NDY=","avatar_url":"https://avatars1.githubusercontent.com/u/1616846?v=4","gravatar_id":"","url":"https://api.github.com/users/marco-c","html_url":"https://github.com/marco-c","followers_url":"https://api.github.com/users/marco-c/followers","following_url":"https://api.github.com/users/marco-c/following{/other_user}","gists_url":"https://api.github.com/users/marco-c/gists{/gist_id}","starred_url":"https://api.github.com/users/marco-c/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marco-c/subscriptions","organizations_url":"https://api.github.com/users/marco-c/orgs","repos_url":"https://api.github.com/users/marco-c/repos","events_url":"https://api.github.com/users/marco-c/events{/privacy}","received_events_url":"https://api.github.com/users/marco-c/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/marco-c/coverage-crawler","description":"A crawler to find websites that exercise code in Firefox that is not covered by unit tests","fork":false,"url":"https://api.github.com/repos/marco-c/coverage-crawler","forks_url":"https://api.github.com/repos/marco-c/coverage-crawler/forks","keys_url":"https://api.github.com/repos/marco-c/coverage-crawler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/marco-c/coverage-crawler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/marco-c/coverage-crawler/teams","hooks_url":"https://api.github.com/repos/marco-c/coverage-crawler/hooks","issue_events_url":"https://api.github.com/repos/marco-c/coverage-crawler/issues/events{/number}","events_url":"https://api.github.com/repos/marco-c/coverage-crawler/events","assignees_url":"https://api.github.com/repos/marco-c/coverage-crawler/assignees{/user}","branches_url":"https://api.github.com/repos/marco-c/coverage-crawler/branches{/branch}","tags_url":"https://api.github.com/repos/marco-c/coverage-crawler/tags","blobs_url":"https://api.github.com/repos/marco-c/coverage-crawler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/marco-c/coverage-crawler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/marco-c/coverage-crawler/git/refs{/sha}","trees_url":"https://api.github.com/repos/marco-c/coverage-crawler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/marco-c/coverage-crawler/statuses/{sha}","languages_url":"https://api.github.com/repos/marco-c/coverage-crawler/languages","stargazers_url":"https://api.github.com/repos/marco-c/coverage-crawler/stargazers","contributors_url":"https://api.github.com/repos/marco-c/coverage-crawler/contributors","subscribers_url":"https://api.github.com/repos/marco-c/coverage-crawler/subscribers","subscription_url":"https://api.github.com/repos/marco-c/coverage-crawler/subscription","commits_url":"https://api.github.com/repos/marco-c/coverage-crawler/commits{/sha}","git_commits_url":"https://api.github.com/repos/marco-c/coverage-crawler/git/commits{/sha}","comments_url":"https://api.github.com/repos/marco-c/coverage-crawler/comments{/number}","issue_comment_url":"https://api.github.com/repos/marco-c/coverage-crawler/issues/comments{/number}","contents_url":"https://api.github.com/repos/marco-c/coverage-crawler/contents/{+path}","compare_url":"https://api.github.com/repos/marco-c/coverage-crawler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/marco-c/coverage-crawler/merges","archive_url":"https://api.github.com/repos/marco-c/coverage-crawler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/marco-c/coverage-crawler/downloads","issues_url":"https://api.github.com/repos/marco-c/coverage-crawler/issues{/number}","pulls_url":"https://api.github.com/repos/marco-c/coverage-crawler/pulls{/number}","milestones_url":"https://api.github.com/repos/marco-c/coverage-crawler/milestones{/number}","notifications_url":"https://api.github.com/repos/marco-c/coverage-crawler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/marco-c/coverage-crawler/labels{/name}","releases_url":"https://api.github.com/repos/marco-c/coverage-crawler/releases{/id}","deployments_url":"https://api.github.com/repos/marco-c/coverage-crawler/deployments","created_at":"2018-02-15T13:44:04Z","updated_at":"2018-06-15T19:52:01Z","pushed_at":"2018-06-18T12:54:33Z","git_url":"git://github.com/marco-c/coverage-crawler.git","ssh_url":"git@github.com:marco-c/coverage-crawler.git","clone_url":"https://github.com/marco-c/coverage-crawler.git","svn_url":"https://github.com/marco-c/coverage-crawler","homepage":null,"size":33,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9,"mirror_url":null,"archived":false,"open_issues_count":7,"license":{"key":"mpl-2.0","name":"Mozilla Public License 2.0","spdx_id":"MPL-2.0","url":"https://api.github.com/licenses/mpl-2.0","node_id":"MDc6TGljZW5zZTE0"},"forks":9,"open_issues":7,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/marco-c/coverage-crawler/pulls/74"},"html":{"href":"https://github.com/marco-c/coverage-crawler/pull/74"},"issue":{"href":"https://api.github.com/repos/marco-c/coverage-crawler/issues/74"},"comments":{"href":"https://api.github.com/repos/marco-c/coverage-crawler/issues/74/comments"},"review_comments":{"href":"https://api.github.com/repos/marco-c/coverage-crawler/pulls/74/comments"},"review_comment":{"href":"https://api.github.com/repos/marco-c/coverage-crawler/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/marco-c/coverage-crawler/pulls/74/commits"},"statuses":{"href":"https://api.github.com/repos/marco-c/coverage-crawler/statuses/0ee4ea51d8d9ef87d875df6fc0e25ae50571aac5"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"marco-c"}}