Skip to content

test: run the bigtable system tests in google cloud build#8246

Draft
danieljbruce wants to merge 35 commits into
mainfrom
migrate-bigtable-to-gcp-cloud-build-3
Draft

test: run the bigtable system tests in google cloud build#8246
danieljbruce wants to merge 35 commits into
mainfrom
migrate-bigtable-to-gcp-cloud-build-3

Conversation

@danieljbruce
Copy link
Copy Markdown
Contributor

Description

This pull request adds a yaml file to instruct the Bigtable system test CI check to work with the new Cloud Build trigger thereby making the new CI check effectively run our system tests. It also includes minor code modifications to the Bigtable handwritten layer that allow the system tests to operate properly in the new Cloud Build Environment.

Impact

Leverages the strengths of running system tests in GCB rather than relying on kokoro for system tests.

Testing

This pull request tells the tests how to work with the new check to the continuous integration pipeline for the Bigtable system tests thus improves the effectiveness of that test.

image

Next Steps

  1. Merge a pull request that removes the system tests from kokoro. This should be done in a separate pull request to separate the concerns of removing the kokoro system tests from adding the Google Cloud Build system tests.
  2. Distribute a document detailing the process for migrating system tests from kokoro to GCB for all handwritten libraries.

danieljbruce and others added 30 commits May 6, 2026 10:48
Copy link
Copy Markdown
Contributor

@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 introduces a new Cloud Build configuration for Bigtable and addresses build-related issues in the tabular API surface and pack-n-play tests. Key changes include defining a local type for backoff settings to avoid problematic imports from google-gax and updating the pack-n-play test configuration to ensure proper dependency resolution. The review feedback suggests improving the Cloud Build configuration by avoiding runtime npm modifications, removing hardcoded project IDs, and optimizing build timeouts. Additionally, the reviewer recommends renaming the newly introduced type to 'BackoffSettings' to improve code clarity and consistency.

Comment on lines +26 to +27
npm install -g npm@latest
npm config set prefix /usr/local
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Updating npm to the latest version and changing the global prefix in every build can lead to non-deterministic behavior and increased build times. It is generally recommended to use the version of npm provided by the builder image to ensure consistency across builds. If a newer version of Node.js or npm is required, consider using a specific image tag (e.g., node:18) instead of modifying the environment at runtime. This aligns with the repository's support for Node.js v18+.

References
  1. Use of APIs available in Node.js v18+ is permitted as older versions are not supported across the repository.

# Define a substitution variable for your project ID
# Replace 'long-door-651' with the actual GCP Project ID your system tests should run against.
substitutions:
_GCP_PROJECT_ID: 'long-door-651'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The project ID long-door-651 is hardcoded in the substitutions. This makes the configuration less portable. Consider using a more generic placeholder or relying on the ${PROJECT_ID} environment variable if the tests are intended to run in the project hosting the build. If this is a dedicated test project, it's better to manage this value via Cloud Build trigger substitutions rather than hardcoding it in the YAML file.

  _GCP_PROJECT_ID: 'your-project-id'

substitutions:
_GCP_PROJECT_ID: 'long-door-651'

timeout: '10800s'
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The timeout of 10800s (3 hours) is exceptionally long. Unless the Bigtable system tests are known to take several hours, it is safer to set a lower timeout (e.g., 3600s for 1 hour) to prevent runaway builds from consuming excessive resources in case of a hang.

timeout: '3600s'

Comment on lines +40 to +43
// StrictLongRunningType introduces a type equal to BackoffSettings so that we
// don't have to reach into the gax folder of build which is causing pack and
// play errors.
type StrictLongRunningType = NonNullable<CallOptions['longrunning']>;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The name StrictLongRunningType is somewhat confusing as these settings are used for general backoff/retry logic, not just long-running operations. Since this type is intended to replace the BackoffSettings import, consider naming it BackoffSettings locally. This would also reduce the number of changes needed in the rest of the file.

Suggested change
// StrictLongRunningType introduces a type equal to BackoffSettings so that we
// don't have to reach into the gax folder of build which is causing pack and
// play errors.
type StrictLongRunningType = NonNullable<CallOptions['longrunning']>;
// BackoffSettings is defined here using CallOptions to avoid reaching into
// the gax folder of build which is causing pack and play errors.
type BackoffSettings = NonNullable<CallOptions['longrunning']>;

export const IGNORED_STATUS_CODES = new Set([1]);

export const DEFAULT_BACKOFF_SETTINGS: BackoffSettings = {
export const DEFAULT_BACKOFF_SETTINGS: StrictLongRunningType = {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Use the more descriptive BackoffSettings type name if the suggestion to rename StrictLongRunningType is accepted.

Suggested change
export const DEFAULT_BACKOFF_SETTINGS: StrictLongRunningType = {
export const DEFAULT_BACKOFF_SETTINGS: BackoffSettings = {

export function getNextDelay(
numConsecutiveErrors: number,
config: BackoffSettings,
config: StrictLongRunningType,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Use the more descriptive BackoffSettings type name if the suggestion to rename StrictLongRunningType is accepted.

Suggested change
config: StrictLongRunningType,
config: BackoffSettings,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant