Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Set up DirectPath e2e tests correctly #780

Merged
merged 6 commits into from Jan 7, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -70,12 +70,6 @@ public GceTestEnvConfig() {
SpannerOptions.newBuilder()
.setAutoThrottleAdministrativeRequests()
.setTrackTransactionStarter();
InstantiatingGrpcChannelProvider.Builder defaultChannelProviderBuilder =
InstantiatingGrpcChannelProvider.newBuilder();
if (attemptDirectPath) {
builder.setChannelProvider(
defaultChannelProviderBuilder.setEndpoint(DIRECT_PATH_ENDPOINT).build());
}
if (!projectId.isEmpty()) {
builder.setProjectId(projectId);
}
Expand All @@ -96,6 +90,16 @@ public GceTestEnvConfig() {
interceptorProvider.with(new DirectPathAddressCheckInterceptor(directPathTestScenario));
}
builder.setInterceptorProvider(interceptorProvider);
// DirectPath tests need to set a custom endpoint to the ChannelProvider
InstantiatingGrpcChannelProvider.Builder customChannelProviderBuilder =
InstantiatingGrpcChannelProvider.newBuilder();
if (attemptDirectPath) {
customChannelProviderBuilder
.setEndpoint(DIRECT_PATH_ENDPOINT)
.setAttemptDirectPath(true)
.setInterceptorProvider(interceptorProvider);
builder.setChannelProvider(customChannelProviderBuilder.build());
}
options = builder.build();
}

Expand Down