Skip to content

ci(bun): enable Bun runtime unit tests for handwritten libraries - #9484

Open
danieljbruce wants to merge 90 commits into
mainfrom
bun-runtime/4-ci-workflow-handwritten
Open

danieljbruce wants to merge 90 commits into
mainfrom
bun-runtime/4-ci-workflow-handwritten

Conversation

@danieljbruce

Copy link
Copy Markdown
Contributor

Follow-up to #9460 and #9396.

Summary

Updates the continuous integration pipeline (ci/run_conditional_tests.sh) to include handwritten/* libraries alongside packages/* and core/packages/* when running unit tests under the Bun runtime (JS_RUNTIME=bun / TEST_CMD="bun --bun run" in .github/workflows/presubmit-bun.yml).

Details

  • ci/run_conditional_tests.sh: Adds handwritten to the subdirs array when JS_RUNTIME == "bun" or TEST_CMD == *bun*, enabling real Bun runtime execution for all handwritten libraries in CI now that their test runner migrations (concluding with #9460) are complete.

quirogas and others added 30 commits September 21, 2026 21:26
Adds bin/run-test.cjs and bin/proxyquire-bun-shim.cjs to run Mocha tests across both Node.js and Bun without breaking Node coverage or parallelism.

When invoked under Node.js, bin/run-test.cjs delegates to c8 and Mocha with worker-thread parallelism enabled. When invoked under Bun (via bun --bun or JS_RUNTIME=bun), it skips c8, disables Mocha worker threads (--no-parallel), preloads the Bun proxyquire compatibility shim, and executes Mocha directly in-process so #!/usr/bin/env node shebangs do not silently switch execution back to Node.js.
…ogging-bunyan, logging-winston, pubsub, spanner, spanner-driver, and storage
…into bun-runtime/1-test-runner-handwritten-libraries

# Conflicts:
#	core/packages/gax/.mocharc.js
…into bun-runtime/1-test-runner-handwritten-libraries-2
…gging, logging-bunyan, logging-winston, pubsub, spanner, spanner-driver, and storage"

This reverts commit 8088cf4.
danieljbruce and others added 25 commits September 28, 2026 13:47
…into bun-runtime/1-test-runner-handwritten-libraries-4-1
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
…-4' of https://github.com/googleapis/google-cloud-node into bun-runtime/1-test-runner-handwritten-libraries-4-1"

This reverts commit 334cda5, reversing
changes made to 7308937.
…runner-handwritten-libraries-4-1

# Conflicts:
#	bin/proxyquire-bun-shim.cjs
@danieljbruce
danieljbruce requested review from a team as code owners September 30, 2026 21:16
@github-actions
github-actions Bot requested a review from bshaffer September 30, 2026 21:16

@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 improves compatibility with the Bun runtime for the handwritten Spanner package. Key changes include updating the proxyquire Bun shim, adding handwritten tests to the Bun CI workflow, adopting AsyncLocalStorageContextManager where available, and wrapping test executions with a custom runner. Additionally, several tests were updated to handle Bun-specific error messages, prototype equality differences, and to fix span/event sorting using high-resolution time arrays. There are no review comments, and I have no feedback to provide.

This branch has not been deployed

No deployments
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