Sitelet https://github.com/googleapis/google-cloud-node/pull/9439
Skip to content

fix(ci): deduplicate pnpm install in run_single_test and refine turbo compile inputs - #9439

Merged
quirogas merged 3 commits into
mainfrom
ci/shard-compile/1-workspace-test-runner
Sep 30, 2026
Merged

quirogas merged 3 commits into
mainfrom
ci/shard-compile/1-workspace-test-runner

Conversation

@quirogas

@quirogas quirogas commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

In CI, .github/actions/pnpm-lockfile-check already runs pnpm install once at the start of every job for the whole monorepo. However, ci/run_single_test.sh was still running pnpm install again inside every package directory it tested. Because the repo is now a single pnpm workspace, each of those calls re-checks the entire monorepo, which slows down test shards and causes Windows runs to time out on large PRs.

This PR updates ci/run_single_test.sh to skip pnpm install when node_modules is already installed at the root, and cleans up a few related test settings so unit tests run reliably.

What changed

  • ci/run_single_test.sh: Only run pnpm install --frozen-lockfile --ignore-scripts if node_modules/.pnpm is missing at the workspace root (for local runs). --ignore-scripts is used because most packages in the repo define "prepare": "npm run compile", which would otherwise compile the entire monorepo during install. Also lower --max_old_space_size from 6 GB to 2 GB on Windows so parallel Mocha workers don't run out of memory.
  • .npmrc: Set enable-pre-post-scripts=true so package pretest and postcompile hooks (like building pprof in cloud-profiler or copying protos in nodejs-proto-files) run automatically during pnpm compile and pnpm test.
  • turbo.json: Remove package.json from compile.inputs so editing package.json scripts or versions doesn't invalidate the TypeScript build cache for every package.
  • handwritten/firestore/.mocharc.js: Add "exit": true (matching the root .mocharc.cjs) so Mocha exits after tests finish instead of hanging on open gRPC connections.

@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 optimizes the CI test execution script by adjusting Node.js memory limits based on the operating system, optimizing dependency installation, and conditionally compiling packages using Turbo. It also updates the Mocha configuration for Firestore to force exit, adjusts Turbo compilation flags in package.json, and removes package.json from Turbo's input files. A critical issue was identified in ci/run_single_test.sh where an undefined variable 'd' is used, which should be replaced with '.' to correctly resolve the relative path.

Comment thread ci/run_single_test.sh Outdated
@quirogas
quirogas marked this pull request as draft September 23, 2026 23:33
@quirogas
quirogas added this pull request to stack #9441 September 23, 2026 23:39
@quirogas
quirogas force-pushed the ci/shard-compile/1-workspace-test-runner branch from 7dff363 to dd2f9f0 Compare September 23, 2026 23:49
@quirogas
quirogas marked this pull request as ready for review September 24, 2026 01:03
@quirogas
quirogas removed request for a team and danieljbruce September 24, 2026 01:05
@quirogas
quirogas force-pushed the ci/shard-compile/1-workspace-test-runner branch from dd2f9f0 to 6d9fc42 Compare September 24, 2026 01:06
Comment thread ci/run_single_test.sh Outdated
@quirogas
quirogas force-pushed the ci/shard-compile/1-workspace-test-runner branch from 6d9fc42 to d15e849 Compare September 29, 2026 00:11
@quirogas
quirogas requested a review from bshaffer September 29, 2026 06:25
@quirogas
quirogas force-pushed the ci/shard-compile/1-workspace-test-runner branch 3 times, most recently from 32be41d to 2f902a5 Compare September 30, 2026 16:53
Comment thread ci/run_single_test.sh
@quirogas
quirogas requested a review from bshaffer September 30, 2026 17:35
@quirogas
quirogas force-pushed the ci/shard-compile/1-workspace-test-runner branch from 87b85ec to 7032f6f Compare September 30, 2026 17:36
@quirogas
quirogas force-pushed the ci/shard-compile/1-workspace-test-runner branch from 7032f6f to 3bc52d9 Compare September 30, 2026 20:27
@quirogas
quirogas merged commit 102b3f6 into main Sep 30, 2026
65 of 71 checks passed
@quirogas
quirogas deleted the ci/shard-compile/1-workspace-test-runner branch September 30, 2026 20:52
feywind pushed a commit that referenced this pull request Oct 1, 2026
🤖 I have created a release *beep* *boop*
---


##
[9.3.1](firestore-v9.3.0...firestore-v9.3.1)
(2026-10-01)


### Bug Fixes

* **ci:** Deduplicate pnpm install in run_single_test and refine turbo
compile inputs
([#9439](#9439))
([102b3f6](102b3f6))
* **firestore:** Unblock Cloud RAD docs generation
([#9474](#9474))
([5f580f0](5f580f0))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
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