Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
e952549
feat(tools): add runtime-agnostic test runner and Bun mocha hooks
quirogas Sep 21, 2026
27579a0
fix(tools): compare Headers entries in deepEqual and document AbortSi…
quirogas Sep 21, 2026
93ae259
Modify all the handwritten libraries to use the new test runner
danieljbruce Sep 22, 2026
dc9e502
Change the literal values so that deep equal passes for bun
danieljbruce Sep 22, 2026
8088cf4
Revert test runner changes in firestore, google-cloud-dns, logging, l…
danieljbruce Sep 23, 2026
d208619
Merge branch 'main' of https://github.com/googleapis/google-cloud-nod…
danieljbruce Sep 23, 2026
756cc45
revert the bigtable changes
danieljbruce Sep 23, 2026
5a29104
feat(tools): add --exit flag to test runner under bun runtime
danieljbruce Sep 23, 2026
e780546
Add the stub for cloud-profiler
danieljbruce Sep 23, 2026
c9446ab
Revert "feat(tools): add --exit flag to test runner under bun runtime"
danieljbruce Sep 23, 2026
845f8d7
Reapply "feat(tools): add --exit flag to test runner under bun runtime"
danieljbruce Sep 23, 2026
4f67497
Revert changes in bigquery, bigquery-storage, datastore, and error-re…
danieljbruce Sep 23, 2026
6668550
Merge branch 'main' into bun-runtime/1-test-runner-handwritten-libraries
danieljbruce Sep 23, 2026
4c4a74d
test: fix tests for cloud-profiler library with the bun runtime
danieljbruce Sep 23, 2026
895f088
Merge branch 'bun-runtime/1-test-runner-handwritten-libraries' of htt…
danieljbruce Sep 23, 2026
486a301
Revert "test: fix tests for cloud-profiler library with the bun runtime"
danieljbruce Sep 24, 2026
687e386
Reapply "test: fix tests for cloud-profiler library with the bun runt…
danieljbruce Sep 24, 2026
1f30b9d
Revert "Reapply "test: fix tests for cloud-profiler library with the …
danieljbruce Sep 24, 2026
da1602a
Revert "revert the bigtable changes"
danieljbruce Sep 24, 2026
b6e6db1
Resolve compiler errors with datastore test
danieljbruce Sep 24, 2026
3a88414
sterilize the environment variables
danieljbruce Sep 24, 2026
8dee1fc
Merge branch 'main' of https://github.com/googleapis/google-cloud-nod…
danieljbruce Sep 24, 2026
7534a50
test: update first half of handwritten libraries to be bun compatible
danieljbruce Sep 24, 2026
f064618
Merge branch 'bun-runtime/1-test-runner-handwritten-libraries-2' of h…
danieljbruce Sep 24, 2026
90d9b6e
Revert source code changes. We can achieve what we need to achieve wi…
danieljbruce Sep 24, 2026
fa014d2
revert bigtable related changes
danieljbruce Sep 24, 2026
ec5195e
Add helpful devDependencies to resolve unit test error.
danieljbruce Sep 24, 2026
db68151
Add grpc-js to dev dependencies
danieljbruce Sep 24, 2026
da9b310
Fix the linting error with proto.ts
danieljbruce Sep 25, 2026
eeb2881
Revert "Revert test runner changes in firestore, google-cloud-dns, lo…
danieljbruce Sep 25, 2026
1ba1deb
set the instrumentation status to true
danieljbruce Sep 25, 2026
ef29c38
Added an extra comment for setting the instrumentation status
danieljbruce Sep 25, 2026
4f26692
Add comments to explain the bun runtime relationship
danieljbruce Sep 25, 2026
dc86050
Undo changes to spanner and storage
danieljbruce Sep 25, 2026
33705f6
Update handwritten/error-reporting/test/unit/configuration.ts
danieljbruce Sep 25, 2026
c3107be
Update handwritten/error-reporting/test/unit/configuration.ts
danieljbruce Sep 25, 2026
bc4b3a1
Merge branch 'main' into bun-runtime/1-test-runner-handwritten-librar…
danieljbruce Sep 25, 2026
57b55c4
Apply proper cleanup for instrumentation
danieljbruce Sep 25, 2026
9ee0139
Merge branch 'bun-runtime/1-test-runner-handwritten-libraries-3' of h…
danieljbruce Sep 25, 2026
a8c6d61
Use promise all to create loud failures
danieljbruce Sep 25, 2026
b03058e
Improve cleanup task
danieljbruce Sep 25, 2026
fdc7270
Merge branch 'main' into bun-runtime/1-test-runner-handwritten-librar…
danieljbruce Sep 25, 2026
8012918
Use the test runner for spanner, storage and bigtable
danieljbruce Sep 25, 2026
ae0c6b2
Adjust all the package.json files
danieljbruce Sep 25, 2026
5cecab2
Use the test runner for spanner, storage and bigtable
danieljbruce Sep 25, 2026
2a8a2d8
Adjust all the package.json files
danieljbruce Sep 25, 2026
d8bdff9
revert spanner, bigtable and storage changes
danieljbruce Sep 25, 2026
53cf89f
just run run-test directly
danieljbruce Sep 25, 2026
8233cbf
Add run-test to gapic tools
danieljbruce Sep 25, 2026
55e9e98
eliminate the tools directory changes
danieljbruce Sep 25, 2026
5f9de1c
remove the no-parallel flags from the system test scripts
danieljbruce Sep 25, 2026
c8c4d71
remove —no-parallel
danieljbruce Sep 25, 2026
71bfe1c
remove core/packages/tools/bin/run-test.js
danieljbruce Sep 25, 2026
a61d3b3
Revert "eliminate the tools directory changes"
danieljbruce Sep 25, 2026
4ca083a
test: invoke bin/run-test.cjs directly in handwritten libraries and r…
danieljbruce Sep 28, 2026
c01c944
chore: merge origin/main into branch
danieljbruce Sep 28, 2026
03913a6
Merge branch 'bun-runtime/1-test-runner-handwritten-libraries-3' of h…
danieljbruce Sep 28, 2026
f2780b2
fix(tooling): support Module._load delegation, generational cache sna…
danieljbruce Sep 28, 2026
3be7718
revert(bigtable,spanner): revert test runner changes to focus branch …
danieljbruce Sep 28, 2026
f1e90ec
docs(tooling): add explanatory comments to Bun shim caching, loading,…
danieljbruce Sep 28, 2026
2880f9e
fix(tooling): handle Array headers explicitly before checking entries…
danieljbruce Sep 28, 2026
46b983d
fix(tooling): support Uint8Array and ArrayBuffer request bodies in Bu…
danieljbruce Sep 28, 2026
646a425
fix(tooling): invoke Module._load directly instead of calling with in…
danieljbruce Sep 28, 2026
53abb78
test(spanner): use test runner for spanner unit and system tests
danieljbruce Sep 28, 2026
5ac2d55
chore(spanner): remove redundant --no-parallel flags from test scripts
danieljbruce Sep 28, 2026
7f23b7b
Change the shim and modify the observability tests
danieljbruce Sep 28, 2026
1a62c23
chore(spanner): revert changes to src files and resolve test failures…
danieljbruce Sep 28, 2026
69add5f
Merge branch 'main' into bun-runtime/1-test-runner-handwritten-librar…
danieljbruce Sep 28, 2026
079554f
Merge branch 'main' of https://github.com/googleapis/google-cloud-nod…
danieljbruce Sep 28, 2026
d080b0c
Update handwritten/spanner/observability-test/batch-transaction.ts
danieljbruce Sep 28, 2026
62255c2
Update handwritten/spanner/observability-test/batch-transaction.ts
danieljbruce Sep 28, 2026
21b90d8
fix(shim): add Date, RegExp, and Buffer checks to looseDeepEqual
danieljbruce Sep 28, 2026
7308937
Merge branch 'bun-runtime/1-test-runner-handwritten-libraries-4-1' of…
danieljbruce Sep 28, 2026
334cda5
Merge branch 'bun-runtime/1-test-runner-handwritten-libraries-4' of h…
danieljbruce Sep 28, 2026
cf2d1e4
Revert "Merge branch 'bun-runtime/1-test-runner-handwritten-libraries…
danieljbruce Sep 28, 2026
923f05c
fix(shim): restrict loose primitive comparison to avoid coercion fals…
danieljbruce Sep 28, 2026
5410ee4
fix(shim): restrict deepStrictEqual workaround to affected Bun versio…
danieljbruce Sep 28, 2026
6f47931
docs(shim): clarify primitive loose equality in looseDeepEqual
danieljbruce Sep 28, 2026
edf64ae
fix(shim): add Map and Set comparison checks to looseDeepEqual
danieljbruce Sep 28, 2026
894e4e1
fix: cleanup contextManager in afterEach and remove global sort override
danieljbruce Sep 30, 2026
59b3b90
Merge remote-tracking branch 'upstream/main' into bun-runtime/1-test-…
danieljbruce Sep 30, 2026
82356f2
fix linter checks
danieljbruce Sep 30, 2026
036ce6f
perf(tooling): instantiate array with length instead of Array.from in…
danieljbruce Sep 30, 2026
bf2edc4
fix(tooling): coerce array length to uint32 via >>> 0 in assert.deepS…
danieljbruce Sep 30, 2026
b2fa115
refactor(spanner): replace assert shim overrides with direct test upd…
danieljbruce Sep 30, 2026
783baf4
test(spanner): instantiate and shut down NodeTracerProvider in before…
danieljbruce Sep 30, 2026
7ea0fe7
test(spanner): initialize contextManager at suite level in batch-tran…
danieljbruce Sep 30, 2026
aa0480a
Merge branch 'main' into bun-runtime/1-test-runner-handwritten-librar…
danieljbruce Sep 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/proxyquire-bun-shim.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ if (
} catch {
real = undefined;
}
if (real && typeof real === 'object') {
if (real && (typeof real === 'object' || typeof real === 'function')) {
for (const k of Object.keys(real)) {
if (!(k in stub)) stub[k] = real[k];
}
Expand Down
34 changes: 27 additions & 7 deletions handwritten/spanner/observability-test/batch-transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import {util} from '@google-cloud/common';
import * as pfy from '@google-cloud/promisify';
import * as assert from 'assert';
import {before, beforeEach, afterEach, describe, it} from 'mocha';
import {before, after, beforeEach, afterEach, describe, it} from 'mocha';
import * as extend from 'extend';
import * as proxyquire from 'proxyquire';
import * as sinon from 'sinon';
Expand All @@ -32,6 +32,11 @@ const {
const {SimpleSpanProcessor} = require('@opentelemetry/sdk-trace-base');
import {Session, Spanner} from '../src';
import * as bt from '../src/batch-transaction';
const {

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.

I'm sure there's a reason for it given that there's another above, but I'm curious why the mix of require and import?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This follows the existing pattern across the observability-test suite (e.g., observability-test/spanner.ts), where the OpenTelemetry packages and ./helper were originally loaded via require() (in part because NodeTracerProvider is passed an untyped exporter property in its config object, which would fail strict TypeScript checks if imported via ES import, and @opentelemetry/sdk-trace-base was originally a transitive dependency). We kept require() here to stay consistent with the rest of the file.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also noticed when we did the Node upgrade last year that we had to play with require/import a lot to eliminate compiler errors so that might be another reason we see this discrepancy.

AsyncLocalStorageContextManager,
AsyncHooksContextManager,
} = require('@opentelemetry/context-async-hooks');
const {setGlobalContextManager, disableContextAndManager} = require('./helper');

const fakePfy = extend({}, pfy, {
promisifyAll(klass, options) {
Expand Down Expand Up @@ -118,6 +123,17 @@ describe('BatchTransaction', () => {
exporter: traceExporter,
spanProcessors: [new SimpleSpanProcessor(traceExporter)],
});
provider.register();

const contextManager = new (
AsyncLocalStorageContextManager || AsyncHooksContextManager
)();
setGlobalContextManager(contextManager);

after(async () => {
await provider.shutdown();
disableContextAndManager(contextManager);
});

afterEach(() => {
traceExporter.reset();
Expand Down Expand Up @@ -160,9 +176,11 @@ describe('BatchTransaction', () => {
assert.strictEqual(spans.length, 2, 'Exactly 2 spans expected');

// Sort the spans by duration.
spans.sort((spanA, spanB) => {
spanA.duration < spanB.duration;
});
spans.sort(
(spanA, spanB) =>
spanA.duration[0] - spanB.duration[0] ||
spanA.duration[1] - spanB.duration[1],
);

const actualSpanNames: string[] = [];
spans.forEach(span => {
Expand Down Expand Up @@ -224,9 +242,11 @@ describe('BatchTransaction', () => {
assert.strictEqual(spans.length, 2, 'Exactly 2 spans expected');

// Sort the spans by duration.
spans.sort((spanA, spanB) => {
spanA.duration < spanB.duration;
});
spans.sort(
(spanA, spanB) =>
spanA.duration[0] - spanB.duration[0] ||
spanA.duration[1] - spanB.duration[1],
);

const actualSpanNames: string[] = [];
spans.forEach(span => {
Expand Down
5 changes: 4 additions & 1 deletion handwritten/spanner/observability-test/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@

class FakeSession {
calledWith_: IArguments;
formattedName_: any;

Check warning on line 99 in handwritten/spanner/observability-test/database.ts

View workflow job for this annotation

GitHub Actions / lint

Unexpected any. Specify a different type
constructor() {
this.calledWith_ = arguments;
}
Expand Down Expand Up @@ -149,7 +149,7 @@
setQueuedMutations(mutation) {
this._queuedMutations = mutation;
}
setReadWriteTransactionOptions(options: RunTransactionOptions) {}

Check warning on line 152 in handwritten/spanner/observability-test/database.ts

View workflow job for this annotation

GitHub Actions / lint

'options' is defined but never used
commit(
options?: CommitOptions,
callback?: CommitCallback,
Expand Down Expand Up @@ -1229,7 +1229,10 @@
assert.ok(
errorMessage.includes(
"Cannot read properties of null (reading 'proto')",
) || errorMessage.includes("Cannot read property 'proto' of null"),
) ||
errorMessage.includes("Cannot read property 'proto' of null") ||
(errorMessage.includes('null is not an object') &&
errorMessage.includes('proto')),
);

// We expect an exception to have been caught as well as a Session event.
Expand Down
3 changes: 3 additions & 0 deletions handwritten/spanner/observability-test/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ export const cacheSessionEvents = ['Cache hit: has usable multiplexed session'];
* and referring to context causes type/value collision errors.
*/
export function setGlobalContextManager(manager: ContextManager) {
if (typeof manager.enable === 'function') {
manager.enable();
}
context.setGlobalContextManager(manager);
}

Expand Down
26 changes: 21 additions & 5 deletions handwritten/spanner/observability-test/spanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
cacheSessionEvents,
} = require('./helper');
const {
AsyncLocalStorageContextManager,
AsyncHooksContextManager,
} = require('@opentelemetry/context-async-hooks');

Expand Down Expand Up @@ -146,12 +147,10 @@

describe('EndToEnd', async () => {
const sandbox = sinon.createSandbox();
const contextManager = new AsyncHooksContextManager();
const contextManager = new (
AsyncLocalStorageContextManager || AsyncHooksContextManager
)();
setGlobalContextManager(contextManager);
afterEach(async () => {
disableContextAndManager(contextManager);
});

const traceExporter = new InMemorySpanExporter();
const sampler = new AlwaysOnSampler();
const tracerProvider = new NodeTracerProvider({
Expand All @@ -177,6 +176,7 @@
await spanner.close();
await server.tryShutdown(() => {});
sandbox.restore();
disableContextAndManager(contextManager);
});

afterEach(async () => {
Expand Down Expand Up @@ -1743,10 +1743,10 @@
database.run(selectSql, (err, rows) => {
assert.ifError(err);
assert.strictEqual(rows!.length, 3);
database

Check warning on line 1746 in handwritten/spanner/observability-test/spanner.ts

View workflow job for this annotation

GitHub Actions / lint

Avoid using promises inside of callbacks

Check warning on line 1746 in handwritten/spanner/observability-test/spanner.ts

View workflow job for this annotation

GitHub Actions / lint

Avoid using promises inside of callbacks
.close()
.then(() => done())

Check warning on line 1748 in handwritten/spanner/observability-test/spanner.ts

View workflow job for this annotation

GitHub Actions / lint

Avoid calling back inside of a promise
.catch(err => done(err));

Check warning on line 1749 in handwritten/spanner/observability-test/spanner.ts

View workflow job for this annotation

GitHub Actions / lint

Avoid calling back inside of a promise
});
});

Expand All @@ -1763,10 +1763,10 @@
database.run(selectSql, err => {
assert.ok(err, 'Missing expected error');
assert.strictEqual(err!.message, '2 UNKNOWN: Non-retryable error');
database

Check warning on line 1766 in handwritten/spanner/observability-test/spanner.ts

View workflow job for this annotation

GitHub Actions / lint

Avoid using promises inside of callbacks

Check warning on line 1766 in handwritten/spanner/observability-test/spanner.ts

View workflow job for this annotation

GitHub Actions / lint

Avoid using promises inside of callbacks
.close()
.then(() => done())

Check warning on line 1768 in handwritten/spanner/observability-test/spanner.ts

View workflow job for this annotation

GitHub Actions / lint

Avoid calling back inside of a promise
.catch(err => done(err));

Check warning on line 1769 in handwritten/spanner/observability-test/spanner.ts

View workflow job for this annotation

GitHub Actions / lint

Avoid calling back inside of a promise
});
});

Expand Down Expand Up @@ -2033,9 +2033,25 @@
let spannerMock: mock.MockSpanner;
let observabilityOptions: typeof ObservabilityOptions;

let provider: InstanceType<typeof NodeTracerProvider>;

before(() => {
const traceExporter = new InMemorySpanExporter();
provider = new NodeTracerProvider({
sampler: new AlwaysOnSampler(),
exporter: traceExporter,
spanProcessors: [new SimpleSpanProcessor(traceExporter)],
});
});

after(async () => {
await provider.shutdown();
});

beforeEach(async () => {
sandbox = sinon.createSandbox();
observabilityOptions = {
tracerProvider: provider,
enableEndToEndTracing: true,
};

Expand Down
8 changes: 5 additions & 3 deletions handwritten/spanner/observability-test/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,11 @@ describe('Table', () => {
);

// Sort the spans by duration.
spans.sort((spanA, spanB) => {
spanA.duration < spanB.duration;
});
spans.sort(
(spanA, spanB) =>
spanA.duration[0] - spanB.duration[0] ||
spanA.duration[1] - spanB.duration[1],
);

return spans;
}
Expand Down
8 changes: 5 additions & 3 deletions handwritten/spanner/observability-test/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,11 @@ describe('Transaction', () => {
const spans = traceExporter.getFinishedSpans();

// Sort the spans by startTime.
spans.sort((spanA, spanB) => {
spanA.startTime < spanB.startTime;
});
spans.sort(
(spanA, spanB) =>
spanA.startTime[0] - spanB.startTime[0] ||
spanA.startTime[1] - spanB.startTime[1],
);

const spanNames: string[] = [];
const eventNames: string[] = [];
Expand Down
10 changes: 5 additions & 5 deletions handwritten/spanner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@
"docs": "jsdoc -c .jsdoc.js",
"predocs": "pnpm run compile",
"lint": "gts check",
"system-test": "mocha build/system-test --timeout 1600000",
"observability-test": "mocha build/observability-test --timeout 1600000",
"cleanup": "mocha scripts/cleanup.js --timeout 30000",
"test": "mocha build/test build/test/common build/observability-test",
"system-test": "node ../../bin/run-test.cjs build/system-test --timeout 1600000",
"observability-test": "node ../../bin/run-test.cjs build/observability-test --timeout 1600000",
"cleanup": "node ../../bin/run-test.cjs scripts/cleanup.js --timeout 30000",
"test": "node ../../bin/run-test.cjs build/test build/test/common build/observability-test",
"ycsb": "node ./benchmark/ycsb.js run -P ./benchmark/workloada -p table=usertable -p cloudspanner.instance=ycsb-instance -p operationcount=100 -p cloudspanner.database=ycsb",
"fix": "gts fix",
"clean": "gts clean",
Expand All @@ -48,7 +48,7 @@
"preobservability-test": "pnpm run compile",
"benchwrapper": "node bin/benchwrapper.js",
"precompile": "gts clean",
"coverage": "c8 mocha build/test build/test/common && c8 report --check-coverage"
"coverage": "node ../../bin/run-test.cjs build/test build/test/common && c8 report --check-coverage"
},
"dependencies": {
"@babel/core": "7.27.7",
Expand Down
2 changes: 1 addition & 1 deletion handwritten/spanner/test/codec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@ describe('codec', () => {
value: music.Genre.JAZZ,
fullName: 'examples.spanner.music.Genre',
}).toJSON(),
1,
'1',
);
});
});
Expand Down
5 changes: 4 additions & 1 deletion handwritten/spanner/test/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,10 @@ describe('Database', () => {
assert.ok(
errorMessage.includes(
"Cannot read properties of null (reading 'proto')",
) || errorMessage.includes("Cannot read property 'proto' of null"),
) ||
errorMessage.includes("Cannot read property 'proto' of null") ||
(errorMessage.includes('null is not an object') &&
errorMessage.includes('proto')),
);

done();
Expand Down
2 changes: 1 addition & 1 deletion handwritten/spanner/test/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ describe('helper', () => {

assert.throws(() => {
replaceProjectIdToken(frozenObj, projectId);
}, /Cannot assign to read only property/);
}, /Cannot assign to read only property|Attempted to assign to readonly property/);

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.

Not really commentary for this PR, but it might be cool to collect some of these differences in test-utils if we are supporting bun going forward anyway. Or maybe find other way to do these checks that don't rely on strings. (Again, different task...)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed — centralizing runtime-agnostic error assertions and environment checks in test-utils (or asserting on the error type rather than engine-specific message strings) will be much cleaner as we expand Bun (and potentially Deno) support. We'll track this as a follow-up task.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be addressed in #9492

});

it('should replace more than one {{projectId}}', () => {
Expand Down
10 changes: 8 additions & 2 deletions handwritten/spanner/test/partial-result-stream.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,10 @@ describe('PartialResultStream', () => {
// Node 18's assert.deepStrictEqual strictly requires prototype equality,
// which fails when comparing RowImpl (an Array subclass) with a plain Array literal.
// Node 20+ relaxed this for Array subclasses with constructor = Array.
if (parseInt(process.versions.node.split('.')[0], 10) < 20) {
if (
parseInt(process.versions.node.split('.')[0], 10) < 20 ||

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.

Same for this kind of thing. We could have predicates in test-utils that do this sort of test.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed — adding runtime capability predicates or assertion helpers in test-utils so individual package tests don't need inline process.versions checks makes sense as a follow-up.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be addressed in #9492

process.versions.bun
) {
assert.deepStrictEqual([...row], EXPECTED_ROW);
} else {
assert.deepStrictEqual(row, EXPECTED_ROW);
Expand Down Expand Up @@ -260,7 +263,10 @@ describe('PartialResultStream', () => {
// Node 18's assert.deepStrictEqual strictly requires prototype equality,
// which fails when comparing RowImpl (an Array subclass) with a plain Array literal.
// Node 20+ relaxed this for Array subclasses with constructor = Array.
if (parseInt(process.versions.node.split('.')[0], 10) < 20) {
if (
parseInt(process.versions.node.split('.')[0], 10) < 20 ||
process.versions.bun
) {
assert.deepStrictEqual([...row], EXPECTED_ROW);
} else {
assert.deepStrictEqual(row, EXPECTED_ROW);
Expand Down
Loading
Loading