Skip to content

Commit

Permalink
fix: change clusterId in Cmek test (#716)
Browse files Browse the repository at this point in the history
* fix: change clusterId in Cmek test

Change-Id: Idc8ad885205190374b089349ee94cc627bafd782

* refactor: add some logging

Change-Id: I8d0ce18de5fa8e914344340850786930fbd670f1
  • Loading branch information
ad548 committed Apr 9, 2021
1 parent dfc2efd commit 67ef155
Showing 1 changed file with 6 additions and 1 deletion.
Expand Up @@ -70,6 +70,7 @@ public class BigtableCmekIT {
private static String instanceId;
private static String clusterId1;
private static String clusterId2;
private static String clusterId3;
private static String kmsKeyName;
private static List<String> zones;
private static String otherZone;
Expand All @@ -91,6 +92,7 @@ public static void validatePlatform() throws IOException {
instanceId = AbstractTestEnv.TEST_INSTANCE_PREFIX + Instant.now().getEpochSecond();
clusterId1 = instanceId + "-c1";
clusterId2 = instanceId + "-c2";
clusterId3 = instanceId + "-c3";
zones = testEnvRule.env().getMultipleZonesInSameRegion();
otherZone =
Sets.difference(
Expand All @@ -110,6 +112,7 @@ public static void validatePlatform() throws IOException {
.setInstanceId(instanceId)
.build());

LOGGER.info("Creating cluster in zone: " + zones.get(0));
instanceAdmin.createInstance(
CreateInstanceRequest.of(instanceId)
.addCmekCluster(clusterId1, zones.get(0), 1, StorageType.SSD, kmsKeyName));
Expand Down Expand Up @@ -137,6 +140,7 @@ public void instanceAndClusterTest() {
Cluster cluster = instanceAdmin.getCluster(instanceId, clusterId1);
assertThat(cluster.getKmsKeyName()).isEqualTo(kmsKeyName);

LOGGER.info("Creating cluster in zone: " + zones.get(1));
instanceAdmin.createCluster(
CreateClusterRequest.of(instanceId, clusterId2)
.setZone(zones.get(1))
Expand All @@ -147,9 +151,10 @@ public void instanceAndClusterTest() {
Cluster secondCluster = instanceAdmin.getCluster(instanceId, clusterId2);
assertThat(secondCluster.getKmsKeyName()).isEqualTo(kmsKeyName);

LOGGER.info("Trying to create cluster in zone: " + otherZone);
try {
instanceAdmin.createCluster(
CreateClusterRequest.of(instanceId, clusterId2)
CreateClusterRequest.of(instanceId, clusterId3)
.setZone(otherZone)
.setServeNodes(1)
.setStorageType(StorageType.SSD)
Expand Down

0 comments on commit 67ef155

Please sign in to comment.