test: run the bigquery-storage system tests in google cloud build#8697
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a Cloud Build configuration (cloudbuild.yaml) for the handwritten/bigquery-storage directory to automate Node.js environment setup, dependency installation, system test execution, and optional code coverage reporting. The reviewer suggested a more robust way to check for and execute the nyc coverage tool using npx --no-install instead of relying on fragile internal paths.
| # Check if nyc is installed and run report | ||
| 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 | ||
| else | ||
| echo "nyc not found, skipping coverage report." | ||
| fi |
There was a problem hiding this comment.
Relying on the internal path ./node_modules/nyc/bin/nyc.js is fragile as the internal directory structure of the nyc package is an implementation detail and can change between versions. Using npx --no-install is a more robust and standard way to check for and execute local CLI tools.
# Check if nyc is installed and run report
if npx --no-install nyc --version >/dev/null 2>&1; then
npx nyc report || true
else
echo "nyc not found, skipping coverage report."
fiThere was a problem hiding this comment.
As with the other tests, I think it is better here if we stay in alignment with how the kokoro tests worked.
Description
This pull request adds a yaml file to instruct the Bigquery Storage system test CI check to work with the new Cloud Build trigger thereby making the new CI check effectively run our system tests. It turns out that no extra code modifications are required to allow the test to run in the new 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 Bigquery Storage system tests thus improves the effectiveness of that test.
Next Steps