static List<InclusionExclusionPattern> findTestSplits(Parallelism parallelism, Run<?,?> build, TaskListener listener, boolean generateInclusions, @CheckForNull final String stageName, @CheckForNull FilePath workspace, boolean estimateTestsFromFiles) {
TestResult tr = findPreviousTestResult(build, listener);
Map<String, TestClass> data = new TreeMap<>();
if (tr != null) {
Run<?,?> prevRun = tr.getRun();
if (prevRun instanceof FlowExecutionOwner.Executable && stageName != null) {
FlowExecutionOwner owner = ((FlowExecutionOwner.Executable)prevRun).asFlowExecutionOwner();
if (owner != null) {
FlowExecution execution = owner.getOrNull();
if (execution != null) {
DepthFirstScanner scanner = new DepthFirstScanner();
FlowNode stageId = scanner.findFirstMatch(execution, new StageNamePredicate(stageName));
if (stageId != null) {
/*****
* the following line looks dubious
*/
tr = ((hudson.tasks.junit.TestResult) tr).getResultForPipelineBlock(stageId.getId());
}
}
}
}
collect(tr, data);
Is
JENKINS-47206not working?