use of org.gradle.tooling.internal.provider.TestExecutionRequestAction in project gradle by gradle.
the class TestExecutionRequestActionRunner method run.
@Override
public void run(BuildAction action, BuildController buildController) {
if (!(action instanceof TestExecutionRequestAction)) {
return;
}
GradleInternal gradle = buildController.getGradle();
try {
TestExecutionRequestAction testExecutionRequestAction = (TestExecutionRequestAction) action;
TestExecutionResultEvaluator testExecutionResultEvaluator = new TestExecutionResultEvaluator(testExecutionRequestAction);
buildOperationListenerManager.addListener(testExecutionResultEvaluator);
try {
doRun(testExecutionRequestAction, buildController);
} finally {
buildOperationListenerManager.removeListener(testExecutionResultEvaluator);
}
testExecutionResultEvaluator.evaluate();
} catch (RuntimeException rex) {
Throwable throwable = findRootCause(rex);
if (throwable instanceof TestExecutionException) {
// Tunnel the failure through the reporting
throw new ReportedException(new InternalTestExecutionException("Error while running test(s)", throwable));
} else {
throw rex;
}
}
PayloadSerializer payloadSerializer = gradle.getServices().get(PayloadSerializer.class);
buildController.setResult(new BuildActionResult(payloadSerializer.serialize(null), null));
}
Aggregations