Skip to content

ci(bigtable): update cluster location formatting in integration test#16033

Merged
scotthart merged 1 commit intogoogleapis:mainfrom
scotthart:bigtable_instance_admin_test_daily
Mar 6, 2026
Merged

ci(bigtable): update cluster location formatting in integration test#16033
scotthart merged 1 commit intogoogleapis:mainfrom
scotthart:bigtable_instance_admin_test_daily

Conversation

@scotthart
Copy link
Member

Cluster names in the instance admin integration test were not being formatted properly after switching to the generated client.

@scotthart scotthart requested a review from a team as a code owner March 6, 2026 15:39
@product-auto-label product-auto-label bot added the api: bigtable Issues related to the Bigtable API. label Mar 6, 2026
@gemini-code-assist
Copy link

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses an issue in the Bigtable instance admin integration tests where cluster location names were not being formatted correctly. The changes ensure that all relevant test cases now properly construct full resource names for zones using the Location object, which is essential for compatibility with the recently switched-to generated client. This fix enhances the reliability and correctness of the integration test suite by resolving these formatting discrepancies.

Highlights

  • Integration Test Fix: Corrected the formatting of cluster location strings within the Bigtable instance admin integration tests.
  • API Usage Update: Updated IntegrationTestConfig and bigtable::ClusterConfig calls to use Location(...).FullName() for specifying zones, aligning with the generated client's expected format.
Changelog
  • google/cloud/bigtable/tests/instance_admin_integration_test.cc
    • Updated ListAllClustersTest to use Location objects for zone parameters in IntegrationTestConfig.
    • Modified CreateListGetDeleteAppProfile to correctly format the zone using Location for instance creation.
    • Adjusted CreateListGetDeleteInstanceTest to use Location for zone specification in instance configuration.
    • Updated CreateListGetDeleteClusterTest to format both instance and cluster zones with Location.
    • Changed SetGetTestIamNativeAPIsTest to use Location for the instance zone in IntegrationTestConfig.
    • Updated InstanceAdminIntegrationTest.UpdateInstance to use Location for the instance zone.
    • Modified CustomWorkers test to use Location for the instance zone in IntegrationTestConfig.
Activity
  • No specific activity has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the integration tests to correctly format cluster location names by using Location::FullName(). The changes are correct and address the issue described. I've kept all comments as they suggest marking variables that are not modified after initialization as const, which is a good practice for readability and safety, and aligns with the Google C++ Style Guide. None of the provided rules contradicted or directly covered these comments, so they remain unchanged.

Comment on lines +126 to +127
auto location_a = Location(Project(project_id_), zone_a_);
auto location_b = Location(Project(project_id_), zone_b_);

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


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

Comment on lines +335 to +336
auto location_a = Location(Project(project_id_), zone_a_);
auto location_b = Location(Project(project_id_), zone_b_);

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)

Comment on lines +347 to +348
auto cluster_config = bigtable::ClusterConfig(location_b.FullName(), 3,
bigtable::ClusterConfig::HDD);

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


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

@codecov
Copy link

codecov bot commented Mar 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.64%. Comparing base (eea3715) to head (360c3b4).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #16033      +/-   ##
==========================================
- Coverage   92.64%   92.64%   -0.01%     
==========================================
  Files        2335     2335              
  Lines      214792   214802      +10     
==========================================
+ Hits       198986   198995       +9     
- Misses      15806    15807       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@scotthart scotthart enabled auto-merge (squash) March 6, 2026 19:20
@scotthart scotthart merged commit 654d9c4 into googleapis:main Mar 6, 2026
57 of 64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigtable Issues related to the Bigtable API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants