use of org.gradle.tooling.internal.provider.action.TestExecutionRequestAction in project gradle by gradle.
the class TestExecutionRequestActionRunner method run.
@Override
public Result run(BuildAction action, BuildTreeLifecycleController buildController) {
if (!(action instanceof TestExecutionRequestAction)) {
return Result.nothing();
}
try {
TestExecutionRequestAction testExecutionRequestAction = (TestExecutionRequestAction) action;
TestExecutionResultEvaluator testExecutionResultEvaluator = new TestExecutionResultEvaluator(ancestryTracker, testExecutionRequestAction);
buildOperationListenerManager.addListener(testExecutionResultEvaluator);
try {
doRun(testExecutionRequestAction, buildController);
} finally {
buildOperationListenerManager.removeListener(testExecutionResultEvaluator);
}
testExecutionResultEvaluator.evaluate();
} catch (RuntimeException e) {
Throwable throwable = findRootCause(e);
if (throwable instanceof TestExecutionException) {
return Result.failed(e, new InternalTestExecutionException("Error while running test(s)", throwable));
} else {
return Result.failed(e);
}
}
return Result.of(null);
}
use of org.gradle.tooling.internal.provider.action.TestExecutionRequestAction in project gradle by gradle.
the class ProviderConnection method runTests.
public Object runTests(ProviderInternalTestExecutionRequest testExecutionRequest, BuildCancellationToken cancellationToken, ProviderOperationParameters providerParameters) {
Parameters params = initParams(providerParameters);
StartParameterInternal startParameter = new ProviderStartParameterConverter().toStartParameter(providerParameters, params.buildLayout, params.properties);
ProgressListenerConfiguration listenerConfig = ProgressListenerConfiguration.from(providerParameters, consumerVersion);
TestExecutionRequestAction action = TestExecutionRequestAction.create(listenerConfig.clientSubscriptions, startParameter, testExecutionRequest);
return run(action, cancellationToken, listenerConfig, listenerConfig.buildEventConsumer, providerParameters, params);
}
Aggregations