ci(bun): enable Bun runtime unit tests for handwritten libraries - #9484
Open
danieljbruce wants to merge 90 commits into
Open
danieljbruce wants to merge 90 commits into
danieljbruce wants to merge 90 commits into
Conversation
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.
…gnal timeout override
…ogging-bunyan, logging-winston, pubsub, spanner, spanner-driver, and storage
…into bun-runtime/1-test-runner-handwritten-libraries # Conflicts: # core/packages/gax/.mocharc.js
This reverts commit 5a29104.
This reverts commit c9446ab.
…ps://github.com/googleapis/google-cloud-node into bun-runtime/1-test-runner-handwritten-libraries
This reverts commit 4c4a74d.
…ime" This reverts commit 486a301.
…bun runtime"" This reverts commit 687e386.
This reverts commit 756cc45.
…into bun-runtime/1-test-runner-handwritten-libraries-2
…ttps://github.com/googleapis/google-cloud-node into bun-runtime/1-test-runner-handwritten-libraries-2
…th bun tests instead
…gging, logging-bunyan, logging-winston, pubsub, spanner, spanner-driver, and storage" This reverts commit 8088cf4.
… solely via test files
…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>
…ttps://github.com/googleapis/google-cloud-node into bun-runtime/1-test-runner-handwritten-libraries-4-1
…ttps://github.com/googleapis/google-cloud-node into bun-runtime/1-test-runner-handwritten-libraries-4-1
…-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.
…ns and preserve custom properties
…runner-handwritten-libraries-4-1 # Conflicts: # bin/proxyquire-bun-shim.cjs
… assert.deepStrictEqual shim
…saction observability test
Contributor
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #9460 and #9396.
Summary
Updates the continuous integration pipeline (
ci/run_conditional_tests.sh) to includehandwritten/*libraries alongsidepackages/*andcore/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: Addshandwrittento thesubdirsarray whenJS_RUNTIME == "bun"orTEST_CMD == *bun*, enabling real Bun runtime execution for all handwritten libraries in CI now that their test runner migrations (concluding with#9460) are complete.