From 97727158f9d46b5f1769ae2448549901ef925b0b Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Thu, 13 Jul 2023 13:24:56 +0200 Subject: [PATCH] ref: move event proxy server --- .../nextjs-app-dir}/event-proxy-server.ts | 0 .../nextjs-app-dir/start-event-proxy.ts | 2 +- .../tests/devErrorSymbolification.test.ts | 2 +- .../nextjs-app-dir/tests/edge-route.test.ts | 2 +- .../nextjs-app-dir/tests/exceptions.test.ts | 2 +- .../nextjs-app-dir/tests/middleware.test.ts | 2 +- .../nextjs-app-dir/tests/trace.test.ts | 2 +- .../nextjs-app-dir/tests/transactions.test.ts | 2 +- .../sveltekit/event-proxy-server.ts | 15 --------------- 9 files changed, 7 insertions(+), 22 deletions(-) rename packages/e2e-tests/{test-utils => test-applications/nextjs-app-dir}/event-proxy-server.ts (100%) diff --git a/packages/e2e-tests/test-utils/event-proxy-server.ts b/packages/e2e-tests/test-applications/nextjs-app-dir/event-proxy-server.ts similarity index 100% rename from packages/e2e-tests/test-utils/event-proxy-server.ts rename to packages/e2e-tests/test-applications/nextjs-app-dir/event-proxy-server.ts diff --git a/packages/e2e-tests/test-applications/nextjs-app-dir/start-event-proxy.ts b/packages/e2e-tests/test-applications/nextjs-app-dir/start-event-proxy.ts index a79905256d6f..ef8d204c5224 100644 --- a/packages/e2e-tests/test-applications/nextjs-app-dir/start-event-proxy.ts +++ b/packages/e2e-tests/test-applications/nextjs-app-dir/start-event-proxy.ts @@ -1,4 +1,4 @@ -import { startEventProxyServer } from '../../test-utils/event-proxy-server'; +import { startEventProxyServer } from './event-proxy-server'; startEventProxyServer({ port: 3031, diff --git a/packages/e2e-tests/test-applications/nextjs-app-dir/tests/devErrorSymbolification.test.ts b/packages/e2e-tests/test-applications/nextjs-app-dir/tests/devErrorSymbolification.test.ts index f4841c2a6b16..03dd1b978714 100644 --- a/packages/e2e-tests/test-applications/nextjs-app-dir/tests/devErrorSymbolification.test.ts +++ b/packages/e2e-tests/test-applications/nextjs-app-dir/tests/devErrorSymbolification.test.ts @@ -1,5 +1,5 @@ import { test, expect } from '@playwright/test'; -import { waitForError } from '../../../test-utils/event-proxy-server'; +import { waitForError } from '../event-proxy-server'; test.describe('dev mode error symbolification', () => { if (process.env.TEST_ENV !== 'development') { diff --git a/packages/e2e-tests/test-applications/nextjs-app-dir/tests/edge-route.test.ts b/packages/e2e-tests/test-applications/nextjs-app-dir/tests/edge-route.test.ts index 8f73764a919f..7d8d2a2fe97a 100644 --- a/packages/e2e-tests/test-applications/nextjs-app-dir/tests/edge-route.test.ts +++ b/packages/e2e-tests/test-applications/nextjs-app-dir/tests/edge-route.test.ts @@ -1,5 +1,5 @@ import { test, expect } from '@playwright/test'; -import { waitForTransaction, waitForError } from '../../../test-utils/event-proxy-server'; +import { waitForTransaction, waitForError } from '../event-proxy-server'; test('Should create a transaction for edge routes', async ({ request }) => { test.skip(process.env.TEST_ENV === 'development', "Doesn't work in dev mode."); diff --git a/packages/e2e-tests/test-applications/nextjs-app-dir/tests/exceptions.test.ts b/packages/e2e-tests/test-applications/nextjs-app-dir/tests/exceptions.test.ts index ea96490b79ce..d31e869fd8b3 100644 --- a/packages/e2e-tests/test-applications/nextjs-app-dir/tests/exceptions.test.ts +++ b/packages/e2e-tests/test-applications/nextjs-app-dir/tests/exceptions.test.ts @@ -1,5 +1,5 @@ import { test, expect } from '@playwright/test'; -import { waitForError } from '../../../test-utils/event-proxy-server'; +import { waitForError } from '../event-proxy-server'; import axios, { AxiosError } from 'axios'; const authToken = process.env.E2E_TEST_AUTH_TOKEN; diff --git a/packages/e2e-tests/test-applications/nextjs-app-dir/tests/middleware.test.ts b/packages/e2e-tests/test-applications/nextjs-app-dir/tests/middleware.test.ts index 268a55f1f481..95af8a7a8f29 100644 --- a/packages/e2e-tests/test-applications/nextjs-app-dir/tests/middleware.test.ts +++ b/packages/e2e-tests/test-applications/nextjs-app-dir/tests/middleware.test.ts @@ -1,5 +1,5 @@ import { test, expect } from '@playwright/test'; -import { waitForTransaction, waitForError } from '../../../test-utils/event-proxy-server'; +import { waitForTransaction, waitForError } from '../event-proxy-server'; test('Should create a transaction for middleware', async ({ request }) => { test.skip(process.env.TEST_ENV === 'development', "Doesn't work in dev mode."); diff --git a/packages/e2e-tests/test-applications/nextjs-app-dir/tests/trace.test.ts b/packages/e2e-tests/test-applications/nextjs-app-dir/tests/trace.test.ts index 99d03266d01f..ed9a68513a19 100644 --- a/packages/e2e-tests/test-applications/nextjs-app-dir/tests/trace.test.ts +++ b/packages/e2e-tests/test-applications/nextjs-app-dir/tests/trace.test.ts @@ -1,5 +1,5 @@ import { test } from '@playwright/test'; -import { waitForTransaction } from '../../../test-utils/event-proxy-server'; +import { waitForTransaction } from '../event-proxy-server'; if (process.env.TEST_ENV === 'production') { // TODO: Fix that this is flakey on dev server - might be an SDK bug diff --git a/packages/e2e-tests/test-applications/nextjs-app-dir/tests/transactions.test.ts b/packages/e2e-tests/test-applications/nextjs-app-dir/tests/transactions.test.ts index 8dac4e58e5ba..8413d623eb5c 100644 --- a/packages/e2e-tests/test-applications/nextjs-app-dir/tests/transactions.test.ts +++ b/packages/e2e-tests/test-applications/nextjs-app-dir/tests/transactions.test.ts @@ -1,5 +1,5 @@ import { test, expect } from '@playwright/test'; -import { waitForTransaction } from '../../../test-utils/event-proxy-server'; +import { waitForTransaction } from '../event-proxy-server'; import axios, { AxiosError } from 'axios'; const authToken = process.env.E2E_TEST_AUTH_TOKEN; diff --git a/packages/e2e-tests/test-applications/sveltekit/event-proxy-server.ts b/packages/e2e-tests/test-applications/sveltekit/event-proxy-server.ts index 34d77e629e1e..c61e20d4081d 100644 --- a/packages/e2e-tests/test-applications/sveltekit/event-proxy-server.ts +++ b/packages/e2e-tests/test-applications/sveltekit/event-proxy-server.ts @@ -1,18 +1,3 @@ -// This is vendored from packages/e2e-tests/test-utils/event-proxy-server.ts -// This is done because otherwise we were getting `ERR_MODULE_NOT_FOUND`: -// -// CustomError: Cannot find module '/sentry-javascript/packages/e2e-tests/test-utils/event-proxy-server' imported from /sentry-javascript/packages/e2e-tests/test-applications/sveltekit/start-event-proxy.ts -// at finalizeResolution (/sentry-javascript/packages/e2e-tests/test-applications/sveltekit/node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js:366:11) -// at moduleResolve (/sentry-javascript/packages/e2e-tests/test-applications/sveltekit/node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js:801:10) -// at Object.defaultResolve (/sentry-javascript/packages/e2e-tests/test-applications/sveltekit/node_modules/ts-node/dist-raw/node-internal-modules-esm-resolve.js:912:11) -// at /sentry-javascript/packages/e2e-tests/test-applications/sveltekit/node_modules/ts-node/src/esm.ts:218:35 -// at entrypointFallback (/sentry-javascript/packages/e2e-tests/test-applications/sveltekit/node_modules/ts-node/src/esm.ts:168:34) -// at /sentry-javascript/packages/e2e-tests/test-applications/sveltekit/node_modules/ts-node/src/esm.ts:217:14 -// at addShortCircuitFlag (/sentry-javascript/packages/e2e-tests/test-applications/sveltekit/node_modules/ts-node/src/esm.ts:409:21) -// at resolve (/sentry-javascript/packages/e2e-tests/test-applications/sveltekit/node_modules/ts-node/src/esm.ts:197:12) -// at resolve (/sentry-javascript/packages/e2e-tests/test-applications/sveltekit/node_modules/ts-node/src/child/child-loader.ts:15:39) -// at nextResolve (node:internal/modules/esm/loader:163:28) - import type { Envelope, EnvelopeItem, Event } from '@sentry/types'; import { parseEnvelope } from '@sentry/utils'; import * as fs from 'fs';