use of io.jenkins.blueocean.rest.model.BlueTestSummary in project blueocean-plugin by jenkinsci.
the class AbstractRunImpl method getBlueTestSummary.
@Override
public BlueTestSummary getBlueTestSummary() {
BlueTestSummary blueTestSummary;
if (getStateObj() == BlueRunState.FINISHED && run != null) {
blueTestSummary = TEST_SUMMARY.get(run.getExternalizableId(), s -> {
//
LOGGER.debug(//
"load test summary {} thread {}", //
run.getExternalizableId(), Thread.currentThread().getName());
BlueTestSummary summary = BlueTestResultFactory.resolve(run, parent).summary;
return summary;
});
} else {
blueTestSummary = BlueTestResultFactory.resolve(run, this).summary;
}
// .../runs/123/blueTestSummary
if (blueTestSummary == null) {
// Just use an empty one while we wait to avoid 404
return new BlueTestSummary(0, 0, 0, 0, 0, 0, 0, this.getLink());
}
Link link = this.getLink().rel("blueTestSummary");
blueTestSummary.setLink(link);
return blueTestSummary;
}
use of io.jenkins.blueocean.rest.model.BlueTestSummary in project blueocean-plugin by jenkinsci.
the class BlueTestResultFactory method resolve.
public static Result resolve(Run<?, ?> run, Reachable parent) {
Iterable<BlueTestResult> results = new ArrayList<>(0);
BlueTestSummary summary = new //
BlueTestSummary(//
0, //
0, //
0, //
0, //
0, //
0, //
0, parent == null ? null : parent.getLink());
for (BlueTestResultFactory factory : allFactories()) {
Result result = factory.getBlueTestResults(run, parent);
if (result != null && result.results != null && result.summary != null) {
results = IterableUtils.chainedIterable(result.results, results);
summary = summary.tally(result.summary);
}
}
return getResult(results, summary);
}
Aggregations