Skip to content

Commit c7bd25e

Browse files
committed
Use isTurbopackDevMode for nextjs-16 dev mode skips
isDevMode matches both TEST_ENV=development (turbopack) and TEST_ENV=development-webpack, which silently drops test coverage for the webpack dev variant where the Turbopack 404 issue doesn't apply. Add isTurbopackDevMode (exact match on 'development') and use it for all Turbopack-specific skips. Also skip the dynamic page test in server-components.test.ts (/nested-layout/[dynamic]) which has the same Turbopack 404 flake.
1 parent e9b074b commit c7bd25e

3 files changed

Lines changed: 10 additions & 9 deletions

File tree

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
export const isDevMode = !!process.env.TEST_ENV && process.env.TEST_ENV.includes('development');
2+
export const isTurbopackDevMode = process.env.TEST_ENV === 'development';

dev-packages/e2e-tests/test-applications/nextjs-16/tests/route-handler.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import test, { expect } from '@playwright/test';
22
import { waitForError, waitForTransaction } from '@sentry-internal/test-utils';
3-
import { isDevMode } from './isDevMode';
3+
import { isTurbopackDevMode } from './isDevMode';
44

55
test('Should create a transaction for node route handlers', async ({ request }) => {
6-
test.skip(isDevMode, 'Turbopack intermittently returns 404 for dynamic routes in dev mode');
6+
test.skip(isTurbopackDevMode, 'Turbopack intermittently returns 404 for dynamic routes in dev mode');
77

88
const routehandlerTransactionPromise = waitForTransaction('nextjs-16', async transactionEvent => {
99
return transactionEvent?.transaction === 'GET /route-handler/[xoxo]/node';
@@ -40,7 +40,7 @@ test('Should create a transaction for edge route handlers', async ({ request })
4040
test('Should report an error with a parameterized transaction name for a throwing route handler', async ({
4141
request,
4242
}) => {
43-
test.skip(isDevMode, 'Turbopack intermittently returns 404 for dynamic routes in dev mode');
43+
test.skip(isTurbopackDevMode, 'Turbopack intermittently returns 404 for dynamic routes in dev mode');
4444

4545
const errorEventPromise = waitForError('nextjs-16', errorEvent => {
4646
return errorEvent?.exception?.values?.some(value => value.value === 'route-handler-error') ?? false;
@@ -72,7 +72,7 @@ test('Should report an error with a parameterized transaction name for a throwin
7272
test('Should set a parameterized transaction name on a captureMessage event in a route handler', async ({
7373
request,
7474
}) => {
75-
test.skip(isDevMode, 'Turbopack intermittently returns 404 for dynamic routes in dev mode');
75+
test.skip(isTurbopackDevMode, 'Turbopack intermittently returns 404 for dynamic routes in dev mode');
7676

7777
const messageEventPromise = waitForError('nextjs-16', event => {
7878
return event?.message === 'route-handler-message';
@@ -105,7 +105,7 @@ test('Should set a parameterized transaction name on a captureMessage event in a
105105
test('Should set a parameterized transaction name on a captureException event in a route handler', async ({
106106
request,
107107
}) => {
108-
test.skip(isDevMode, 'Turbopack intermittently returns 404 for dynamic routes in dev mode');
108+
test.skip(isTurbopackDevMode, 'Turbopack intermittently returns 404 for dynamic routes in dev mode');
109109

110110
const errorEventPromise = waitForError('nextjs-16', errorEvent => {
111111
return errorEvent?.exception?.values?.some(value => value.value === 'route-handler-capture-exception') ?? false;

dev-packages/e2e-tests/test-applications/nextjs-16/tests/server-components.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import { expect, test } from '@playwright/test';
22
import { waitForTransaction } from '@sentry-internal/test-utils';
3-
import { isDevMode } from './isDevMode';
3+
import { isTurbopackDevMode } from './isDevMode';
44

55
test('Sends a transaction for a request to app router with URL', async ({ page }) => {
6-
// Turbopack dev mode intermittently 404s on nested dynamic routes, and the SDK
7-
// drops 404 server transactions, so the waitForTransaction times out.
8-
test.skip(isDevMode, 'Turbopack intermittently returns 404 for nested dynamic routes in dev mode');
6+
test.skip(isTurbopackDevMode, 'Turbopack intermittently returns 404 for nested dynamic routes in dev mode');
97

108
const serverComponentTransactionPromise = waitForTransaction('nextjs-16', transactionEvent => {
119
return (
@@ -79,6 +77,8 @@ test('Will create a transaction with spans for every server component and metada
7977
test('Will create a transaction with spans for every server component and metadata generation functions when visiting a dynamic page', async ({
8078
page,
8179
}) => {
80+
test.skip(isTurbopackDevMode, 'Turbopack intermittently returns 404 for dynamic routes in dev mode');
81+
8282
const serverTransactionEventPromise = waitForTransaction('nextjs-16', async transactionEvent => {
8383
return transactionEvent?.transaction === 'GET /nested-layout/[dynamic]';
8484
});

0 commit comments

Comments
 (0)