File tree Expand file tree Collapse file tree
dev-packages/e2e-tests/test-applications Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1111 "test:build" : " pnpm install && pnpm build" ,
1212 "test:assert" : " pnpm playwright test" ,
1313 "test:build:orchestrion" : " INJECT_ORCHESTRION=true pnpm test:build" ,
14- "test:assert:orchestrion" : " INJECT_ORCHESTRION=true pnpm test:assert"
14+ "test:assert:orchestrion" : " INJECT_ORCHESTRION=true pnpm test:assert && INJECT_ORCHESTRION=true TEST_ENV=development pnpm playwright test db "
1515 },
1616 "dependencies" : {
1717 "@sentry/remix" : " file:../../packed/sentry-remix-packed.tgz" ,
Original file line number Diff line number Diff line change @@ -3,9 +3,16 @@ import { fileURLToPath } from 'url';
33
44const injectOrchestrion = process . env . INJECT_ORCHESTRION === 'true' ;
55
6+ // `remix vite:dev` ignores PORT, so the port goes on the command. The dev server has no
7+ // bundle, so the SDK is loaded through `--import` the way `pnpm start` does it.
8+ const startCommand =
9+ process . env . TEST_ENV === 'development'
10+ ? `NODE_OPTIONS='--import=./instrument.server.cjs' pnpm dev --port 3030`
11+ : `pnpm start` ;
12+
613const config = getPlaywrightConfig (
714 {
8- startCommand : `pnpm start` ,
15+ startCommand,
916 } ,
1017 // The orchestrion variant exercises real MySQL/Redis. Boot them before the tests run,
1118 // outside the webServer startup-timeout window. In the default variant no DB is needed.
Original file line number Diff line number Diff line change 1+ // Dev-server counterpart of `src/instrument.server.ts`. `vinxi dev` produces no build output, so
2+ // there is no `.output/server/instrument.server.mjs` to `--import`; this file is loaded directly.
3+ import * as Sentry from '@sentry/solidstart' ;
4+
5+ Sentry . init ( {
6+ traceLifecycle : 'static' ,
7+ dsn : process . env . E2E_TEST_DSN ,
8+ environment : 'qa' , // dynamic sampling bias to keep transactions
9+ tracesSampleRate : 1.0 , // Capture 100% of the transactions
10+ tunnel : 'http://localhost:3031/' , // proxy server
11+ debug : ! ! process . env . DEBUG ,
12+ } ) ;
Original file line number Diff line number Diff line change 44 "scripts" : {
55 "clean" : " pnpx rimraf node_modules pnpm-lock.yaml .vinxi .output" ,
66 "build" : " vinxi build" ,
7+ "dev" : " vinxi dev" ,
78 "preview" : " HOST=localhost PORT=3030 vinxi start" ,
89 "start:import" : " HOST=localhost PORT=3030 node --import ./.output/server/instrument.server.mjs .output/server/index.mjs" ,
910 "test:prod" : " TEST_ENV=production playwright test" ,
1011 "test:build" : " pnpm install && pnpm build" ,
11- "test:assert" : " pnpm test:prod"
12+ "test:assert" : " pnpm test:prod && pnpm test:dev" ,
13+ "test:dev" : " TEST_ENV=development playwright test db"
1214 },
1315 "type" : " module" ,
1416 "dependencies" : {
Original file line number Diff line number Diff line change 11import { getPlaywrightConfig } from '@sentry-internal/test-utils' ;
22
3+ // `vinxi dev` ignores PORT, so the port goes on the command, and the SDK comes from the app's own
4+ // instrumentation file rather than the build output the production command uses.
5+ const startCommand =
6+ process . env . TEST_ENV === 'development'
7+ ? `NODE_OPTIONS='--import ./instrument.server.mjs' pnpm dev --port 3030`
8+ : 'pnpm start:import' ;
9+
310const config = getPlaywrightConfig ( {
4- startCommand : 'pnpm start:import' ,
11+ startCommand,
512 port : 3030 ,
613} ) ;
714
Original file line number Diff line number Diff line change 55 "type" : " module" ,
66 "scripts" : {
77 "build" : " vite build && cp instrument.server.mjs .output/server" ,
8+ "dev" : " vite dev" ,
89 "start" : " node --import ./.output/server/instrument.server.mjs .output/server/index.mjs" ,
910 "test" : " playwright test" ,
1011 "clean" : " npx rimraf node_modules pnpm-lock.yaml" ,
1415 "test:build:tunnel-custom" : " pnpm install && E2E_TEST_CUSTOM_TUNNEL_ROUTE=1 pnpm build" ,
1516 "test:build:tunnel-object" : " pnpm install && E2E_TEST_TUNNEL_ROUTE_MODE=object E2E_TEST_DSN=http://public@localhost:3031/1337 pnpm build" ,
1617 "test:build-latest" : " pnpm add @tanstack/react-start@latest @tanstack/react-router@latest && pnpm install && pnpm build" ,
17- "test:assert:proxy" : " pnpm test" ,
18+ "test:assert:proxy" : " pnpm test && TEST_ENV=development pnpm playwright test db-drivers " ,
1819 "test:assert" : " pnpm test:assert:proxy" ,
1920 "test:assert:tunnel-generated" : " E2E_TEST_TUNNEL_ROUTE_MODE=dynamic E2E_TEST_DSN=http://public@localhost:3031/1337 pnpm test" ,
2021 "test:assert:tunnel-streamed" : " E2E_TEST_TUNNEL_ROUTE_MODE=dynamic E2E_TEST_DSN=http://public@localhost:3031/1337 E2E_TEST_STREAMED_SPANS=1 pnpm test" ,
Original file line number Diff line number Diff line change @@ -5,8 +5,15 @@ import { getPlaywrightConfig } from '@sentry-internal/test-utils';
55const usesManagedTunnelRoute =
66 ( process . env . E2E_TEST_TUNNEL_ROUTE_MODE ?? 'off' ) !== 'off' || process . env . E2E_TEST_CUSTOM_TUNNEL_ROUTE === '1' ;
77
8+ // The dev server has no build output, so `--import` points at the app's own instrumentation file.
9+ // `vite dev` ignores PORT, so the port goes on the command.
10+ const startCommand =
11+ process . env . TEST_ENV === 'development'
12+ ? `NODE_OPTIONS='--import ./instrument.server.mjs' pnpm dev --port 3000`
13+ : `pnpm start` ;
14+
815const config = getPlaywrightConfig ( {
9- startCommand : `pnpm start` ,
16+ startCommand,
1017 port : 3000 ,
1118} ) ;
1219
Original file line number Diff line number Diff line change @@ -6,9 +6,9 @@ const usesManagedTunnelRoute =
66
77test . skip ( usesManagedTunnelRoute , 'Default e2e suites run only in the proxy variant' ) ;
88
9- // `sentryTanstackStart()` auto-wires the orchestrion build-time transform, which injects
10- // `diagnostics_channel` publishers into these drivers as Vite bundles the server. That only
11- // happens in the production build, which is what the e2e app runs .
9+ // Same spans in both runs, from two injectors: the orchestrion build-time transform that
10+ // `sentryTanstackStart()` auto-wires into the server bundle, and the runtime hook in `vite dev`,
11+ // where the drivers stay external on Node's own loader .
1212test ( 'Instruments ioredis automatically' , async ( { baseURL } ) => {
1313 const transactionEventPromise = waitForTransaction ( 'tanstackstart-react' , transactionEvent => {
1414 return (
You can’t perform that action at this time.
0 commit comments