Skip to content

Commit 8a8d572

Browse files
committed
fix db dev tests
1 parent 7e6d1ad commit 8a8d572

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

‎dev-packages/e2e-tests/test-applications/nuxt-4/package.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
"clean": "npx nuxi cleanup",
1313
"test": "playwright test",
1414
"test:prod": "TEST_ENV=production playwright test",
15-
"test:dev": "TEST_ENV=development playwright test environment",
16-
"test:build": "pnpm install && pnpm build",
15+
"test:dev": "TEST_ENV=development playwright test environment db-drivers",
1716
"test:build": "pnpm install && node ./scripts/build-with-prerender-event-sink.mjs",
1817
"test:build-canary": "pnpm add nuxt@npm:nuxt-nightly@latest && pnpm add nitropack@npm:nitropack-nightly@latest && pnpm install --force && pnpm build",
1918
"test:assert": "pnpm test:prod && pnpm test:dev",
2019
"test:prod:import": "TEST_ENV=production-import playwright test"
2120
},
21+
"//": "Pin ioredis to 5.10.1 because that's the last version before it publishes its own diagnostics channels",
2222
"dependencies": {
2323
"@pinia/nuxt": "^0.5.5",
2424
"@sentry/nuxt": "file:../../packed/sentry-nuxt-packed.tgz",

‎dev-packages/e2e-tests/test-applications/nuxt-4/tests/db-drivers.test.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ async function collectRequestSpans(path: string) {
1717
}
1818

1919
test('Instruments ioredis automatically', async ({ baseURL }) => {
20+
// Dev relies on runtime injection (no build-time transform), but the dev bundle hoists the ioredis
21+
// import above the inlined `Sentry.init`, so its instrumented file loads before injection is active
22+
// and gets no channels (5.10.x has no native ones). mysql requires its file lazily, after init.
23+
test.skip(process.env.TEST_ENV === 'development', 'ioredis loads before runtime injection is active in dev');
24+
2025
const spansPromise = collectRequestSpans('/api/db-ioredis');
2126

2227
const response = await fetch(`${baseURL}/api/db-ioredis`);

0 commit comments

Comments
 (0)