{"action":"created","comment":{"url":"https://api.github.com/repos/arquillian/smart-testing/pulls/comments/137490956","pull_request_review_id":61163629,"id":137490956,"diff_hunk":"@@ -0,0 +1,21 @@\n+package org.arquillian.smart.testing.strategies.affected;\n+\n+import org.jgrapht.DirectedGraph;\n+import org.jgrapht.ext.DOTExporter;\n+import org.jgrapht.ext.ExportException;\n+import org.jgrapht.graph.DefaultEdge;\n+\n+import java.io.File;\n+\n+class GraphExporter\n+{\n+    public void dumpGraph(DirectedGraph<JavaElement, DefaultEdge> graph, String graphName) {\n+        try {\n+            new DOTExporter<JavaElement, DefaultEdge>(component -> \"\\\"\" + component.getClassName() + \"\\\"\",\n+                null, null)\n+                .exportGraph(graph, new File(System.getProperty(\"java.io.tmpdir\") + \"/graph-\" + graphName + \".dot\"));","path":"strategies/affected/src/main/java/org/arquillian/smart/testing/strategies/affected/GraphExporter.java","position":16,"original_position":16,"commit_id":"21b28c232777404d1ebda2dca33f739247b45739","original_commit_id":"21b28c232777404d1ebda2dca33f739247b45739","user":{"login":"MatousJobanek","id":1510709,"avatar_url":"https://avatars3.githubusercontent.com/u/1510709?v=4","gravatar_id":"","url":"https://api.github.com/users/MatousJobanek","html_url":"https://github.com/MatousJobanek","followers_url":"https://api.github.com/users/MatousJobanek/followers","following_url":"https://api.github.com/users/MatousJobanek/following{/other_user}","gists_url":"https://api.github.com/users/MatousJobanek/gists{/gist_id}","starred_url":"https://api.github.com/users/MatousJobanek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MatousJobanek/subscriptions","organizations_url":"https://api.github.com/users/MatousJobanek/orgs","repos_url":"https://api.github.com/users/MatousJobanek/repos","events_url":"https://api.github.com/users/MatousJobanek/events{/privacy}","received_events_url":"https://api.github.com/users/MatousJobanek/received_events","type":"User","site_admin":false},"body":"wouldn't make sense to store the file inside of `target/smart-testing` directory of the particular module/project? I guess, that this directory will contain all ST relevant information/files","created_at":"2017-09-07T09:32:08Z","updated_at":"2017-09-07T09:32:08Z","html_url":"https://github.com/arquillian/smart-testing/pull/125#discussion_r137490956","pull_request_url":"https://api.github.com/repos/arquillian/smart-testing/pulls/125","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/arquillian/smart-testing/pulls/comments/137490956"},"html":{"href":"https://github.com/arquillian/smart-testing/pull/125#discussion_r137490956"},"pull_request":{"href":"https://api.github.com/repos/arquillian/smart-testing/pulls/125"}},"in_reply_to_id":137490026},"pull_request":{"url":"https://api.github.com/repos/arquillian/smart-testing/pulls/125","id":139190190,"html_url":"https://github.com/arquillian/smart-testing/pull/125","diff_url":"https://github.com/arquillian/smart-testing/pull/125.diff","patch_url":"https://github.com/arquillian/smart-testing/pull/125.patch","issue_url":"https://api.github.com/repos/arquillian/smart-testing/issues/125","number":125,"state":"open","locked":false,"title":"Ability to dump graph as a dot file","user":{"login":"bartoszmajsak","id":719616,"avatar_url":"https://avatars1.githubusercontent.com/u/719616?v=4","gravatar_id":"","url":"https://api.github.com/users/bartoszmajsak","html_url":"https://github.com/bartoszmajsak","followers_url":"https://api.github.com/users/bartoszmajsak/followers","following_url":"https://api.github.com/users/bartoszmajsak/following{/other_user}","gists_url":"https://api.github.com/users/bartoszmajsak/gists{/gist_id}","starred_url":"https://api.github.com/users/bartoszmajsak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bartoszmajsak/subscriptions","organizations_url":"https://api.github.com/users/bartoszmajsak/orgs","repos_url":"https://api.github.com/users/bartoszmajsak/repos","events_url":"https://api.github.com/users/bartoszmajsak/events{/privacy}","received_events_url":"https://api.github.com/users/bartoszmajsak/received_events","type":"User","site_admin":false},"body":"#### Short description of what this resolves:\r\n\r\nWhile working on issues with Affected strategy I wrote a simple piece of code dumping graph to a `dot` format. This can be later used either using regular text `diff` or make an image out of it. For example \r\n\r\n```shell\r\n$ dot /tmp/graph-test_with_fork_count_one.dot -Tpng\r\n``` \r\n\r\nwill produce graph in PNG format.\r\n\r\n#### Changes proposed in this pull request:\r\n\r\n- `GraphExporter` producing dot files\r\n- Graph is dumped when debug mode is enabled (should be aligned with #91)\r\n- File name is either consisting of `graph.name` property or has random UUID instead\r\n\r\nAs an example (to be removed before final merge) I used our forking test - this shows that we really need configuration file instead of relying on properties, as we are not propagating them to surefire forked processes and some tests don't dump their graphs.\r\n","created_at":"2017-09-04T16:40:46Z","updated_at":"2017-09-07T09:32:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c46801630e12174b9347ba3675599308fd4bce65","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/arquillian/smart-testing/pulls/125/commits","review_comments_url":"https://api.github.com/repos/arquillian/smart-testing/pulls/125/comments","review_comment_url":"https://api.github.com/repos/arquillian/smart-testing/pulls/comments{/number}","comments_url":"https://api.github.com/repos/arquillian/smart-testing/issues/125/comments","statuses_url":"https://api.github.com/repos/arquillian/smart-testing/statuses/21b28c232777404d1ebda2dca33f739247b45739","head":{"label":"arquillian:graph_diagnostic","ref":"graph_diagnostic","sha":"21b28c232777404d1ebda2dca33f739247b45739","user":{"login":"arquillian","id":330981,"avatar_url":"https://avatars3.githubusercontent.com/u/330981?v=4","gravatar_id":"","url":"https://api.github.com/users/arquillian","html_url":"https://github.com/arquillian","followers_url":"https://api.github.com/users/arquillian/followers","following_url":"https://api.github.com/users/arquillian/following{/other_user}","gists_url":"https://api.github.com/users/arquillian/gists{/gist_id}","starred_url":"https://api.github.com/users/arquillian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arquillian/subscriptions","organizations_url":"https://api.github.com/users/arquillian/orgs","repos_url":"https://api.github.com/users/arquillian/repos","events_url":"https://api.github.com/users/arquillian/events{/privacy}","received_events_url":"https://api.github.com/users/arquillian/received_events","type":"Organization","site_admin":false},"repo":{"id":87460635,"name":"smart-testing","full_name":"arquillian/smart-testing","owner":{"login":"arquillian","id":330981,"avatar_url":"https://avatars3.githubusercontent.com/u/330981?v=4","gravatar_id":"","url":"https://api.github.com/users/arquillian","html_url":"https://github.com/arquillian","followers_url":"https://api.github.com/users/arquillian/followers","following_url":"https://api.github.com/users/arquillian/following{/other_user}","gists_url":"https://api.github.com/users/arquillian/gists{/gist_id}","starred_url":"https://api.github.com/users/arquillian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arquillian/subscriptions","organizations_url":"https://api.github.com/users/arquillian/orgs","repos_url":"https://api.github.com/users/arquillian/repos","events_url":"https://api.github.com/users/arquillian/events{/privacy}","received_events_url":"https://api.github.com/users/arquillian/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/arquillian/smart-testing","description":"We know which tests you want to run.","fork":false,"url":"https://api.github.com/repos/arquillian/smart-testing","forks_url":"https://api.github.com/repos/arquillian/smart-testing/forks","keys_url":"https://api.github.com/repos/arquillian/smart-testing/keys{/key_id}","collaborators_url":"https://api.github.com/repos/arquillian/smart-testing/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/arquillian/smart-testing/teams","hooks_url":"https://api.github.com/repos/arquillian/smart-testing/hooks","issue_events_url":"https://api.github.com/repos/arquillian/smart-testing/issues/events{/number}","events_url":"https://api.github.com/repos/arquillian/smart-testing/events","assignees_url":"https://api.github.com/repos/arquillian/smart-testing/assignees{/user}","branches_url":"https://api.github.com/repos/arquillian/smart-testing/branches{/branch}","tags_url":"https://api.github.com/repos/arquillian/smart-testing/tags","blobs_url":"https://api.github.com/repos/arquillian/smart-testing/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/arquillian/smart-testing/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/arquillian/smart-testing/git/refs{/sha}","trees_url":"https://api.github.com/repos/arquillian/smart-testing/git/trees{/sha}","statuses_url":"https://api.github.com/repos/arquillian/smart-testing/statuses/{sha}","languages_url":"https://api.github.com/repos/arquillian/smart-testing/languages","stargazers_url":"https://api.github.com/repos/arquillian/smart-testing/stargazers","contributors_url":"https://api.github.com/repos/arquillian/smart-testing/contributors","subscribers_url":"https://api.github.com/repos/arquillian/smart-testing/subscribers","subscription_url":"https://api.github.com/repos/arquillian/smart-testing/subscription","commits_url":"https://api.github.com/repos/arquillian/smart-testing/commits{/sha}","git_commits_url":"https://api.github.com/repos/arquillian/smart-testing/git/commits{/sha}","comments_url":"https://api.github.com/repos/arquillian/smart-testing/comments{/number}","issue_comment_url":"https://api.github.com/repos/arquillian/smart-testing/issues/comments{/number}","contents_url":"https://api.github.com/repos/arquillian/smart-testing/contents/{+path}","compare_url":"https://api.github.com/repos/arquillian/smart-testing/compare/{base}...{head}","merges_url":"https://api.github.com/repos/arquillian/smart-testing/merges","archive_url":"https://api.github.com/repos/arquillian/smart-testing/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/arquillian/smart-testing/downloads","issues_url":"https://api.github.com/repos/arquillian/smart-testing/issues{/number}","pulls_url":"https://api.github.com/repos/arquillian/smart-testing/pulls{/number}","milestones_url":"https://api.github.com/repos/arquillian/smart-testing/milestones{/number}","notifications_url":"https://api.github.com/repos/arquillian/smart-testing/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/arquillian/smart-testing/labels{/name}","releases_url":"https://api.github.com/repos/arquillian/smart-testing/releases{/id}","deployments_url":"https://api.github.com/repos/arquillian/smart-testing/deployments","created_at":"2017-04-06T18:15:38Z","updated_at":"2017-08-03T08:28:32Z","pushed_at":"2017-09-07T08:22:10Z","git_url":"git://github.com/arquillian/smart-testing.git","ssh_url":"git@github.com:arquillian/smart-testing.git","clone_url":"https://github.com/arquillian/smart-testing.git","svn_url":"https://github.com/arquillian/smart-testing","homepage":null,"size":657,"stargazers_count":4,"watchers_count":4,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":6,"mirror_url":null,"open_issues_count":21,"forks":6,"open_issues":21,"watchers":4,"default_branch":"master"}},"base":{"label":"arquillian:master","ref":"master","sha":"e5d3f8342fb531e8d6c38b1024795df60ab77905","user":{"login":"arquillian","id":330981,"avatar_url":"https://avatars3.githubusercontent.com/u/330981?v=4","gravatar_id":"","url":"https://api.github.com/users/arquillian","html_url":"https://github.com/arquillian","followers_url":"https://api.github.com/users/arquillian/followers","following_url":"https://api.github.com/users/arquillian/following{/other_user}","gists_url":"https://api.github.com/users/arquillian/gists{/gist_id}","starred_url":"https://api.github.com/users/arquillian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arquillian/subscriptions","organizations_url":"https://api.github.com/users/arquillian/orgs","repos_url":"https://api.github.com/users/arquillian/repos","events_url":"https://api.github.com/users/arquillian/events{/privacy}","received_events_url":"https://api.github.com/users/arquillian/received_events","type":"Organization","site_admin":false},"repo":{"id":87460635,"name":"smart-testing","full_name":"arquillian/smart-testing","owner":{"login":"arquillian","id":330981,"avatar_url":"https://avatars3.githubusercontent.com/u/330981?v=4","gravatar_id":"","url":"https://api.github.com/users/arquillian","html_url":"https://github.com/arquillian","followers_url":"https://api.github.com/users/arquillian/followers","following_url":"https://api.github.com/users/arquillian/following{/other_user}","gists_url":"https://api.github.com/users/arquillian/gists{/gist_id}","starred_url":"https://api.github.com/users/arquillian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arquillian/subscriptions","organizations_url":"https://api.github.com/users/arquillian/orgs","repos_url":"https://api.github.com/users/arquillian/repos","events_url":"https://api.github.com/users/arquillian/events{/privacy}","received_events_url":"https://api.github.com/users/arquillian/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/arquillian/smart-testing","description":"We know which tests you want to run.","fork":false,"url":"https://api.github.com/repos/arquillian/smart-testing","forks_url":"https://api.github.com/repos/arquillian/smart-testing/forks","keys_url":"https://api.github.com/repos/arquillian/smart-testing/keys{/key_id}","collaborators_url":"https://api.github.com/repos/arquillian/smart-testing/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/arquillian/smart-testing/teams","hooks_url":"https://api.github.com/repos/arquillian/smart-testing/hooks","issue_events_url":"https://api.github.com/repos/arquillian/smart-testing/issues/events{/number}","events_url":"https://api.github.com/repos/arquillian/smart-testing/events","assignees_url":"https://api.github.com/repos/arquillian/smart-testing/assignees{/user}","branches_url":"https://api.github.com/repos/arquillian/smart-testing/branches{/branch}","tags_url":"https://api.github.com/repos/arquillian/smart-testing/tags","blobs_url":"https://api.github.com/repos/arquillian/smart-testing/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/arquillian/smart-testing/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/arquillian/smart-testing/git/refs{/sha}","trees_url":"https://api.github.com/repos/arquillian/smart-testing/git/trees{/sha}","statuses_url":"https://api.github.com/repos/arquillian/smart-testing/statuses/{sha}","languages_url":"https://api.github.com/repos/arquillian/smart-testing/languages","stargazers_url":"https://api.github.com/repos/arquillian/smart-testing/stargazers","contributors_url":"https://api.github.com/repos/arquillian/smart-testing/contributors","subscribers_url":"https://api.github.com/repos/arquillian/smart-testing/subscribers","subscription_url":"https://api.github.com/repos/arquillian/smart-testing/subscription","commits_url":"https://api.github.com/repos/arquillian/smart-testing/commits{/sha}","git_commits_url":"https://api.github.com/repos/arquillian/smart-testing/git/commits{/sha}","comments_url":"https://api.github.com/repos/arquillian/smart-testing/comments{/number}","issue_comment_url":"https://api.github.com/repos/arquillian/smart-testing/issues/comments{/number}","contents_url":"https://api.github.com/repos/arquillian/smart-testing/contents/{+path}","compare_url":"https://api.github.com/repos/arquillian/smart-testing/compare/{base}...{head}","merges_url":"https://api.github.com/repos/arquillian/smart-testing/merges","archive_url":"https://api.github.com/repos/arquillian/smart-testing/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/arquillian/smart-testing/downloads","issues_url":"https://api.github.com/repos/arquillian/smart-testing/issues{/number}","pulls_url":"https://api.github.com/repos/arquillian/smart-testing/pulls{/number}","milestones_url":"https://api.github.com/repos/arquillian/smart-testing/milestones{/number}","notifications_url":"https://api.github.com/repos/arquillian/smart-testing/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/arquillian/smart-testing/labels{/name}","releases_url":"https://api.github.com/repos/arquillian/smart-testing/releases{/id}","deployments_url":"https://api.github.com/repos/arquillian/smart-testing/deployments","created_at":"2017-04-06T18:15:38Z","updated_at":"2017-08-03T08:28:32Z","pushed_at":"2017-09-07T08:22:10Z","git_url":"git://github.com/arquillian/smart-testing.git","ssh_url":"git@github.com:arquillian/smart-testing.git","clone_url":"https://github.com/arquillian/smart-testing.git","svn_url":"https://github.com/arquillian/smart-testing","homepage":null,"size":657,"stargazers_count":4,"watchers_count":4,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":6,"mirror_url":null,"open_issues_count":21,"forks":6,"open_issues":21,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/arquillian/smart-testing/pulls/125"},"html":{"href":"https://github.com/arquillian/smart-testing/pull/125"},"issue":{"href":"https://api.github.com/repos/arquillian/smart-testing/issues/125"},"comments":{"href":"https://api.github.com/repos/arquillian/smart-testing/issues/125/comments"},"review_comments":{"href":"https://api.github.com/repos/arquillian/smart-testing/pulls/125/comments"},"review_comment":{"href":"https://api.github.com/repos/arquillian/smart-testing/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/arquillian/smart-testing/pulls/125/commits"},"statuses":{"href":"https://api.github.com/repos/arquillian/smart-testing/statuses/21b28c232777404d1ebda2dca33f739247b45739"}},"author_association":"OWNER"}}
{"actor":{"display_login":"MatousJobanek"}}