Source:
protected TestResultSummary run() throws Exception { FilePath workspace = getContext().get(FilePath.class); workspace.mkdirs(); Run<?,?> run = getContext().get(Run.class); TaskListener listener = getContext().get(TaskListener.class); FlowNode node = getContext().get(FlowNode.class); Launcher launcher = getContext().get(Launcher.class); String nodeId = node.getId(); if (step.getTools().isEmpty() || step.getThresholds().isEmpty()) { throw new AbortException("At least one tool and at least one threshold must be specified for the xunit step."); } XUnitProcessor xUnitProcessor = new XUnitProcessor(step.getTools().toArray(new TestType[0]), step.getThresholds().toArray(new XUnitThreshold[0]), step.getThresholdMode(), new ExtraConfiguration(step.getTestTimeMarginAsLong())); List<FlowNode> enclosingBlocks = JUnitResultsStepExecution.getEnclosingStagesAndParallels(node); PipelineTestDetails pipelineTestDetails = new PipelineTestDetails(); pipelineTestDetails.setNodeId(nodeId); pipelineTestDetails.setEnclosingBlocks(JUnitResultsStepExecution.getEnclosingBlockIds(enclosingBlocks)); pipelineTestDetails.setEnclosingBlockNames(JUnitResultsStepExecution.getEnclosingBlockNames(enclosingBlocks)); TestResultAction action = xUnitProcessor.performAndGetAction(run, pipelineTestDetails, workspace, launcher, listener); if (action != null) { Result procResult = xUnitProcessor.getBuildStatus(action.getResult().getResultByNode(nodeId), run); Result runResult = run.getResult(); if (runResult == null) { runResult = Result.SUCCESS; } if (procResult.isWorseThan(runResult)) { run.setResult(procResult); } return new TestResultSummary(action.getResult().getResultByNode(nodeId)); } return new TestResultSummary(); }

Target:
protected TestResultSummary run() throws Exception { FilePath workspace = getContext().get(FilePath.class); workspace.mkdirs(); Run<?,?> run = getContext().get(Run.class); TaskListener listener = getContext().get(TaskListener.class); FlowNode node = getContext().get(FlowNode.class); Launcher launcher = getContext().get(Launcher.class); String nodeId = node.getId(); if (step.getTools().isEmpty()) { throw new AbortException(Messages.XUnitResultsStepExecution_noTool()); } XUnitProcessor xUnitProcessor = new XUnitProcessor(step.getTools().toArray(new TestType[0]), step.getThresholds().toArray(new XUnitThreshold[0]), step.getThresholdMode(), new ExtraConfiguration(step.getTestTimeMarginAsLong())); List<FlowNode> enclosingBlocks = JUnitResultsStepExecution.getEnclosingStagesAndParallels(node); PipelineTestDetails pipelineTestDetails = new PipelineTestDetails(); pipelineTestDetails.setNodeId(nodeId); pipelineTestDetails.setEnclosingBlocks(JUnitResultsStepExecution.getEnclosingBlockIds(enclosingBlocks)); pipelineTestDetails.setEnclosingBlockNames(JUnitResultsStepExecution.getEnclosingBlockNames(enclosingBlocks)); xUnitProcessor.process(run, workspace, listener, launcher, step.getTestDataPublishers(), pipelineTestDetails); TestResultAction action = run.getAction(TestResultAction.class); if (action != null) { Result procResult = xUnitProcessor.getBuildStatus(action.getResult().getResultByNode(nodeId), run); Result runResult = run.getResult(); if (runResult == null) { runResult = Result.SUCCESS; } if (procResult.isWorseThan(runResult)) { run.setResult(procResult); } return new TestResultSummary(action.getResult().getResultByNode(nodeId)); } return new TestResultSummary(); }