diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a1104619db12..d36639039e72 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1051,7 +1051,6 @@ jobs: 'react-create-hash-router', 'react-router-6-use-routes', 'standard-frontend-react', - 'standard-frontend-react-tracing-import', 'sveltekit', 'sveltekit-2', 'generic-ts3.8', diff --git a/dev-packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/.gitignore b/dev-packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/.gitignore deleted file mode 100644 index 84634c973eeb..000000000000 --- a/dev-packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/.gitignore +++ /dev/null @@ -1,29 +0,0 @@ -# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. - -# dependencies -/node_modules -/.pnp -.pnp.js - -# testing -/coverage - -# production -/build - -# misc -.DS_Store -.env.local -.env.development.local -.env.test.local -.env.production.local - -npm-debug.log* -yarn-debug.log* -yarn-error.log* - -/test-results/ -/playwright-report/ -/playwright/.cache/ - -!*.d.ts diff --git a/dev-packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/.npmrc b/dev-packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/.npmrc deleted file mode 100644 index 070f80f05092..000000000000 --- a/dev-packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/.npmrc +++ /dev/null @@ -1,2 +0,0 @@ -@sentry:registry=http://127.0.0.1:4873 -@sentry-internal:registry=http://127.0.0.1:4873 diff --git a/dev-packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/package.json b/dev-packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/package.json deleted file mode 100644 index cde5ad8225ee..000000000000 --- a/dev-packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/package.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "name": "standard-frontend-react-tracing-import-test", - "version": "0.1.0", - "private": true, - "dependencies": { - "@sentry/react": "latest || *", - "@testing-library/jest-dom": "5.14.1", - "@testing-library/react": "13.0.0", - "@testing-library/user-event": "13.2.1", - "@types/jest": "27.0.1", - "@types/node": "16.7.13", - "@types/react": "18.0.0", - "@types/react-dom": "18.0.0", - "react": "18.2.0", - "react-dom": "18.2.0", - "react-router-dom": "^6.4.1", - "react-scripts": "5.0.1", - "typescript": "4.9.5", - "web-vitals": "2.1.0" - }, - "scripts": { - "build": "react-scripts build", - "start": "serve -s build", - "test": "playwright test", - "clean": "npx rimraf node_modules,pnpm-lock.yaml", - "test:build": "pnpm install && npx playwright install && pnpm build", - "test:assert": "pnpm test" - }, - "eslintConfig": { - "extends": [ - "react-app", - "react-app/jest" - ] - }, - "browserslist": { - "production": [ - ">0.2%", - "not dead", - "not op_mini all" - ], - "development": [ - "last 1 chrome version", - "last 1 firefox version", - "last 1 safari version" - ] - }, - "devDependencies": { - "@playwright/test": "1.26.1", - "axios": "1.6.0", - "serve": "14.0.1" - }, - "volta": { - "extends": "../../package.json" - } -} diff --git a/dev-packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/playwright.config.ts b/dev-packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/playwright.config.ts deleted file mode 100644 index 5f93f826ebf0..000000000000 --- a/dev-packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/playwright.config.ts +++ /dev/null @@ -1,70 +0,0 @@ -import type { PlaywrightTestConfig } from '@playwright/test'; -import { devices } from '@playwright/test'; - -/** - * See https://playwright.dev/docs/test-configuration. - */ -const config: PlaywrightTestConfig = { - testDir: './tests', - /* Maximum time one test can run for. */ - timeout: 150_000, - expect: { - /** - * Maximum time expect() should wait for the condition to be met. - * For example in `await expect(locator).toHaveText();` - */ - timeout: 5000, - }, - /* Run tests in files in parallel */ - fullyParallel: true, - /* Fail the build on CI if you accidentally left test.only in the source code. */ - forbidOnly: !!process.env.CI, - /* Retry on CI only */ - retries: 0, - /* Opt out of parallel tests on CI. */ - workers: 1, - /* Reporter to use. See https://playwright.dev/docs/test-reporters */ - reporter: 'list', - /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ - use: { - /* Maximum time each action such as `click()` can take. Defaults to 0 (no limit). */ - actionTimeout: 0, - - /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ - trace: 'on-first-retry', - }, - - /* Configure projects for major browsers */ - projects: [ - { - name: 'chromium', - use: { - ...devices['Desktop Chrome'], - }, - }, - // For now we only test Chrome! - // { - // name: 'firefox', - // use: { - // ...devices['Desktop Firefox'], - // }, - // }, - // { - // name: 'webkit', - // use: { - // ...devices['Desktop Safari'], - // }, - // }, - ], - - /* Run your local dev server before starting the tests */ - webServer: { - command: 'pnpm start', - port: 3030, - env: { - PORT: '3030', - }, - }, -}; - -export default config; diff --git a/dev-packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/public/index.html b/dev-packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/public/index.html deleted file mode 100644 index 39da76522bea..000000000000 --- a/dev-packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/public/index.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - React App - - - -
- - - diff --git a/dev-packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/src/globals.d.ts b/dev-packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/src/globals.d.ts deleted file mode 100644 index 109dbcd55648..000000000000 --- a/dev-packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/src/globals.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -interface Window { - recordedTransactions?: string[]; - capturedExceptionId?: string; -} diff --git a/dev-packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/src/index.tsx b/dev-packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/src/index.tsx deleted file mode 100644 index 319290d010ce..000000000000 --- a/dev-packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/src/index.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import * as Sentry from '@sentry/react'; -import React from 'react'; -import ReactDOM from 'react-dom/client'; -import { - BrowserRouter, - Route, - Routes, - createRoutesFromChildren, - matchRoutes, - useLocation, - useNavigationType, -} from 'react-router-dom'; -import Index from './pages/Index'; -import User from './pages/User'; - -Sentry.init({ - environment: 'qa', // dynamic sampling bias to keep transactions - dsn: process.env.REACT_APP_E2E_TEST_DSN, - integrations: [ - Sentry.reactRouterV6BrowserTracingIntegration({ - useEffect: React.useEffect, - useLocation, - useNavigationType, - createRoutesFromChildren, - matchRoutes, - }), - ], - // We recommend adjusting this value in production, or using tracesSampler - // for finer control - tracesSampleRate: 1.0, - release: 'e2e-test', -}); - -Sentry.addEventProcessor(event => { - if ( - event.type === 'transaction' && - (event.contexts?.trace?.op === 'pageload' || event.contexts?.trace?.op === 'navigation') - ) { - const eventId = event.event_id; - if (eventId) { - window.recordedTransactions = window.recordedTransactions || []; - window.recordedTransactions.push(eventId); - } - } - - return event; -}); - -const SentryRoutes = Sentry.withSentryReactRouterV6Routing(Routes); - -const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement); -root.render( - - - } /> - } /> - - , -); diff --git a/dev-packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/src/pages/Index.tsx b/dev-packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/src/pages/Index.tsx deleted file mode 100644 index 7789a2773224..000000000000 --- a/dev-packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/src/pages/Index.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import * as Sentry from '@sentry/react'; -// biome-ignore lint/nursery/noUnusedImports: Need React import for JSX -import * as React from 'react'; -import { Link } from 'react-router-dom'; - -const Index = () => { - return ( - <> - { - const eventId = Sentry.captureException(new Error('I am an error!')); - window.capturedExceptionId = eventId; - }} - /> - - navigate - - - ); -}; - -export default Index; diff --git a/dev-packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/src/pages/User.tsx b/dev-packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/src/pages/User.tsx deleted file mode 100644 index 62f0c2d17533..000000000000 --- a/dev-packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/src/pages/User.tsx +++ /dev/null @@ -1,8 +0,0 @@ -// biome-ignore lint/nursery/noUnusedImports: Need React import for JSX -import * as React from 'react'; - -const User = () => { - return

I am a blank page :)

; -}; - -export default User; diff --git a/dev-packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/src/react-app-env.d.ts b/dev-packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/src/react-app-env.d.ts deleted file mode 100644 index 6431bc5fc6b2..000000000000 --- a/dev-packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/src/react-app-env.d.ts +++ /dev/null @@ -1 +0,0 @@ -/// diff --git a/dev-packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/tests/behaviour-test.spec.ts b/dev-packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/tests/behaviour-test.spec.ts deleted file mode 100644 index 2e68363ab61a..000000000000 --- a/dev-packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/tests/behaviour-test.spec.ts +++ /dev/null @@ -1,132 +0,0 @@ -import { expect, test } from '@playwright/test'; -import axios, { AxiosError } from 'axios'; - -const EVENT_POLLING_TIMEOUT = 90_000; - -const authToken = process.env.E2E_TEST_AUTH_TOKEN; -const sentryTestOrgSlug = process.env.E2E_TEST_SENTRY_ORG_SLUG; -const sentryTestProject = process.env.E2E_TEST_SENTRY_TEST_PROJECT; - -test('Sends a pageload transaction to Sentry', async ({ page }) => { - await page.goto('/'); - - const recordedTransactionsHandle = await page.waitForFunction(() => { - if (window.recordedTransactions && window.recordedTransactions?.length >= 1) { - return window.recordedTransactions; - } else { - return undefined; - } - }); - const recordedTransactionEventIds = await recordedTransactionsHandle.jsonValue(); - - if (recordedTransactionEventIds === undefined) { - throw new Error("Application didn't record any transaction event IDs."); - } - - let hadPageLoadTransaction = false; - - console.log(`Polling for transaction eventIds: ${JSON.stringify(recordedTransactionEventIds)}`); - - await Promise.all( - recordedTransactionEventIds.map(async transactionEventId => { - await expect - .poll( - async () => { - try { - const response = await axios.get( - `https://sentry.io/api/0/projects/${sentryTestOrgSlug}/${sentryTestProject}/events/${transactionEventId}/`, - { headers: { Authorization: `Bearer ${authToken}` } }, - ); - - if (response.data.contexts.trace.op === 'pageload') { - hadPageLoadTransaction = true; - } - - return response.status; - } catch (e) { - if (e instanceof AxiosError && e.response) { - if (e.response.status !== 404) { - throw e; - } else { - return e.response.status; - } - } else { - throw e; - } - } - }, - { - timeout: EVENT_POLLING_TIMEOUT, - }, - ) - .toBe(200); - }), - ); - - expect(hadPageLoadTransaction).toBe(true); -}); - -test('Sends a navigation transaction to Sentry', async ({ page }) => { - await page.goto('/'); - - // Give pageload transaction time to finish - page.waitForTimeout(4000); - - const linkElement = page.locator('id=navigation'); - await linkElement.click(); - - const recordedTransactionsHandle = await page.waitForFunction(() => { - if (window.recordedTransactions && window.recordedTransactions?.length >= 2) { - return window.recordedTransactions; - } else { - return undefined; - } - }); - const recordedTransactionEventIds = await recordedTransactionsHandle.jsonValue(); - - if (recordedTransactionEventIds === undefined) { - throw new Error("Application didn't record any transaction event IDs."); - } - - let hadPageNavigationTransaction = false; - - console.log(`Polling for transaction eventIds: ${JSON.stringify(recordedTransactionEventIds)}`); - - await Promise.all( - recordedTransactionEventIds.map(async transactionEventId => { - await expect - .poll( - async () => { - try { - const response = await axios.get( - `https://sentry.io/api/0/projects/${sentryTestOrgSlug}/${sentryTestProject}/events/${transactionEventId}/`, - { headers: { Authorization: `Bearer ${authToken}` } }, - ); - - if (response.data.contexts.trace.op === 'navigation') { - hadPageNavigationTransaction = true; - } - - return response.status; - } catch (e) { - if (e instanceof AxiosError && e.response) { - if (e.response.status !== 404) { - throw e; - } else { - return e.response.status; - } - } else { - throw e; - } - } - }, - { - timeout: EVENT_POLLING_TIMEOUT, - }, - ) - .toBe(200); - }), - ); - - expect(hadPageNavigationTransaction).toBe(true); -}); diff --git a/dev-packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/tsconfig.json b/dev-packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/tsconfig.json deleted file mode 100644 index 75ae036f46b0..000000000000 --- a/dev-packages/e2e-tests/test-applications/standard-frontend-react-tracing-import/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "compilerOptions": { - "target": "es2017", - "lib": ["dom", "dom.iterable", "esnext"], - "allowJs": true, - "skipLibCheck": true, - "esModuleInterop": true, - "allowSyntheticDefaultImports": true, - "strict": true, - "forceConsistentCasingInFileNames": true, - "noFallthroughCasesInSwitch": true, - "module": "esnext", - "moduleResolution": "node", - "resolveJsonModule": true, - "isolatedModules": true, - "noEmit": true, - "jsx": "react" - }, - "include": ["src", "tests"] -}