Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Fix nextjs-15 canary tests #12918

Merged
merged 8 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .github/workflows/canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ env:
${{ github.workspace }}/node_modules
${{ github.workspace }}/packages/*/node_modules
${{ github.workspace }}/dev-packages/*/node_modules
${{ github.workspace }}/packages/utils/build

permissions:
contents: read
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"test:prod": "TEST_ENV=production __NEXT_EXPERIMENTAL_INSTRUMENTATION=1 playwright test",
"test:dev": "TEST_ENV=development __NEXT_EXPERIMENTAL_INSTRUMENTATION=1 playwright test",
"test:build": "pnpm install && npx playwright install && pnpm build",
"test:build-canary": "pnpm install && pnpm add next@rc && pnpm add react@beta && pnpm add react-dom@beta && npx playwright install && pnpm build",
"test:build-canary": "pnpm install && pnpm add next@canary && pnpm add react@beta && pnpm add react-dom@beta && npx playwright install && pnpm build",
"test:build-latest": "pnpm install && pnpm add next@rc && pnpm add react@beta && pnpm add react-dom@beta && npx playwright install && pnpm build",
"test:assert": "pnpm test:prod && pnpm test:dev"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
import { expect, test } from '@playwright/test';
import { waitForError, waitForTransaction } from '@sentry-internal/test-utils';

const packageJson = require('../package.json');

test('Should capture errors from nested server components when `Sentry.captureRequestError` is added to the `onRequestError` hook', async ({
page,
}) => {
const [, minor, patch, canary] = packageJson.dependencies.next.split('.');

test.skip(
minor === '0' &&
patch.startsWith('0-') &&
((patch.includes('canary') && Number(canary) < 63) || patch.includes('rc')),
'Next.js version does not expose these errors',
);

const errorEventPromise = waitForError('nextjs-15', errorEvent => {
return !!errorEvent?.exception?.values?.some(value => value.value === 'I am technically uncatchable');
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
import { expect, test } from '@playwright/test';
import { waitForError, waitForTransaction } from '@sentry-internal/test-utils';

const packageJson = require('../package.json');

test('Should capture errors for crashing streaming promises in server components when `Sentry.captureRequestError` is added to the `onRequestError` hook', async ({
page,
}) => {
const [, minor, patch, canary] = packageJson.dependencies.next.split('.');

test.skip(
minor === '0' &&
patch.startsWith('0-') &&
((patch.includes('canary') && Number(canary) < 63) || patch.includes('rc')),
'Next.js version does not expose these errors',
);

const errorEventPromise = waitForError('nextjs-15', errorEvent => {
return !!errorEvent?.exception?.values?.some(value => value.value === 'I am a data streaming error');
});
Expand Down
Loading