Skip to content

Commit

Permalink
chore: use prod endpoint for directpath tests (#119)
Browse files Browse the repository at this point in the history
* chore: use prod endpoint for directpath tests

* oops

* use client default endpoints by default

* collapse empty xml nodes
  • Loading branch information
igorbernstein2 committed Dec 17, 2019
1 parent c106497 commit 12169d6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
12 changes: 6 additions & 6 deletions google-cloud-bigtable/pom.xml
Expand Up @@ -22,12 +22,12 @@
<skipTests>false</skipTests>
<skipUnitTests>${skipTests}</skipUnitTests>

<bigtable.cfe-data-endpoint>bigtable.googleapis.com:443</bigtable.cfe-data-endpoint>
<bigtable.cfe-admin-endpoint>bigtableadmin.googleapis.com:443</bigtable.cfe-admin-endpoint>

<!-- Use test DP env until prod endpoint is available -->
<bigtable.directpath-data-endpoint>testdirectpath-bigtable.sandbox.googleapis.com:443</bigtable.directpath-data-endpoint>
<bigtable.directpath-admin-endpoint>test-bigtableadmin.sandbox.googleapis.com:443</bigtable.directpath-admin-endpoint>
<!-- Use client defined default endpoints -->
<!-- Can be overriden on the commandline via `-Dbigtable.cfe-data-endpoint=bigtableadmin.googleapis.com:443` -->
<bigtable.cfe-data-endpoint/>
<bigtable.cfe-admin-endpoint/>
<bigtable.directpath-data-endpoint/>
<bigtable.directpath-admin-endpoint/>
</properties>
<dependencies>
<!-- NOTE: Dependencies are organized into two groups, production and test.
Expand Down
Expand Up @@ -22,6 +22,7 @@
import com.google.cloud.bigtable.data.v2.BigtableDataClient;
import com.google.cloud.bigtable.data.v2.BigtableDataSettings;
import com.google.common.base.MoreObjects;
import com.google.common.base.Strings;
import java.io.IOException;
import javax.annotation.Nullable;

Expand Down Expand Up @@ -57,8 +58,8 @@ class CloudEnv extends AbstractTestEnv {

static CloudEnv fromSystemProperties() {
return new CloudEnv(
getOptionalProperty(DATA_ENDPOINT_PROPERTY_NAME, "bigtable.googleapis.com:443"),
getOptionalProperty(ADMIN_ENDPOINT_PROPERTY_NAME, "bigtableadmin.googleapis.com:443"),
getOptionalProperty(DATA_ENDPOINT_PROPERTY_NAME, ""),
getOptionalProperty(ADMIN_ENDPOINT_PROPERTY_NAME, ""),
getRequiredProperty(PROJECT_PROPERTY_NAME),
getRequiredProperty(INSTANCE_PROPERTY_NAME),
getRequiredProperty(TABLE_PROPERTY_NAME));
Expand All @@ -76,18 +77,18 @@ private CloudEnv(

this.dataSettings =
BigtableDataSettings.newBuilder().setProjectId(projectId).setInstanceId(instanceId);
if (dataEndpoint != null) {
if (!Strings.isNullOrEmpty(dataEndpoint)) {
dataSettings.stubSettings().setEndpoint(dataEndpoint);
}

this.tableAdminSettings =
BigtableTableAdminSettings.newBuilder().setProjectId(projectId).setInstanceId(instanceId);
if (adminEndpoint != null) {
if (!Strings.isNullOrEmpty(adminEndpoint)) {
this.tableAdminSettings.stubSettings().setEndpoint(adminEndpoint);
}

this.instanceAdminSettings = BigtableInstanceAdminSettings.newBuilder().setProjectId(projectId);
if (adminEndpoint != null) {
if (!Strings.isNullOrEmpty(adminEndpoint)) {
this.instanceAdminSettings.stubSettings().setEndpoint(adminEndpoint);
}
}
Expand Down

0 comments on commit 12169d6

Please sign in to comment.