Skip to content

Commit 654d9c4

Browse files
authored
ci(bigtable): update cluster location formatting in integration test (#16033)
1 parent eea3715 commit 654d9c4

1 file changed

Lines changed: 19 additions & 10 deletions

File tree

google/cloud/bigtable/tests/instance_admin_integration_test.cc

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,13 @@ TEST_F(InstanceAdminIntegrationTest, ListAllClustersTest) {
123123
auto const id_2 = RandomInstanceId(generator_);
124124
auto const name_1 = bigtable::InstanceName(project_id_, id_1);
125125
auto const name_2 = bigtable::InstanceName(project_id_, id_2);
126+
auto location_a = Location(Project(project_id_), zone_a_);
127+
auto location_b = Location(Project(project_id_), zone_b_);
126128

127129
auto config_1 = IntegrationTestConfig(
128-
id_1, zone_a_, bigtable::InstanceConfig::PRODUCTION, 3);
130+
id_1, location_a.FullName(), bigtable::InstanceConfig::PRODUCTION, 3);
129131
auto config_2 = IntegrationTestConfig(
130-
id_2, zone_b_, bigtable::InstanceConfig::PRODUCTION, 3);
132+
id_2, location_b.FullName(), bigtable::InstanceConfig::PRODUCTION, 3);
131133

132134
auto create_request_1 = config_1.as_proto();
133135
create_request_1.set_parent(Project(project_id_).FullName());
@@ -163,7 +165,8 @@ TEST_F(InstanceAdminIntegrationTest, CreateListGetDeleteAppProfile) {
163165
auto const instance_id = RandomInstanceId(generator_);
164166
auto const instance_name = bigtable::InstanceName(project_id_, instance_id);
165167

166-
auto config = IntegrationTestConfig(instance_id, zone_a_,
168+
auto location = Location(Project(project_id_), zone_a_);
169+
auto config = IntegrationTestConfig(instance_id, location.FullName(),
167170
bigtable::InstanceConfig::PRODUCTION, 3);
168171
auto create_request = config.as_proto();
169172
create_request.set_parent(Project(project_id_).FullName());
@@ -268,7 +271,8 @@ TEST_F(InstanceAdminIntegrationTest, CreateListGetDeleteInstanceTest) {
268271
auto const instance_name = bigtable::InstanceName(project_id_, instance_id);
269272

270273
// Create instance
271-
auto config = IntegrationTestConfig(instance_id, zone_a_);
274+
auto location = Location(Project(project_id_), zone_a_);
275+
auto config = IntegrationTestConfig(instance_id, location.FullName());
272276
auto create_request = config.as_proto();
273277
create_request.set_parent(Project(project_id_).FullName());
274278
auto instance = instance_admin_->CreateInstance(create_request).get();
@@ -328,18 +332,20 @@ TEST_F(InstanceAdminIntegrationTest, CreateListGetDeleteClusterTest) {
328332
auto const cluster_id = instance_id + "-cl2";
329333
auto const cluster_name =
330334
bigtable::ClusterName(project_id_, instance_id, cluster_id);
335+
auto location_a = Location(Project(project_id_), zone_a_);
336+
auto location_b = Location(Project(project_id_), zone_b_);
331337

332338
// Create instance prerequisites for cluster operations
333-
auto config = IntegrationTestConfig(instance_id, zone_a_,
339+
auto config = IntegrationTestConfig(instance_id, location_a.FullName(),
334340
bigtable::InstanceConfig::PRODUCTION, 3);
335341
auto create_request = config.as_proto();
336342
create_request.set_parent(Project(project_id_).FullName());
337343
auto instance = instance_admin_->CreateInstance(create_request).get();
338344
ASSERT_STATUS_OK(instance);
339345

340346
// Create cluster
341-
auto cluster_config =
342-
bigtable::ClusterConfig(zone_b_, 3, bigtable::ClusterConfig::HDD);
347+
auto cluster_config = bigtable::ClusterConfig(location_b.FullName(), 3,
348+
bigtable::ClusterConfig::HDD);
343349
auto cluster =
344350
instance_admin_
345351
->CreateCluster(instance_name, cluster_id, cluster_config.as_proto())
@@ -387,8 +393,9 @@ TEST_F(InstanceAdminIntegrationTest, SetGetTestIamNativeAPIsTest) {
387393
auto const instance_id = RandomInstanceId(generator_);
388394
auto const instance_name = InstanceName(project_id_, instance_id);
389395

396+
auto location = Location(Project(project_id_), zone_a_);
390397
// create instance prerequisites for cluster operations
391-
auto config = IntegrationTestConfig(instance_id, zone_a_,
398+
auto config = IntegrationTestConfig(instance_id, location.FullName(),
392399
bigtable::InstanceConfig::PRODUCTION, 3);
393400
auto create_request = config.as_proto();
394401
create_request.set_parent(Project(project_id_).FullName());
@@ -436,7 +443,8 @@ TEST_F(InstanceAdminIntegrationTest,
436443
auto const zone_b = Location(project.FullName(), zone_b_);
437444

438445
// Create instance
439-
auto config = IntegrationTestConfig(instance_id, zone_a_);
446+
auto location = Location(Project(project_id_), zone_a_);
447+
auto config = IntegrationTestConfig(instance_id, location.FullName());
440448
auto create_request = config.as_proto();
441449
create_request.set_parent(project.FullName());
442450
auto instance = instance_admin->CreateInstance(create_request).get();
@@ -508,8 +516,9 @@ TEST_F(InstanceAdminIntegrationTest, CustomWorkers) {
508516

509517
// CompletionQueue `cq` is not being `Run()`, so this should never finish.
510518
auto const instance_id = RandomInstanceId(generator_);
519+
auto location = Location(Project(project_id_), zone_a_);
511520
auto create_request =
512-
IntegrationTestConfig(instance_id, zone_a_,
521+
IntegrationTestConfig(instance_id, location.FullName(),
513522
bigtable::InstanceConfig::PRODUCTION, 3)
514523
.as_proto();
515524
create_request.set_parent(Project(project_id_).FullName());

0 commit comments

Comments
 (0)