Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 19 additions & 10 deletions google/cloud/bigtable/tests/instance_admin_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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_);
Comment on lines +126 to +127

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

These variables are not modified after initialization and should be declared const to improve code clarity and prevent accidental modification.

  auto const location_a = Location(Project(project_id_), zone_a_);
  auto const location_b = Location(Project(project_id_), zone_b_);
References
  1. The Google C++ Style Guide, which this repository follows, recommends using const for variables that are not modified after initialization to improve code clarity and prevent accidental modification. (link)


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());
Expand Down Expand Up @@ -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_);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This variable is not modified after initialization and should be declared const to improve code clarity and prevent accidental modification.

  auto const location = Location(Project(project_id_), zone_a_);
References
  1. The Google C++ Style Guide, which this repository follows, recommends using const for variables that are not modified after initialization to improve code clarity and prevent accidental modification. (link)

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());
Expand Down Expand Up @@ -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_);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This variable is not modified after initialization and should be declared const to improve code clarity and prevent accidental modification.

  auto const location = Location(Project(project_id_), zone_a_);
References
  1. The Google C++ Style Guide, which this repository follows, recommends using const for variables that are not modified after initialization to improve code clarity and prevent accidental modification. (link)

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();
Expand Down Expand Up @@ -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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

These variables are not modified after initialization and should be declared const to improve code clarity and prevent accidental modification.

  auto const location_a = Location(Project(project_id_), zone_a_);
  auto const location_b = Location(Project(project_id_), zone_b_);
References
  1. The Google C++ Style Guide, which this repository follows, recommends using const for variables that are not modified after initialization to improve code clarity and prevent accidental modification. (link)


// 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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This variable is not modified after initialization and should be declared const to improve code clarity and prevent accidental modification.

  auto const cluster_config = bigtable::ClusterConfig(location_b.FullName(), 3,
                                                bigtable::ClusterConfig::HDD);
References
  1. The Google C++ Style Guide, which this repository follows, recommends using const for variables that are not modified after initialization to improve code clarity and prevent accidental modification. (link)

auto cluster =
instance_admin_
->CreateCluster(instance_name, cluster_id, cluster_config.as_proto())
Expand Down Expand Up @@ -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_);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This variable is not modified after initialization and should be declared const to improve code clarity and prevent accidental modification.

  auto const location = Location(Project(project_id_), zone_a_);
References
  1. The Google C++ Style Guide, which this repository follows, recommends using const for variables that are not modified after initialization to improve code clarity and prevent accidental modification. (link)

// 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());
Expand Down Expand Up @@ -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_);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This variable is not modified after initialization and should be declared const to improve code clarity and prevent accidental modification.

  auto const location = Location(Project(project_id_), zone_a_);
References
  1. The Google C++ Style Guide, which this repository follows, recommends using const for variables that are not modified after initialization to improve code clarity and prevent accidental modification. (link)

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();
Expand Down Expand Up @@ -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_);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This variable is not modified after initialization and should be declared const to improve code clarity and prevent accidental modification.

  auto const location = Location(Project(project_id_), zone_a_);
References
  1. The Google C++ Style Guide, which this repository follows, recommends using const for variables that are not modified after initialization to improve code clarity and prevent accidental modification. (link)

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());
Expand Down