PipelineTestDetails pipelineTestDetails = new PipelineTestDetails(); pipelineTestDetails.setNodeId(nodeId); pipelineTestDetails.setEnclosingBlocks(JUnitResultsStepExecution.getEnclosingBlockIds(enclosingBlocks)); pipelineTestDetails.setEnclosingBlockNames(JUnitResultsStepExecution.getEnclosingBlockNames(enclosingBlocks));
@Override 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); Launcher launcher = getContext().get(Launcher.class); FlowNode node = getContext().get(FlowNode.class); String nodeId = node.getId(); List<FlowNode> enclosingBlocks = getEnclosingStagesAndParallels(node); PipelineTestDetails pipelineTestDetails = new PipelineTestDetails(); pipelineTestDetails.setNodeId(nodeId); pipelineTestDetails.setEnclosingBlocks(getEnclosingBlockIds(enclosingBlocks)); pipelineTestDetails.setEnclosingBlockNames(getEnclosingBlockNames(enclosingBlocks)); try { TestResultAction testResultAction = JUnitResultArchiver.parseAndAttach(step, pipelineTestDetails, run, workspace, launcher, listener); if (testResultAction != null) { // TODO: Once JENKINS-43995 lands, update this to set the step status instead of the entire build. if (testResultAction.getResult().getFailCount() > 0) { run.setResult(Result.UNSTABLE); } return new TestResultSummary(testResultAction.getResult().getResultByNode(nodeId)); } } catch (Exception e) { listener.getLogger().println(e.getMessage()); throw e; } return new TestResultSummary(); }
pipelineTestDetails.setEnclosingBlocks(JUnitResultsStepExecution.getEnclosingBlockIds(enclosingBlocks)); pipelineTestDetails.setEnclosingBlockNames(JUnitResultsStepExecution.getEnclosingBlockNames(enclosingBlocks)); xUnitProcessor.process(run, workspace, listener, launcher, step.getTestDataPublishers(), pipelineTestDetails);