From 8314de338b19343340b4300841466963b9537036 Mon Sep 17 00:00:00 2001 From: Charly Gomez Date: Fri, 31 Jul 2026 17:52:45 +0200 Subject: [PATCH] test(e2e): Merge tanstackstart orchestrion app into main test app `sentryTanstackStart()` wires the orchestrion bundler plugin automatically since #22902, so a dedicated app no longer proves anything the main app doesn't. Fold the DB driver routes and tests into `tanstackstart-react`, which now exercises the built-in path. Drop the standalone app's `add-instrumentation.mjs` entry-prepending: it existed because that app started without `--import`, and `tanstackstart-react` already boots via `node --import ./.output/server/instrument.server.mjs`. Keeping it would test a second boot mechanism unrelated to orchestrion. Gate the Docker setup on the proxy variant. The DB tests carry the same `usesManagedTunnelRoute` skip as the other suites, so the five tunnel-route variants would otherwise boot MySQL and Redis only to skip the tests needing them. Co-Authored-By: Claude Opus 5 (1M context) --- .../.gitignore | 24 ----------- .../add-instrumentation.mjs | 19 --------- .../instrument.server.mjs | 13 ------ .../package.json | 42 ------------------- .../playwright.config.mjs | 12 ------ .../src/client.tsx | 14 ------- .../src/globals.d.ts | 2 - .../src/instrument.client.ts | 10 ----- .../src/router.tsx | 16 ------- .../src/routes/__root.tsx | 42 ------------------- .../src/routes/index.tsx | 9 ---- .../src/server.ts | 12 ------ .../src/start.ts | 9 ---- .../start-event-proxy.mjs | 6 --- .../tsconfig.json | 26 ------------ .../tsconfig.node.json | 11 ----- .../vite.config.ts | 31 -------------- .../docker-compose.yml | 4 +- .../global-setup.mjs | 0 .../global-teardown.mjs | 0 .../tanstackstart-react/package.json | 5 ++- .../tanstackstart-react/playwright.config.mjs | 13 +++++- .../src/routes/api.db-ioredis.ts | 0 .../src/routes/api.db-mysql.ts | 0 .../tests/db-drivers.test.ts} | 16 +++++-- 25 files changed, 30 insertions(+), 306 deletions(-) delete mode 100644 dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/.gitignore delete mode 100644 dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/add-instrumentation.mjs delete mode 100644 dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/instrument.server.mjs delete mode 100644 dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/package.json delete mode 100644 dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/playwright.config.mjs delete mode 100644 dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/src/client.tsx delete mode 100644 dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/src/globals.d.ts delete mode 100644 dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/src/instrument.client.ts delete mode 100644 dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/src/router.tsx delete mode 100644 dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/src/routes/__root.tsx delete mode 100644 dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/src/routes/index.tsx delete mode 100644 dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/src/server.ts delete mode 100644 dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/src/start.ts delete mode 100644 dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/start-event-proxy.mjs delete mode 100644 dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/tsconfig.json delete mode 100644 dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/tsconfig.node.json delete mode 100644 dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/vite.config.ts rename dev-packages/e2e-tests/test-applications/{tanstackstart-react-orchestrion => tanstackstart-react}/docker-compose.yml (84%) rename dev-packages/e2e-tests/test-applications/{tanstackstart-react-orchestrion => tanstackstart-react}/global-setup.mjs (100%) rename dev-packages/e2e-tests/test-applications/{tanstackstart-react-orchestrion => tanstackstart-react}/global-teardown.mjs (100%) rename dev-packages/e2e-tests/test-applications/{tanstackstart-react-orchestrion => tanstackstart-react}/src/routes/api.db-ioredis.ts (100%) rename dev-packages/e2e-tests/test-applications/{tanstackstart-react-orchestrion => tanstackstart-react}/src/routes/api.db-mysql.ts (100%) rename dev-packages/e2e-tests/test-applications/{tanstackstart-react-orchestrion/tests/db.test.ts => tanstackstart-react/tests/db-drivers.test.ts} (77%) diff --git a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/.gitignore b/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/.gitignore deleted file mode 100644 index a547bf36d8d1..000000000000 --- a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/.gitignore +++ /dev/null @@ -1,24 +0,0 @@ -# Logs -logs -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -pnpm-debug.log* -lerna-debug.log* - -node_modules -dist -dist-ssr -*.local - -# Editor directories and files -.vscode/* -!.vscode/extensions.json -.idea -.DS_Store -*.suo -*.ntvs* -*.njsproj -*.sln -*.sw? diff --git a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/add-instrumentation.mjs b/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/add-instrumentation.mjs deleted file mode 100644 index df1fa5f6051b..000000000000 --- a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/add-instrumentation.mjs +++ /dev/null @@ -1,19 +0,0 @@ -import { readFileSync, writeFileSync } from 'node:fs'; - -// Prepend the Sentry server init to the built Nitro server entry so it runs at -// process boot — before the first request and before `node:http` is set up. -// -// TanStack Start lazy-loads the request-handler module (src/server.ts), so an -// `import` there only runs on the first request: too late for `Sentry.init()` -// to patch `node:http`, leaving the first request without an `http.server` -// transaction (its spans come in orphaned). This mirrors how `@sentry/nuxt` -// injects the server config into Nitro's entry, and removes the need for -// `node --import` (which isn't available on platforms like Vercel/Netlify). -const entryFile = '.output/server/index.mjs'; -const topImport = "import './instrument.server.mjs';\n"; - -const contents = readFileSync(entryFile, 'utf8'); - -if (!contents.startsWith(topImport)) { - writeFileSync(entryFile, topImport + contents, 'utf8'); -} diff --git a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/instrument.server.mjs b/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/instrument.server.mjs deleted file mode 100644 index 40c046ac20f8..000000000000 --- a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/instrument.server.mjs +++ /dev/null @@ -1,13 +0,0 @@ -import * as Sentry from '@sentry/tanstackstart-react'; - -Sentry.init({ - traceLifecycle: 'static', - environment: 'qa', // dynamic sampling bias to keep transactions - dsn: process.env.E2E_TEST_DSN, - tunnel: 'http://localhost:3031/', // proxy server - tracesSampleRate: 1, - transportOptions: { - // We expect the app to send a lot of events in a short time - bufferSize: 1000, - }, -}); diff --git a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/package.json b/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/package.json deleted file mode 100644 index 0e391842cbf8..000000000000 --- a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "tanstackstart-react-orchestrion", - "private": true, - "version": "0.0.1", - "type": "module", - "scripts": { - "build": "vite build && cp instrument.server.mjs .output/server && node add-instrumentation.mjs", - "start": "node .output/server/index.mjs", - "test": "playwright test", - "clean": "npx rimraf node_modules pnpm-lock.yaml", - "test:build": "pnpm install && pnpm build", - "test:build-latest": "pnpm add @tanstack/react-start@latest @tanstack/react-router@latest && pnpm install && pnpm build", - "test:assert": "pnpm test" - }, - "//": "Need to use ioredis 5.10.1 because that's the last version before they support tracing channels", - "dependencies": { - "@sentry/tanstackstart-react": "file:../../packed/sentry-tanstackstart-react-packed.tgz", - "@tanstack/react-start": "^1.136.0", - "@tanstack/react-router": "^1.136.0", - "react": "^19.2.0", - "react-dom": "^19.2.0", - "nitro": "latest || *", - "ioredis": "5.10.1", - "mysql": "^2.18.1" - }, - "devDependencies": { - "@types/react": "^19.2.0", - "@types/react-dom": "^19.2.0", - "@types/node": "^24.10.0", - "@typescript-eslint/eslint-plugin": "^7.2.0", - "@typescript-eslint/parser": "^7.2.0", - "@vitejs/plugin-react-swc": "^3.5.0", - "typescript": "^5.9.0", - "vite": "7.3.5", - "vite-tsconfig-paths": "^5.1.4", - "@playwright/test": "~1.56.0", - "@sentry-internal/test-utils": "link:../../../test-utils" - }, - "volta": { - "extends": "../../package.json" - } -} diff --git a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/playwright.config.mjs b/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/playwright.config.mjs deleted file mode 100644 index a071f5533f93..000000000000 --- a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/playwright.config.mjs +++ /dev/null @@ -1,12 +0,0 @@ -import { getPlaywrightConfig } from '@sentry-internal/test-utils'; - -const config = getPlaywrightConfig({ - startCommand: 'pnpm start', - port: 3000, -}); - -export default { - ...config, - globalSetup: './global-setup.mjs', - globalTeardown: './global-teardown.mjs', -}; diff --git a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/src/client.tsx b/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/src/client.tsx deleted file mode 100644 index b2ee5a7ab3ad..000000000000 --- a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/src/client.tsx +++ /dev/null @@ -1,14 +0,0 @@ -// Imported first so Sentry.init() runs before any other import's side effects. -import './instrument.client'; -import { StartClient } from '@tanstack/react-start/client'; -import { StrictMode, startTransition } from 'react'; -import { hydrateRoot } from 'react-dom/client'; - -startTransition(() => { - hydrateRoot( - document, - - - , - ); -}); diff --git a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/src/globals.d.ts b/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/src/globals.d.ts deleted file mode 100644 index 6e7d31c7a4e6..000000000000 --- a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/src/globals.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -declare const __APP_DSN__: string; -declare const __APP_TUNNEL__: string | undefined; diff --git a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/src/instrument.client.ts b/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/src/instrument.client.ts deleted file mode 100644 index 95351c60f9ca..000000000000 --- a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/src/instrument.client.ts +++ /dev/null @@ -1,10 +0,0 @@ -import * as Sentry from '@sentry/tanstackstart-react'; - -Sentry.init({ - traceLifecycle: 'static', - environment: 'qa', // dynamic sampling bias to keep transactions - dsn: __APP_DSN__, - tracesSampleRate: 1.0, - release: 'e2e-test', - tunnel: __APP_TUNNEL__, -}); diff --git a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/src/router.tsx b/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/src/router.tsx deleted file mode 100644 index 670b22bc688d..000000000000 --- a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/src/router.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import * as Sentry from '@sentry/tanstackstart-react'; -import { createRouter } from '@tanstack/react-router'; -import { routeTree } from './routeTree.gen'; - -export const getRouter = () => { - const router = createRouter({ - routeTree, - scrollRestoration: true, - }); - - if (!router.isServer) { - Sentry.addIntegration(Sentry.tanstackRouterBrowserTracingIntegration(router)); - } - - return router; -}; diff --git a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/src/routes/__root.tsx b/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/src/routes/__root.tsx deleted file mode 100644 index 04716c61f3b6..000000000000 --- a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/src/routes/__root.tsx +++ /dev/null @@ -1,42 +0,0 @@ -import { type ReactNode } from 'react'; -import { Outlet, createRootRoute, HeadContent, Scripts } from '@tanstack/react-router'; - -export const Route = createRootRoute({ - head: () => ({ - meta: [ - { - charSet: 'utf-8', - }, - { - name: 'viewport', - content: 'width=device-width, initial-scale=1', - }, - { - title: 'TanStack Start Orchestrion', - }, - ], - }), - component: RootComponent, -}); - -function RootComponent() { - return ( - - - - ); -} - -function RootDocument({ children }: Readonly<{ children: ReactNode }>) { - return ( - - - - - - {children} - - - - ); -} diff --git a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/src/routes/index.tsx b/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/src/routes/index.tsx deleted file mode 100644 index 70a2dec4e190..000000000000 --- a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/src/routes/index.tsx +++ /dev/null @@ -1,9 +0,0 @@ -import { createFileRoute } from '@tanstack/react-router'; - -export const Route = createFileRoute('/')({ - component: Home, -}); - -function Home() { - return
TanStack Start orchestrion e2e app
; -} diff --git a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/src/server.ts b/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/src/server.ts deleted file mode 100644 index b10a3bc1e37b..000000000000 --- a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/src/server.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { wrapFetchWithSentry } from '@sentry/tanstackstart-react'; - -import handler, { createServerEntry } from '@tanstack/react-start/server-entry'; -import type { ServerEntry } from '@tanstack/react-start/server-entry'; - -const requestHandler: ServerEntry = wrapFetchWithSentry({ - fetch(request: Request) { - return handler.fetch(request); - }, -}); - -export default createServerEntry(requestHandler); diff --git a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/src/start.ts b/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/src/start.ts deleted file mode 100644 index 719869f235ef..000000000000 --- a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/src/start.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { sentryGlobalFunctionMiddleware, sentryGlobalRequestMiddleware } from '@sentry/tanstackstart-react'; -import { createStart } from '@tanstack/react-start'; - -export const startInstance = createStart(() => { - return { - requestMiddleware: [sentryGlobalRequestMiddleware], - functionMiddleware: [sentryGlobalFunctionMiddleware], - }; -}); diff --git a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/start-event-proxy.mjs b/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/start-event-proxy.mjs deleted file mode 100644 index f04ee5bc54ab..000000000000 --- a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/start-event-proxy.mjs +++ /dev/null @@ -1,6 +0,0 @@ -import { startEventProxyServer } from '@sentry-internal/test-utils'; - -startEventProxyServer({ - port: 3031, - proxyServerName: 'tanstackstart-react-orchestrion', -}); diff --git a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/tsconfig.json b/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/tsconfig.json deleted file mode 100644 index 5dcdb1fa6f4a..000000000000 --- a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/tsconfig.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2022", - "useDefineForClassFields": true, - "lib": ["ES2022", "DOM", "DOM.Iterable"], - "module": "ESNext", - "skipLibCheck": true, - - /* Bundler mode */ - "moduleResolution": "bundler", - "allowImportingTsExtensions": true, - "resolveJsonModule": true, - "isolatedModules": true, - "noEmit": true, - "jsx": "react-jsx", - - /* Linting */ - "strict": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noFallthroughCasesInSwitch": true, - "strictNullChecks": true - }, - "include": ["src"], - "references": [{ "path": "./tsconfig.node.json" }] -} diff --git a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/tsconfig.node.json b/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/tsconfig.node.json deleted file mode 100644 index 97ede7ee6f2d..000000000000 --- a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/tsconfig.node.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "compilerOptions": { - "composite": true, - "skipLibCheck": true, - "module": "ESNext", - "moduleResolution": "bundler", - "allowSyntheticDefaultImports": true, - "strict": true - }, - "include": ["vite.config.ts"] -} diff --git a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/vite.config.ts b/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/vite.config.ts deleted file mode 100644 index 2821a3eb25f7..000000000000 --- a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/vite.config.ts +++ /dev/null @@ -1,31 +0,0 @@ -import { defineConfig } from 'vite'; -import tsConfigPaths from 'vite-tsconfig-paths'; -import { tanstackStart } from '@tanstack/react-start/plugin/vite'; -import viteReact from '@vitejs/plugin-react-swc'; -import { nitro } from 'nitro/vite'; -import { sentryTanstackStart } from '@sentry/tanstackstart-react/vite'; - -const appDsn = 'http://public@localhost:3031/1337'; - -export default defineConfig({ - server: { - port: 3000, - }, - define: { - __APP_DSN__: JSON.stringify(appDsn), - __APP_TUNNEL__: JSON.stringify('http://localhost:3031/'), - }, - plugins: [ - tsConfigPaths(), - tanstackStart(), - nitro(), - // react's vite plugin must come after start's vite plugin - viteReact(), - sentryTanstackStart({ - org: process.env.E2E_TEST_SENTRY_ORG_SLUG, - project: process.env.E2E_TEST_SENTRY_PROJECT, - authToken: process.env.E2E_TEST_AUTH_TOKEN, - debug: true, - }), - ], -}); diff --git a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/docker-compose.yml b/dev-packages/e2e-tests/test-applications/tanstackstart-react/docker-compose.yml similarity index 84% rename from dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/docker-compose.yml rename to dev-packages/e2e-tests/test-applications/tanstackstart-react/docker-compose.yml index 011bed846445..115d46dd4785 100644 --- a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/docker-compose.yml +++ b/dev-packages/e2e-tests/test-applications/tanstackstart-react/docker-compose.yml @@ -2,7 +2,7 @@ services: db: image: mysql:8.0 restart: always - container_name: e2e-tests-tanstackstart-react-orchestrion-mysql + container_name: e2e-tests-tanstackstart-react-mysql # The `mysql` 2.x driver doesn't speak MySQL 8's default # `caching_sha2_password` auth, so force the legacy plugin. command: ['--default-authentication-plugin=mysql_native_password'] @@ -20,7 +20,7 @@ services: redis: image: redis:7 restart: always - container_name: e2e-tests-tanstackstart-react-orchestrion-redis + container_name: e2e-tests-tanstackstart-react-redis ports: - '6379:6379' healthcheck: diff --git a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/global-setup.mjs b/dev-packages/e2e-tests/test-applications/tanstackstart-react/global-setup.mjs similarity index 100% rename from dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/global-setup.mjs rename to dev-packages/e2e-tests/test-applications/tanstackstart-react/global-setup.mjs diff --git a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/global-teardown.mjs b/dev-packages/e2e-tests/test-applications/tanstackstart-react/global-teardown.mjs similarity index 100% rename from dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/global-teardown.mjs rename to dev-packages/e2e-tests/test-applications/tanstackstart-react/global-teardown.mjs diff --git a/dev-packages/e2e-tests/test-applications/tanstackstart-react/package.json b/dev-packages/e2e-tests/test-applications/tanstackstart-react/package.json index 76ffca39ab99..008fd3a57814 100644 --- a/dev-packages/e2e-tests/test-applications/tanstackstart-react/package.json +++ b/dev-packages/e2e-tests/test-applications/tanstackstart-react/package.json @@ -22,13 +22,16 @@ "test:assert:tunnel-custom": "E2E_TEST_CUSTOM_TUNNEL_ROUTE=1 pnpm test", "test:assert:tunnel-object": "E2E_TEST_TUNNEL_ROUTE_MODE=object E2E_TEST_DSN=http://public@localhost:3031/1337 pnpm test" }, + "//": "Need to use ioredis 5.10.1 because that's the last version before they support tracing channels", "dependencies": { "@sentry/tanstackstart-react": "file:../../packed/sentry-tanstackstart-react-packed.tgz", "@tanstack/react-start": "^1.136.0", "@tanstack/react-router": "^1.136.0", "react": "^19.2.0", "react-dom": "^19.2.0", - "nitro": "latest || *" + "nitro": "latest || *", + "ioredis": "5.10.1", + "mysql": "^2.18.1" }, "devDependencies": { "@types/react": "^19.2.0", diff --git a/dev-packages/e2e-tests/test-applications/tanstackstart-react/playwright.config.mjs b/dev-packages/e2e-tests/test-applications/tanstackstart-react/playwright.config.mjs index 4ca3c24e7fda..b9428806d14d 100644 --- a/dev-packages/e2e-tests/test-applications/tanstackstart-react/playwright.config.mjs +++ b/dev-packages/e2e-tests/test-applications/tanstackstart-react/playwright.config.mjs @@ -1,8 +1,19 @@ import { getPlaywrightConfig } from '@sentry-internal/test-utils'; +// The DB driver tests only run in the default (proxy) variant, so the tunnel-route variants don't +// need MySQL/Redis — skip Docker there instead of booting the containers once per variant. +const usesManagedTunnelRoute = + (process.env.E2E_TEST_TUNNEL_ROUTE_MODE ?? 'off') !== 'off' || process.env.E2E_TEST_CUSTOM_TUNNEL_ROUTE === '1'; + const config = getPlaywrightConfig({ startCommand: `pnpm start`, port: 3000, }); -export default config; +export default usesManagedTunnelRoute + ? config + : { + ...config, + globalSetup: './global-setup.mjs', + globalTeardown: './global-teardown.mjs', + }; diff --git a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/src/routes/api.db-ioredis.ts b/dev-packages/e2e-tests/test-applications/tanstackstart-react/src/routes/api.db-ioredis.ts similarity index 100% rename from dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/src/routes/api.db-ioredis.ts rename to dev-packages/e2e-tests/test-applications/tanstackstart-react/src/routes/api.db-ioredis.ts diff --git a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/src/routes/api.db-mysql.ts b/dev-packages/e2e-tests/test-applications/tanstackstart-react/src/routes/api.db-mysql.ts similarity index 100% rename from dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/src/routes/api.db-mysql.ts rename to dev-packages/e2e-tests/test-applications/tanstackstart-react/src/routes/api.db-mysql.ts diff --git a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/tests/db.test.ts b/dev-packages/e2e-tests/test-applications/tanstackstart-react/tests/db-drivers.test.ts similarity index 77% rename from dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/tests/db.test.ts rename to dev-packages/e2e-tests/test-applications/tanstackstart-react/tests/db-drivers.test.ts index 51dc9db584cf..7fb3242a165a 100644 --- a/dev-packages/e2e-tests/test-applications/tanstackstart-react-orchestrion/tests/db.test.ts +++ b/dev-packages/e2e-tests/test-applications/tanstackstart-react/tests/db-drivers.test.ts @@ -1,8 +1,16 @@ import { expect, test } from '@playwright/test'; import { waitForTransaction } from '@sentry-internal/test-utils'; -test('Instruments ioredis automatically via orchestrion', async ({ baseURL }) => { - const transactionEventPromise = waitForTransaction('tanstackstart-react-orchestrion', transactionEvent => { +const usesManagedTunnelRoute = + (process.env.E2E_TEST_TUNNEL_ROUTE_MODE ?? 'off') !== 'off' || process.env.E2E_TEST_CUSTOM_TUNNEL_ROUTE === '1'; + +test.skip(usesManagedTunnelRoute, 'Default e2e suites run only in the proxy variant'); + +// `sentryTanstackStart()` auto-wires the orchestrion build-time transform, which injects +// `diagnostics_channel` publishers into these drivers as Vite bundles the server. That only +// happens in the production build, which is what the e2e app runs. +test('Instruments ioredis automatically', async ({ baseURL }) => { + const transactionEventPromise = waitForTransaction('tanstackstart-react', transactionEvent => { return ( transactionEvent.contexts?.trace?.op === 'http.server' && transactionEvent.transaction === 'GET /api/db-ioredis' ); @@ -40,8 +48,8 @@ test('Instruments ioredis automatically via orchestrion', async ({ baseURL }) => ); }); -test('Instruments mysql automatically via orchestrion', async ({ baseURL }) => { - const transactionEventPromise = waitForTransaction('tanstackstart-react-orchestrion', transactionEvent => { +test('Instruments mysql automatically', async ({ baseURL }) => { + const transactionEventPromise = waitForTransaction('tanstackstart-react', transactionEvent => { return ( transactionEvent.contexts?.trace?.op === 'http.server' && transactionEvent.transaction === 'GET /api/db-mysql' );