Skip to content

feat(ci): implement sharding for unit test performance - #9021

Open
bshaffer wants to merge 11 commits into
mainfrom
improve-test-performance
Open

feat(ci): implement sharding for unit test performance#9021
bshaffer wants to merge 11 commits into
mainfrom
improve-test-performance

Conversation

@bshaffer

@bshaffer bshaffer commented Jul 29, 2026

Copy link
Copy Markdown
Contributor
  • Conditional Test Sharding: Dynamically shards tests when a large number of packages are modified. Adds a job that rolls up shard results to satisfy branch protection. Uses "composite" actions to deduplicate workflow YAML between unit and windows unit tests. For what this looks like with just ONE package modified, see chore: test sharding with one package #9027

  • Run the full unit test suite: Restores triggering the full unit test suite across all packages whenever ci/ scripts change, as sharding now allows running all tests without timing out.

  • Clean CI Logs: Switches Mocha to use dot reporter and removes accidental console.log from the Firestore conformance tests.

Depends on #9061

Comment thread ci/run_conditional_tests.sh Outdated

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

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.

Code Review

This pull request parallelizes test execution and adds sharding support in the CI conditional test runner, configures the Mocha reporter and silences pnpm installation in the single test runner, and updates mock discovery URLs in the googleapis-common tests. A critical syntax error was identified in the conditional test runner script, where leftover loop and conditional control structures will cause the Bash script to fail.

Comment thread ci/run_conditional_tests.sh Outdated
@bshaffer
bshaffer marked this pull request as ready for review July 30, 2026 15:12
@bshaffer
bshaffer requested review from a team as code owners July 30, 2026 15:12
@bshaffer bshaffer changed the title feat(ci): improve test performance feat(ci): improve test performance, fix failing tests Jul 30, 2026
@bshaffer

Copy link
Copy Markdown
Contributor Author

@gemini-code-assist review

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

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.

Code Review

This pull request introduces test sharding and dynamic matrix generation for GitHub Actions in the CI scripts, updates pnpm install flags, and transitions from the deprecated url.parse to the standard URL API. Additionally, it increases test timeouts, skips certain tests on Windows, handles nested error causes in gcp-metadata, and ensures startTime does not exceed endTime in Bigtable metrics. Feedback focuses on improving shell script robustness by quoting variables (BUILD_TYPE, d, and test_script) to prevent syntax or word-splitting issues, and avoiding direct mutation of the options parameter in the OpenTelemetry test stub.

Comment thread ci/run_conditional_tests.sh Outdated
Comment thread ci/run_conditional_tests.sh Outdated
Comment thread handwritten/bigtable/test/metrics-collector/gcp-metrics-handler.ts

@westarle westarle left a comment

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.

A few comments, I think this is a really great idea!

Comment thread ci/run_conditional_tests.sh
Comment thread ci/run_conditional_tests.sh Outdated
Comment thread handwritten/bigtable/protos/protos.js
Comment thread .github/workflows/presubmit.yaml Outdated
Comment thread core/dev-packages/pack-n-play/test/test.ts Outdated
Comment thread ci/run_single_test.sh Outdated

@westarle westarle left a comment

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.

Also, would you be OK with breaking the test fixes out to their own little PRs?

@bshaffer bshaffer changed the title feat(ci): improve test performance, fix failing tests feat(ci): improve test performance Jul 31, 2026
@bshaffer
bshaffer force-pushed the improve-test-performance branch 2 times, most recently from 0e8030b to 8015ceb Compare August 1, 2026 22:40
@bshaffer
bshaffer requested a review from a team as a code owner August 3, 2026 19:43
@bshaffer
bshaffer force-pushed the improve-test-performance branch from 657c33a to f18b9c1 Compare August 4, 2026 00:11
@bshaffer bshaffer changed the title feat(ci): improve test performance feat(ci): implement sharding for unit test performance Aug 4, 2026
chore(ci): reduce unit-test output due to log truncation
chore: run all ci tests
@bshaffer
bshaffer force-pushed the improve-test-performance branch from f18b9c1 to 66743ae Compare August 4, 2026 17:05
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.

2 participants