Skip to content

test(e2e): Add node-prisma-8 test app - #24683

Merged
chargome merged 1 commit into
feat/prisma-8-instrumentationfrom
feat/prisma-8-e2e
Sep 25, 2026
Merged

chargome merged 1 commit into
feat/prisma-8-instrumentationfrom
feat/prisma-8-e2e

Conversation

@chargome

@chargome chargome commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Express app on Prisma 8 rc.8 with Postgres 16 in Docker, asserting the operation spans and the pg spans nested under them.

Refs #24237

@chargome
chargome added this pull request to stack #24684 September 24, 2026 09:07
@chargome chargome self-assigned this Sep 24, 2026
@chargome

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 29.24 kB - -
@sentry/browser - with treeshaking flags 27.5 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.4 kB - -
@sentry/browser (incl. Tracing) 51.15 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 51.17 kB - -
@sentry/browser (incl. Tracing, Profiling) 54.18 kB - -
@sentry/browser (incl. Tracing, Replay) 90.76 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 79.86 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 95.46 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 108.41 kB - -
@sentry/browser (incl. Feedback) 46.76 kB - -
@sentry/browser (incl. sendFeedback) 34.3 kB - -
@sentry/browser (incl. FeedbackAsync) 39.41 kB - -
@sentry/browser (incl. Metrics) 30.25 kB - -
@sentry/browser (incl. Logs) 30.51 kB - -
@sentry/browser (incl. Metrics & Logs) 31.18 kB - -
@sentry/react 31 kB - -
@sentry/react (incl. Tracing) 53.45 kB - -
@sentry/vue 36.74 kB - -
@sentry/vue (incl. Tracing) 53.7 kB - -
@sentry/svelte 29.26 kB - -
CDN Bundle 30.93 kB - -
CDN Bundle (incl. Tracing) 51.69 kB - -
CDN Bundle (incl. Logs, Metrics) 33.2 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 53.66 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73.92 kB - -
CDN Bundle (incl. Tracing, Replay) 89.28 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 91.25 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 95.45 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 97.42 kB - -
CDN Bundle - uncompressed 91.4 kB - -
CDN Bundle (incl. Tracing) - uncompressed 153.77 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 97.97 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 159.73 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 227.54 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 273.5 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 279.44 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 287.2 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 293.13 kB - -
@sentry/nextjs (client) 55.77 kB - -
@sentry/sveltekit (client) 51.59 kB - -
@sentry/core/server 39.95 kB - -
@sentry/core/browser 13.63 kB - -
@sentry/node 136.67 kB +1.95% +2.61 kB 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 82.56 kB +0.17% +137 B 🔺
@sentry/node - without tracing 90.58 kB +0.17% +145 B 🔺
@sentry/node - without channel injection 115.12 kB +2.26% +2.54 kB 🔺
@sentry/aws-serverless 98.85 kB +0.14% +137 B 🔺
@sentry/cloudflare (withSentry) - minified 206.49 kB - -
@sentry/cloudflare (withSentry) 513.73 kB - -

View base workflow run

@chargome

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

@chargome

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

@chargome

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

@chargome
chargome marked this pull request as ready for review September 24, 2026 12:02
@chargome
chargome requested review from a team, JPeer264, andreiborza and isaacs and removed request for a team September 24, 2026 12:03
res.json({ created: created.id, count: users.length });
});

Sentry.setupExpressErrorHandler(app);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

l: I think this is not needed anymore. If it is needed it's a bug

Suggested change
Sentry.setupExpressErrorHandler(app);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

right, this is a no/op

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Removed.

@chargome

Copy link
Copy Markdown
Member Author

bugbot run

);
expect(queriesUnder('all')).toEqual([expect.stringMatching(/^SELECT .* FROM "public"\."user"$/)]);
expect(queriesUnder('delete')).toEqual(
expect.arrayContaining([expect.stringMatching(/^DELETE FROM "public"\."user" /)]),

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.

Bug: The test at prisma.test.ts:69 incorrectly assumes a specific order for asynchronous spans by using .toEqual(), which will cause flaky test failures.
Severity: MEDIUM

Suggested Fix

Replace the .toEqual(OPERATION_METHODS) assertion with expect.unordered(OPERATION_METHODS). This will validate that all expected spans are present without enforcing a strict order, making the test robust against non-deterministic span emission.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location:
dev-packages/e2e-tests/test-applications/node-prisma-8/tests/prisma.test.ts#L69

Potential issue: The test at `prisma.test.ts:69` asserts that Prisma operation spans are
received in a specific order (`['create', 'all', 'delete']`) by using `toEqual`.
However, even with sequential `await` calls in the application code, the asynchronous
nature of span emission and collection means their order is not guaranteed. This
non-determinism is acknowledged in a similar, existing integration test which uses
`.unordered()` for the same type of assertion. The current implementation will cause the
test to be flaky and fail intermittently in CI.

Did we get this right? 👍 / 👎 to inform future reviews.

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale Bugbot comment from a previous run.

@chargome

Copy link
Copy Markdown
Member Author

bugbot run

Express app on Prisma 8 rc.8 with Postgres 16 in Docker, asserting the
`prisma:client:operation` spans and the `pg` spans nested under them
through the runtime hook.

Refs #24237
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@chargome

Copy link
Copy Markdown
Member Author

bugbot run

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 99d2534. Configure here.

import postgres from '@prisma/orm-postgres/runtime';
import express from 'express';
import type { Contract } from './prisma/contract.d.ts';
import contractJson from './prisma/contract.json' with { type: 'json' };

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

JSON contract missing from dist

High Severity

app.ts imports ./prisma/contract.json, and start runs the compiled dist/app.js. tsc does not emit JSON into outDir, so the relative import resolves to a missing dist/prisma/contract.json and the process exits before the e2e app can serve /test-prisma.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 99d2534. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit eaec6e9. Configure here.

@chargome
chargome merged commit f660026 into develop Sep 25, 2026
46 of 75 checks passed
@chargome
chargome deleted the feat/prisma-8-e2e branch September 25, 2026 14:01
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.

3 participants