Skip to content

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

Closed
danieljbruce wants to merge 35 commits into
mainfrom
migrate-bigtable-to-gcp-cloud-build-4
Closed

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

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
@danieljbruce danieljbruce changed the title Migrate bigtable to gcp cloud build 4 test: run the bigtable system tests in google cloud build May 11, 2026
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 Cloud Build configuration for Bigtable system tests and refactors the tabular-api-surface.ts file to avoid importing from internal google-gax paths by defining a local StrictLongRunningType. It also fixes pack-n-play test issues by adding necessary node type references. Feedback includes recommendations to avoid global npm updates in CI, use standard binary paths for nyc, remove hardcoded project IDs, reduce build timeouts, and export the newly created type for external visibility.

Comment on lines +25 to +29
if [ -f /workspace/skip_tests ]; then exit 0; fi
npm install -g npm@latest
npm config set prefix /usr/local
npm install
npm run presystem-test
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 globally and changing the configuration prefix in a CI environment is generally discouraged as it can lead to non-deterministic builds and potential permission issues. The gcr.io/cloud-builders/npm image should already provide a functional npm version. If a specific version of Node.js or npm is required, it is better to use a specific image tag or pin the version explicitly.

    if [ -f /workspace/skip_tests ]; then exit 0; fi
    npm install
    npm run presystem-test

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

On the other PR I committed a code change to fix the node version.

Comment on lines +71 to +72
if [ -f ./node_modules/nyc/bin/nyc.js ]; then
./node_modules/nyc/bin/nyc.js report || true # `|| true` prevents build failure if nyc report itself exits non-zero
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

Avoid reaching into the internal directory structure of a package to execute its binary. It is more robust to use the binary located in node_modules/.bin/ or use npx.

    if [ -f ./node_modules/.bin/nyc ]; then
      ./node_modules/.bin/nyc report || true # || true prevents build failure if nyc report itself exits non-zero

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Maybe, but not a serious issue since the old scripts did it this way anyways.

# 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

Hardcoding a specific GCP Project ID (long-door-651) in the configuration makes the build script less reusable and can leak internal infrastructure details. Consider using a placeholder or leaving it empty if it's intended to be provided via a build trigger.

  _GCP_PROJECT_ID: 'your-project-id'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This value was shared before therefore sharing the specific id has no downside.

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 is set to 10800 seconds (3 hours), which is quite high for system tests. If tests hang, this could lead to significant resource consumption. Consider reducing this to a more reasonable value (e.g., 3600s) based on the expected execution time.

timeout: '3600s'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

No. We need this much time.

// 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 type StrictLongRunningType is used in the signature of the exported function getNextDelay and the exported constant DEFAULT_BACKOFF_SETTINGS. To ensure that consumers of this library can correctly reference the type, it should also be exported.

Suggested change
type StrictLongRunningType = NonNullable<CallOptions['longrunning']>;
export type StrictLongRunningType = NonNullable<CallOptions['longrunning']>;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The constant and the function are internal

@danieljbruce
Copy link
Copy Markdown
Contributor Author

Duplicate

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