From 056552229a963374f4ddf9f5c8e334c2737262b0 Mon Sep 17 00:00:00 2001 From: isaacs Date: Thu, 15 Oct 2026 09:23:13 -0700 Subject: [PATCH] test(node): skip the Prisma 8 suite on Node 20 Prisma 8 requires Node 22.12: its `@prisma/cli-engine` peer declares `engines.node >=22.12.0`. On Node 20, the suite's install of `@prisma/orm-postgres` now fails outright. npm 10, which Node 20 ships, crashes with `Cannot read properties of null (reading 'edgesOut')` on a peer conflict deep in Prisma's tree, which `vitest@4.1.12` introduced: its optional `@vitest/browser-webdriverio` peer is `^4.1.11`, and that package has no 4.1.12, so it resolves to 4.1.11, which peers on `vitest@4.1.11`. The suite now runs on Node 22 and later only. That also removes its Node 20 test of `require(esm)` loading the ORM uninstrumented, which covered a setup Prisma does not support. Co-Authored-By: Claude Opus 5.5 (1M context) --- .../suites/tracing/prisma-orm-v8/test.ts | 33 +++---------------- 1 file changed, 4 insertions(+), 29 deletions(-) diff --git a/dev-packages/node-integration-tests/suites/tracing/prisma-orm-v8/test.ts b/dev-packages/node-integration-tests/suites/tracing/prisma-orm-v8/test.ts index d7adfe06da27..6831e3123397 100644 --- a/dev-packages/node-integration-tests/suites/tracing/prisma-orm-v8/test.ts +++ b/dev-packages/node-integration-tests/suites/tracing/prisma-orm-v8/test.ts @@ -33,13 +33,14 @@ function getOperationSpans(container: SerializedStreamedSpanContainer): Serializ // Prisma 8 has no tracing surface: the operation spans come from the orchestrion channels the runtime hook // injects, and the `pg` spans underneath stand in for v7's `db_query` spans. -describe('Prisma ORM v8 Tests', () => { +// Prisma 8 requires Node 22.12 (`engines` of its `@prisma/cli-engine` peer), and on Node 20 it does not install. +describe.runIf(supports({ min: 22 }))('Prisma ORM v8 Tests', () => { describeWithDockerCompose('Prisma ORM v8', { workingDirectory: [__dirname] }, () => { createEsmAndCjsTests( __dirname, 'scenario.mjs', 'instrument.mjs', - (createRunner, test, mode) => { + (createRunner, test) => { const testInstrumentedOperations = (): void => { test('should instrument Prisma ORM operations and nest their queries', { timeout: 75_000 }, async () => { await createRunner() @@ -96,33 +97,7 @@ describe('Prisma ORM v8 Tests', () => { }); }; - if (mode === 'esm') { - testInstrumentedOperations(); - return; - } - - // The CJS scenario loads the ESM-only package via `require(esm)`, which Node's module hooks only see - // from Node 22 on; on Node 20 the ORM terminals load uninstrumented. - describe.runIf(supports({ min: 22 }))( - 'with require(esm) reaching the module hooks', - testInstrumentedOperations, - ); - - describe.runIf(supports({ max: 21 }))('with require(esm) bypassing the module hooks', () => { - test('should keep the pg spans on the transaction', { timeout: 75_000 }, async () => { - await createRunner() - .unordered() - .expect({ - span: container => { - const segment = getSegment(container); - expect(getOperationSpans(container)).toEqual([]); - getQuerySpans(container).forEach(span => expect(span.parent_span_id).toBe(segment.span_id)); - }, - }) - .start() - .completed(); - }); - }); + testInstrumentedOperations(); }, { additionalDependencies: {