{"action":"created","comment":{"url":"https://api.github.com/repos/jenkinsci/xunit-plugin/pulls/comments/220000131","pull_request_review_id":158308915,"id":220000131,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyMDAwMDEzMQ==","diff_hunk":"@@ -0,0 +1,77 @@\n+package org.jenkinsci.plugins.xunit.pipeline;\n+\n+import hudson.AbortException;\n+import hudson.FilePath;\n+import hudson.Launcher;\n+import hudson.model.Result;\n+import hudson.model.Run;\n+import hudson.model.TaskListener;\n+import hudson.tasks.junit.TestResultAction;\n+import hudson.tasks.junit.TestResultSummary;\n+import hudson.tasks.junit.pipeline.JUnitResultsStepExecution;\n+import hudson.tasks.test.PipelineTestDetails;\n+import org.jenkinsci.lib.dtkit.type.TestType;\n+import org.jenkinsci.plugins.workflow.graph.FlowNode;\n+import org.jenkinsci.plugins.workflow.steps.StepContext;\n+import org.jenkinsci.plugins.workflow.steps.SynchronousStepExecution;\n+import org.jenkinsci.plugins.xunit.ExtraConfiguration;\n+import org.jenkinsci.plugins.xunit.XUnitProcessor;\n+import org.jenkinsci.plugins.xunit.threshold.XUnitThreshold;\n+\n+import javax.annotation.Nonnull;\n+import java.util.List;\n+\n+public class XUnitResultsStepExecution extends SynchronousStepExecution<TestResultSummary> {\n+    private transient XUnitResultsStep step;\n+\n+    public XUnitResultsStepExecution(@Nonnull XUnitResultsStep step, StepContext context) {\n+        super(context);\n+        this.step = step;\n+    }\n+\n+    @Override\n+    protected TestResultSummary run() throws Exception {\n+        FilePath workspace = getContext().get(FilePath.class);\n+        workspace.mkdirs();\n+        Run<?,?> run = getContext().get(Run.class);\n+        TaskListener listener = getContext().get(TaskListener.class);\n+        FlowNode node = getContext().get(FlowNode.class);\n+        Launcher launcher = getContext().get(Launcher.class);\n+\n+        String nodeId = node.getId();\n+\n+        if (step.getTools().isEmpty() || step.getThresholds().isEmpty()) {\n+            throw new AbortException(\"At least one tool and at least one threshold must be specified for the xunit step.\");\n+        }\n+\n+        XUnitProcessor xUnitProcessor = new XUnitProcessor(step.getTools().toArray(new TestType[0]),\n+                step.getThresholds().toArray(new XUnitThreshold[0]),\n+                step.getThresholdMode(),\n+                new ExtraConfiguration(step.getTestTimeMarginAsLong()));\n+        List<FlowNode> enclosingBlocks = JUnitResultsStepExecution.getEnclosingStagesAndParallels(node);\n+\n+        PipelineTestDetails pipelineTestDetails = new PipelineTestDetails();\n+        pipelineTestDetails.setNodeId(nodeId);\n+        pipelineTestDetails.setEnclosingBlocks(JUnitResultsStepExecution.getEnclosingBlockIds(enclosingBlocks));\n+        pipelineTestDetails.setEnclosingBlockNames(JUnitResultsStepExecution.getEnclosingBlockNames(enclosingBlocks));\n+        TestResultAction action = xUnitProcessor.performAndGetAction(run, pipelineTestDetails, workspace, launcher, listener);","path":"src/main/java/org/jenkinsci/plugins/xunit/pipeline/XUnitResultsStepExecution.java","position":80,"original_position":57,"commit_id":"ace3034f871eaec6a6bf28d5ec916b9c9eb56ec9","original_commit_id":"bb8e7fd9cc7fad0d6fbd298ad310d030fa7c3138","user":{"login":"nfalco79","id":4160180,"node_id":"MDQ6VXNlcjQxNjAxODA=","avatar_url":"https://avatars0.githubusercontent.com/u/4160180?v=4","gravatar_id":"","url":"https://api.github.com/users/nfalco79","html_url":"https://github.com/nfalco79","followers_url":"https://api.github.com/users/nfalco79/followers","following_url":"https://api.github.com/users/nfalco79/following{/other_user}","gists_url":"https://api.github.com/users/nfalco79/gists{/gist_id}","starred_url":"https://api.github.com/users/nfalco79/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nfalco79/subscriptions","organizations_url":"https://api.github.com/users/nfalco79/orgs","repos_url":"https://api.github.com/users/nfalco79/repos","events_url":"https://api.github.com/users/nfalco79/events{/privacy}","received_events_url":"https://api.github.com/users/nfalco79/received_events","type":"User","site_admin":false},"body":"Why? And if a step it's only a wrapper of the SimpleBuildStep than here you should use the XUnitPublisher directly and not the processor.","created_at":"2018-09-24T21:47:24Z","updated_at":"2018-09-24T21:47:24Z","html_url":"https://github.com/jenkinsci/xunit-plugin/pull/65#discussion_r220000131","pull_request_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/pulls/65","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/xunit-plugin/pulls/comments/220000131"},"html":{"href":"https://github.com/jenkinsci/xunit-plugin/pull/65#discussion_r220000131"},"pull_request":{"href":"https://api.github.com/repos/jenkinsci/xunit-plugin/pulls/65"}},"in_reply_to_id":219912360},"pull_request":{"url":"https://api.github.com/repos/jenkinsci/xunit-plugin/pulls/65","id":217682542,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE3NjgyNTQy","html_url":"https://github.com/jenkinsci/xunit-plugin/pull/65","diff_url":"https://github.com/jenkinsci/xunit-plugin/pull/65.diff","patch_url":"https://github.com/jenkinsci/xunit-plugin/pull/65.patch","issue_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/issues/65","number":65,"state":"open","locked":false,"title":"Add `xunit` step","user":{"login":"abayer","id":120218,"node_id":"MDQ6VXNlcjEyMDIxOA==","avatar_url":"https://avatars2.githubusercontent.com/u/120218?v=4","gravatar_id":"","url":"https://api.github.com/users/abayer","html_url":"https://github.com/abayer","followers_url":"https://api.github.com/users/abayer/followers","following_url":"https://api.github.com/users/abayer/following{/other_user}","gists_url":"https://api.github.com/users/abayer/gists{/gist_id}","starred_url":"https://api.github.com/users/abayer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abayer/subscriptions","organizations_url":"https://api.github.com/users/abayer/orgs","repos_url":"https://api.github.com/users/abayer/repos","events_url":"https://api.github.com/users/abayer/events{/privacy}","received_events_url":"https://api.github.com/users/abayer/received_events","type":"User","site_admin":false},"body":"Rewrite of https://github.com/jenkinsci/xunit-plugin/pull/49","created_at":"2018-09-24T14:48:01Z","updated_at":"2018-09-24T21:47:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7fa40e058e9253fa93973938cbed2d1edcd4ce7d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/pulls/65/commits","review_comments_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/pulls/65/comments","review_comment_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/issues/65/comments","statuses_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/statuses/ace3034f871eaec6a6bf28d5ec916b9c9eb56ec9","head":{"label":"abayer:jenkins-27395-mk2","ref":"jenkins-27395-mk2","sha":"ace3034f871eaec6a6bf28d5ec916b9c9eb56ec9","user":{"login":"abayer","id":120218,"node_id":"MDQ6VXNlcjEyMDIxOA==","avatar_url":"https://avatars2.githubusercontent.com/u/120218?v=4","gravatar_id":"","url":"https://api.github.com/users/abayer","html_url":"https://github.com/abayer","followers_url":"https://api.github.com/users/abayer/followers","following_url":"https://api.github.com/users/abayer/following{/other_user}","gists_url":"https://api.github.com/users/abayer/gists{/gist_id}","starred_url":"https://api.github.com/users/abayer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abayer/subscriptions","organizations_url":"https://api.github.com/users/abayer/orgs","repos_url":"https://api.github.com/users/abayer/repos","events_url":"https://api.github.com/users/abayer/events{/privacy}","received_events_url":"https://api.github.com/users/abayer/received_events","type":"User","site_admin":false},"repo":{"id":49514099,"node_id":"MDEwOlJlcG9zaXRvcnk0OTUxNDA5OQ==","name":"xunit-plugin","full_name":"abayer/xunit-plugin","private":false,"owner":{"login":"abayer","id":120218,"node_id":"MDQ6VXNlcjEyMDIxOA==","avatar_url":"https://avatars2.githubusercontent.com/u/120218?v=4","gravatar_id":"","url":"https://api.github.com/users/abayer","html_url":"https://github.com/abayer","followers_url":"https://api.github.com/users/abayer/followers","following_url":"https://api.github.com/users/abayer/following{/other_user}","gists_url":"https://api.github.com/users/abayer/gists{/gist_id}","starred_url":"https://api.github.com/users/abayer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abayer/subscriptions","organizations_url":"https://api.github.com/users/abayer/orgs","repos_url":"https://api.github.com/users/abayer/repos","events_url":"https://api.github.com/users/abayer/events{/privacy}","received_events_url":"https://api.github.com/users/abayer/received_events","type":"User","site_admin":false},"html_url":"https://github.com/abayer/xunit-plugin","description":"Jenkins xunit plugin","fork":true,"url":"https://api.github.com/repos/abayer/xunit-plugin","forks_url":"https://api.github.com/repos/abayer/xunit-plugin/forks","keys_url":"https://api.github.com/repos/abayer/xunit-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/abayer/xunit-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/abayer/xunit-plugin/teams","hooks_url":"https://api.github.com/repos/abayer/xunit-plugin/hooks","issue_events_url":"https://api.github.com/repos/abayer/xunit-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/abayer/xunit-plugin/events","assignees_url":"https://api.github.com/repos/abayer/xunit-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/abayer/xunit-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/abayer/xunit-plugin/tags","blobs_url":"https://api.github.com/repos/abayer/xunit-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/abayer/xunit-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/abayer/xunit-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/abayer/xunit-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/abayer/xunit-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/abayer/xunit-plugin/languages","stargazers_url":"https://api.github.com/repos/abayer/xunit-plugin/stargazers","contributors_url":"https://api.github.com/repos/abayer/xunit-plugin/contributors","subscribers_url":"https://api.github.com/repos/abayer/xunit-plugin/subscribers","subscription_url":"https://api.github.com/repos/abayer/xunit-plugin/subscription","commits_url":"https://api.github.com/repos/abayer/xunit-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/abayer/xunit-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/abayer/xunit-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/abayer/xunit-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/abayer/xunit-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/abayer/xunit-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/abayer/xunit-plugin/merges","archive_url":"https://api.github.com/repos/abayer/xunit-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/abayer/xunit-plugin/downloads","issues_url":"https://api.github.com/repos/abayer/xunit-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/abayer/xunit-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/abayer/xunit-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/abayer/xunit-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/abayer/xunit-plugin/labels{/name}","releases_url":"https://api.github.com/repos/abayer/xunit-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/abayer/xunit-plugin/deployments","created_at":"2016-01-12T16:42:03Z","updated_at":"2016-01-12T16:42:04Z","pushed_at":"2018-09-24T17:20:58Z","git_url":"git://github.com/abayer/xunit-plugin.git","ssh_url":"git@github.com:abayer/xunit-plugin.git","clone_url":"https://github.com/abayer/xunit-plugin.git","svn_url":"https://github.com/abayer/xunit-plugin","homepage":"http://jenkins-ci.org/","size":1573,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jenkinsci:master","ref":"master","sha":"1c6c1ca45816fc55f4058973c9f02f099891e81f","user":{"login":"jenkinsci","id":107424,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNzQyNA==","avatar_url":"https://avatars0.githubusercontent.com/u/107424?v=4","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"repo":{"id":1169248,"node_id":"MDEwOlJlcG9zaXRvcnkxMTY5MjQ4","name":"xunit-plugin","full_name":"jenkinsci/xunit-plugin","private":false,"owner":{"login":"jenkinsci","id":107424,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNzQyNA==","avatar_url":"https://avatars0.githubusercontent.com/u/107424?v=4","gravatar_id":"","url":"https://api.github.com/users/jenkinsci","html_url":"https://github.com/jenkinsci","followers_url":"https://api.github.com/users/jenkinsci/followers","following_url":"https://api.github.com/users/jenkinsci/following{/other_user}","gists_url":"https://api.github.com/users/jenkinsci/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkinsci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkinsci/subscriptions","organizations_url":"https://api.github.com/users/jenkinsci/orgs","repos_url":"https://api.github.com/users/jenkinsci/repos","events_url":"https://api.github.com/users/jenkinsci/events{/privacy}","received_events_url":"https://api.github.com/users/jenkinsci/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/jenkinsci/xunit-plugin","description":"Jenkins xunit plugin","fork":false,"url":"https://api.github.com/repos/jenkinsci/xunit-plugin","forks_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/forks","keys_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/teams","hooks_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/hooks","issue_events_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/issues/events{/number}","events_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/events","assignees_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/assignees{/user}","branches_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/branches{/branch}","tags_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/tags","blobs_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/git/refs{/sha}","trees_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/statuses/{sha}","languages_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/languages","stargazers_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/stargazers","contributors_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/contributors","subscribers_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/subscribers","subscription_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/subscription","commits_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/commits{/sha}","git_commits_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/git/commits{/sha}","comments_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/comments{/number}","issue_comment_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/issues/comments{/number}","contents_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/contents/{+path}","compare_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/merges","archive_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/downloads","issues_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/issues{/number}","pulls_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/pulls{/number}","milestones_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/milestones{/number}","notifications_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/labels{/name}","releases_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/releases{/id}","deployments_url":"https://api.github.com/repos/jenkinsci/xunit-plugin/deployments","created_at":"2010-12-14T20:48:15Z","updated_at":"2018-09-24T08:12:05Z","pushed_at":"2018-09-24T17:20:59Z","git_url":"git://github.com/jenkinsci/xunit-plugin.git","ssh_url":"git@github.com:jenkinsci/xunit-plugin.git","clone_url":"https://github.com/jenkinsci/xunit-plugin.git","svn_url":"https://github.com/jenkinsci/xunit-plugin","homepage":"https://plugins.jenkins.io/xunit","size":1541,"stargazers_count":58,"watchers_count":58,"language":"Java","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":104,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":104,"open_issues":1,"watchers":58,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jenkinsci/xunit-plugin/pulls/65"},"html":{"href":"https://github.com/jenkinsci/xunit-plugin/pull/65"},"issue":{"href":"https://api.github.com/repos/jenkinsci/xunit-plugin/issues/65"},"comments":{"href":"https://api.github.com/repos/jenkinsci/xunit-plugin/issues/65/comments"},"review_comments":{"href":"https://api.github.com/repos/jenkinsci/xunit-plugin/pulls/65/comments"},"review_comment":{"href":"https://api.github.com/repos/jenkinsci/xunit-plugin/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jenkinsci/xunit-plugin/pulls/65/commits"},"statuses":{"href":"https://api.github.com/repos/jenkinsci/xunit-plugin/statuses/ace3034f871eaec6a6bf28d5ec916b9c9eb56ec9"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"nfalco79"}}