{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/vso-agent/pulls/comments/29895933","id":29895933,"diff_hunk":"@@ -0,0 +1,404 @@\n+import ifm = require('./api/interfaces');\n+import trp = require('./testrunpublisher');\n+import utilities = require('./utilities');\n+\n+var fs = require('fs');\n+var path = require(\"path\");\n+var xmlreader = require('xmlreader');\n+var Q = require('q');\n+\n+export class JUnitResultReader implements trp.IResultReader {\n+\n+    public readResults(file: string, runContext: trp.TestRunContext) : Q.Promise<ifm.TestRun2> {\n+        var defer = Q.defer(); \n+        var _this = this;\n+\n+        utilities.readFileContents(file, \"utf-8\").then(function (contents) {\n+            var xmlContents = contents.replace(\"\\ufeff\", \"\"); //replace BOM if exits to avoid xml read error","path":"src/agent/testresultreader.ts","position":17,"original_position":17,"commit_id":"46f9f50d5a4cf03973b2b59935933e8a43efce69","original_commit_id":"46f9f50d5a4cf03973b2b59935933e8a43efce69","user":{"login":"yacaovsnc","id":10119737,"avatar_url":"https://avatars.githubusercontent.com/u/10119737?v=3","gravatar_id":"","url":"https://api.github.com/users/yacaovsnc","html_url":"https://github.com/yacaovsnc","followers_url":"https://api.github.com/users/yacaovsnc/followers","following_url":"https://api.github.com/users/yacaovsnc/following{/other_user}","gists_url":"https://api.github.com/users/yacaovsnc/gists{/gist_id}","starred_url":"https://api.github.com/users/yacaovsnc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yacaovsnc/subscriptions","organizations_url":"https://api.github.com/users/yacaovsnc/orgs","repos_url":"https://api.github.com/users/yacaovsnc/repos","events_url":"https://api.github.com/users/yacaovsnc/events{/privacy}","received_events_url":"https://api.github.com/users/yacaovsnc/received_events","type":"User","site_admin":false},"body":"//replace BOM if *exits* to avoid xml read error\r\ntypo?","created_at":"2015-05-07T21:05:45Z","updated_at":"2015-05-07T21:05:45Z","html_url":"https://github.com/Microsoft/vso-agent/pull/9#discussion_r29895933","pull_request_url":"https://api.github.com/repos/Microsoft/vso-agent/pulls/9","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/vso-agent/pulls/comments/29895933"},"html":{"href":"https://github.com/Microsoft/vso-agent/pull/9#discussion_r29895933"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/vso-agent/pulls/9"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/vso-agent/pulls/9","id":34809982,"html_url":"https://github.com/Microsoft/vso-agent/pull/9","diff_url":"https://github.com/Microsoft/vso-agent/pull/9.diff","patch_url":"https://github.com/Microsoft/vso-agent/pull/9.patch","issue_url":"https://api.github.com/repos/Microsoft/vso-agent/issues/9","number":9,"state":"open","locked":false,"title":"Users/diganr/result publisher","user":{"login":"diganr","id":10957877,"avatar_url":"https://avatars.githubusercontent.com/u/10957877?v=3","gravatar_id":"","url":"https://api.github.com/users/diganr","html_url":"https://github.com/diganr","followers_url":"https://api.github.com/users/diganr/followers","following_url":"https://api.github.com/users/diganr/following{/other_user}","gists_url":"https://api.github.com/users/diganr/gists{/gist_id}","starred_url":"https://api.github.com/users/diganr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/diganr/subscriptions","organizations_url":"https://api.github.com/users/diganr/orgs","repos_url":"https://api.github.com/users/diganr/repos","events_url":"https://api.github.com/users/diganr/events{/privacy}","received_events_url":"https://api.github.com/users/diganr/received_events","type":"User","site_admin":false},"body":"publish results async commnad for publishing results from xplat \r\n1. results.publish async task\r\n2. testrunpublisher to do the actual publishing work \r\n3. testresultreader to actually read result files \r\n4. Error handling, feedback channel and Unit tests \r\n","created_at":"2015-05-06T12:09:34Z","updated_at":"2015-05-07T21:05:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7c0760e217162ff31660a009a29040eb430895eb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/vso-agent/pulls/9/commits","review_comments_url":"https://api.github.com/repos/Microsoft/vso-agent/pulls/9/comments","review_comment_url":"https://api.github.com/repos/Microsoft/vso-agent/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/vso-agent/issues/9/comments","statuses_url":"https://api.github.com/repos/Microsoft/vso-agent/statuses/46f9f50d5a4cf03973b2b59935933e8a43efce69","head":{"label":"Microsoft:users/diganr/ResultPublisher","ref":"users/diganr/ResultPublisher","sha":"46f9f50d5a4cf03973b2b59935933e8a43efce69","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":27405247,"name":"vso-agent","full_name":"Microsoft/vso-agent","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/vso-agent","description":"Visual Studio Online and TFS agent for OSX and Linux","fork":false,"url":"https://api.github.com/repos/Microsoft/vso-agent","forks_url":"https://api.github.com/repos/Microsoft/vso-agent/forks","keys_url":"https://api.github.com/repos/Microsoft/vso-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/vso-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/vso-agent/teams","hooks_url":"https://api.github.com/repos/Microsoft/vso-agent/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/vso-agent/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/vso-agent/events","assignees_url":"https://api.github.com/repos/Microsoft/vso-agent/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/vso-agent/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/vso-agent/tags","blobs_url":"https://api.github.com/repos/Microsoft/vso-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/vso-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/vso-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/vso-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/vso-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/vso-agent/languages","stargazers_url":"https://api.github.com/repos/Microsoft/vso-agent/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/vso-agent/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/vso-agent/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/vso-agent/subscription","commits_url":"https://api.github.com/repos/Microsoft/vso-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/vso-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/vso-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/vso-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/vso-agent/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/vso-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/vso-agent/merges","archive_url":"https://api.github.com/repos/Microsoft/vso-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/vso-agent/downloads","issues_url":"https://api.github.com/repos/Microsoft/vso-agent/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/vso-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/vso-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/vso-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/vso-agent/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/vso-agent/releases{/id}","created_at":"2014-12-01T23:24:24Z","updated_at":"2015-05-07T13:11:35Z","pushed_at":"2015-05-07T18:11:52Z","git_url":"git://github.com/Microsoft/vso-agent.git","ssh_url":"git@github.com:Microsoft/vso-agent.git","clone_url":"https://github.com/Microsoft/vso-agent.git","svn_url":"https://github.com/Microsoft/vso-agent","homepage":null,"size":1261,"stargazers_count":25,"watchers_count":25,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":2,"forks":4,"open_issues":2,"watchers":25,"default_branch":"master"}},"base":{"label":"Microsoft:master","ref":"master","sha":"2ee997fd9b254b6e9665f6cfdd01cc45b3ab3763","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":27405247,"name":"vso-agent","full_name":"Microsoft/vso-agent","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/vso-agent","description":"Visual Studio Online and TFS agent for OSX and Linux","fork":false,"url":"https://api.github.com/repos/Microsoft/vso-agent","forks_url":"https://api.github.com/repos/Microsoft/vso-agent/forks","keys_url":"https://api.github.com/repos/Microsoft/vso-agent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/vso-agent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/vso-agent/teams","hooks_url":"https://api.github.com/repos/Microsoft/vso-agent/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/vso-agent/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/vso-agent/events","assignees_url":"https://api.github.com/repos/Microsoft/vso-agent/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/vso-agent/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/vso-agent/tags","blobs_url":"https://api.github.com/repos/Microsoft/vso-agent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/vso-agent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/vso-agent/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/vso-agent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/vso-agent/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/vso-agent/languages","stargazers_url":"https://api.github.com/repos/Microsoft/vso-agent/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/vso-agent/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/vso-agent/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/vso-agent/subscription","commits_url":"https://api.github.com/repos/Microsoft/vso-agent/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/vso-agent/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/vso-agent/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/vso-agent/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/vso-agent/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/vso-agent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/vso-agent/merges","archive_url":"https://api.github.com/repos/Microsoft/vso-agent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/vso-agent/downloads","issues_url":"https://api.github.com/repos/Microsoft/vso-agent/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/vso-agent/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/vso-agent/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/vso-agent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/vso-agent/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/vso-agent/releases{/id}","created_at":"2014-12-01T23:24:24Z","updated_at":"2015-05-07T13:11:35Z","pushed_at":"2015-05-07T18:11:52Z","git_url":"git://github.com/Microsoft/vso-agent.git","ssh_url":"git@github.com:Microsoft/vso-agent.git","clone_url":"https://github.com/Microsoft/vso-agent.git","svn_url":"https://github.com/Microsoft/vso-agent","homepage":null,"size":1261,"stargazers_count":25,"watchers_count":25,"language":"TypeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":2,"forks":4,"open_issues":2,"watchers":25,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/vso-agent/pulls/9"},"html":{"href":"https://github.com/Microsoft/vso-agent/pull/9"},"issue":{"href":"https://api.github.com/repos/Microsoft/vso-agent/issues/9"},"comments":{"href":"https://api.github.com/repos/Microsoft/vso-agent/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/vso-agent/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/vso-agent/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/vso-agent/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/vso-agent/statuses/46f9f50d5a4cf03973b2b59935933e8a43efce69"}}}}