-
Notifications
You must be signed in to change notification settings - Fork 440
ci(bigtable): update cluster location formatting in integration test #16033
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -123,11 +123,13 @@ TEST_F(InstanceAdminIntegrationTest, ListAllClustersTest) { | |
| auto const id_2 = RandomInstanceId(generator_); | ||
| auto const name_1 = bigtable::InstanceName(project_id_, id_1); | ||
| auto const name_2 = bigtable::InstanceName(project_id_, id_2); | ||
| auto location_a = Location(Project(project_id_), zone_a_); | ||
| auto location_b = Location(Project(project_id_), zone_b_); | ||
|
|
||
| auto config_1 = IntegrationTestConfig( | ||
| id_1, zone_a_, bigtable::InstanceConfig::PRODUCTION, 3); | ||
| id_1, location_a.FullName(), bigtable::InstanceConfig::PRODUCTION, 3); | ||
| auto config_2 = IntegrationTestConfig( | ||
| id_2, zone_b_, bigtable::InstanceConfig::PRODUCTION, 3); | ||
| id_2, location_b.FullName(), bigtable::InstanceConfig::PRODUCTION, 3); | ||
|
|
||
| auto create_request_1 = config_1.as_proto(); | ||
| create_request_1.set_parent(Project(project_id_).FullName()); | ||
|
|
@@ -163,7 +165,8 @@ TEST_F(InstanceAdminIntegrationTest, CreateListGetDeleteAppProfile) { | |
| auto const instance_id = RandomInstanceId(generator_); | ||
| auto const instance_name = bigtable::InstanceName(project_id_, instance_id); | ||
|
|
||
| auto config = IntegrationTestConfig(instance_id, zone_a_, | ||
| auto location = Location(Project(project_id_), zone_a_); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This variable is not modified after initialization and should be declared auto const location = Location(Project(project_id_), zone_a_);References
|
||
| auto config = IntegrationTestConfig(instance_id, location.FullName(), | ||
| bigtable::InstanceConfig::PRODUCTION, 3); | ||
| auto create_request = config.as_proto(); | ||
| create_request.set_parent(Project(project_id_).FullName()); | ||
|
|
@@ -268,7 +271,8 @@ TEST_F(InstanceAdminIntegrationTest, CreateListGetDeleteInstanceTest) { | |
| auto const instance_name = bigtable::InstanceName(project_id_, instance_id); | ||
|
|
||
| // Create instance | ||
| auto config = IntegrationTestConfig(instance_id, zone_a_); | ||
| auto location = Location(Project(project_id_), zone_a_); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This variable is not modified after initialization and should be declared auto const location = Location(Project(project_id_), zone_a_);References
|
||
| auto config = IntegrationTestConfig(instance_id, location.FullName()); | ||
| auto create_request = config.as_proto(); | ||
| create_request.set_parent(Project(project_id_).FullName()); | ||
| auto instance = instance_admin_->CreateInstance(create_request).get(); | ||
|
|
@@ -328,18 +332,20 @@ TEST_F(InstanceAdminIntegrationTest, CreateListGetDeleteClusterTest) { | |
| auto const cluster_id = instance_id + "-cl2"; | ||
| auto const cluster_name = | ||
| bigtable::ClusterName(project_id_, instance_id, cluster_id); | ||
| auto location_a = Location(Project(project_id_), zone_a_); | ||
| auto location_b = Location(Project(project_id_), zone_b_); | ||
|
Comment on lines
+335
to
+336
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These variables are not modified after initialization and should be declared auto const location_a = Location(Project(project_id_), zone_a_);
auto const location_b = Location(Project(project_id_), zone_b_);References
|
||
|
|
||
| // Create instance prerequisites for cluster operations | ||
| auto config = IntegrationTestConfig(instance_id, zone_a_, | ||
| auto config = IntegrationTestConfig(instance_id, location_a.FullName(), | ||
| bigtable::InstanceConfig::PRODUCTION, 3); | ||
| auto create_request = config.as_proto(); | ||
| create_request.set_parent(Project(project_id_).FullName()); | ||
| auto instance = instance_admin_->CreateInstance(create_request).get(); | ||
| ASSERT_STATUS_OK(instance); | ||
|
|
||
| // Create cluster | ||
| auto cluster_config = | ||
| bigtable::ClusterConfig(zone_b_, 3, bigtable::ClusterConfig::HDD); | ||
| auto cluster_config = bigtable::ClusterConfig(location_b.FullName(), 3, | ||
| bigtable::ClusterConfig::HDD); | ||
|
Comment on lines
+347
to
+348
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This variable is not modified after initialization and should be declared auto const cluster_config = bigtable::ClusterConfig(location_b.FullName(), 3,
bigtable::ClusterConfig::HDD);References
|
||
| auto cluster = | ||
| instance_admin_ | ||
| ->CreateCluster(instance_name, cluster_id, cluster_config.as_proto()) | ||
|
|
@@ -387,8 +393,9 @@ TEST_F(InstanceAdminIntegrationTest, SetGetTestIamNativeAPIsTest) { | |
| auto const instance_id = RandomInstanceId(generator_); | ||
| auto const instance_name = InstanceName(project_id_, instance_id); | ||
|
|
||
| auto location = Location(Project(project_id_), zone_a_); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This variable is not modified after initialization and should be declared auto const location = Location(Project(project_id_), zone_a_);References
|
||
| // create instance prerequisites for cluster operations | ||
| auto config = IntegrationTestConfig(instance_id, zone_a_, | ||
| auto config = IntegrationTestConfig(instance_id, location.FullName(), | ||
| bigtable::InstanceConfig::PRODUCTION, 3); | ||
| auto create_request = config.as_proto(); | ||
| create_request.set_parent(Project(project_id_).FullName()); | ||
|
|
@@ -436,7 +443,8 @@ TEST_F(InstanceAdminIntegrationTest, | |
| auto const zone_b = Location(project.FullName(), zone_b_); | ||
|
|
||
| // Create instance | ||
| auto config = IntegrationTestConfig(instance_id, zone_a_); | ||
| auto location = Location(Project(project_id_), zone_a_); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This variable is not modified after initialization and should be declared auto const location = Location(Project(project_id_), zone_a_);References
|
||
| auto config = IntegrationTestConfig(instance_id, location.FullName()); | ||
| auto create_request = config.as_proto(); | ||
| create_request.set_parent(project.FullName()); | ||
| auto instance = instance_admin->CreateInstance(create_request).get(); | ||
|
|
@@ -508,8 +516,9 @@ TEST_F(InstanceAdminIntegrationTest, CustomWorkers) { | |
|
|
||
| // CompletionQueue `cq` is not being `Run()`, so this should never finish. | ||
| auto const instance_id = RandomInstanceId(generator_); | ||
| auto location = Location(Project(project_id_), zone_a_); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This variable is not modified after initialization and should be declared auto const location = Location(Project(project_id_), zone_a_);References
|
||
| auto create_request = | ||
| IntegrationTestConfig(instance_id, zone_a_, | ||
| IntegrationTestConfig(instance_id, location.FullName(), | ||
| bigtable::InstanceConfig::PRODUCTION, 3) | ||
| .as_proto(); | ||
| create_request.set_parent(Project(project_id_).FullName()); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These variables are not modified after initialization and should be declared
constto improve code clarity and prevent accidental modification.References
constfor variables that are not modified after initialization to improve code clarity and prevent accidental modification. (link)