From 26a00f8660b9dfeb2f634a30fe979a4adff8dee4 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Thu, 27 Jul 2023 09:46:11 -0400 Subject: [PATCH 1/2] test(remix): Skip all firefox tests --- packages/remix/playwright.config.ts | 16 ++++++++++ .../integration/test/client/meta-tags.test.ts | 32 ++----------------- .../integration/test/client/pageload.test.ts | 7 +--- 3 files changed, 19 insertions(+), 36 deletions(-) diff --git a/packages/remix/playwright.config.ts b/packages/remix/playwright.config.ts index 63de33ff74ed..b75f865d9518 100644 --- a/packages/remix/playwright.config.ts +++ b/packages/remix/playwright.config.ts @@ -1,4 +1,5 @@ import type { PlaywrightTestConfig } from '@playwright/test'; +import { devices } from '@playwright/test'; const config: PlaywrightTestConfig = { retries: 0, @@ -14,6 +15,21 @@ const config: PlaywrightTestConfig = { command: '(cd test/integration/ && yarn build && yarn start)', port: 3000, }, + projects: [ + { + name: 'chromium', + use: devices['Desktop Chrome'], + }, + { + name: 'webkit', + use: devices['Desktop Safari'], + }, + { + name: 'firefox', + grep: /@firefox/i, + use: devices['Desktop Firefox'], + }, + ], }; export default config; diff --git a/packages/remix/test/integration/test/client/meta-tags.test.ts b/packages/remix/test/integration/test/client/meta-tags.test.ts index 6d0a0cd06307..2ca07ba23fd5 100644 --- a/packages/remix/test/integration/test/client/meta-tags.test.ts +++ b/packages/remix/test/integration/test/client/meta-tags.test.ts @@ -2,13 +2,7 @@ import { test, expect } from '@playwright/test'; import { getFirstSentryEnvelopeRequest } from './utils/helpers'; import { Event } from '@sentry/types'; -test('should inject `sentry-trace` and `baggage` meta tags inside the root page.', async ({ page, browserName }) => { - // This test is flaky on firefox - // https://github.com/getsentry/sentry-javascript/issues/8398 - if (browserName === 'firefox') { - test.skip(); - } - +test('should inject `sentry-trace` and `baggage` meta tags inside the root page.', async ({ page }) => { await page.goto('/'); const sentryTraceTag = await page.$('meta[name="sentry-trace"]'); @@ -22,16 +16,7 @@ test('should inject `sentry-trace` and `baggage` meta tags inside the root page. expect(sentryBaggageContent).toEqual(expect.any(String)); }); -test('should inject `sentry-trace` and `baggage` meta tags inside a parameterized route.', async ({ - page, - browserName, -}) => { - // This test is flaky on firefox - // https://github.com/getsentry/sentry-javascript/issues/8398 - if (browserName === 'firefox') { - test.skip(); - } - +test('should inject `sentry-trace` and `baggage` meta tags inside a parameterized route.', async ({ page }) => { await page.goto('/loader-json-response/0'); const sentryTraceTag = await page.$('meta[name="sentry-trace"]'); @@ -49,12 +34,6 @@ test('should send transactions with corresponding `sentry-trace` and `baggage` i page, browserName, }) => { - // This test is flaky on firefox - // https://github.com/getsentry/sentry-javascript/issues/8398 - if (browserName === 'firefox') { - test.skip(); - } - const envelope = await getFirstSentryEnvelopeRequest(page, '/'); const sentryTraceTag = await page.$('meta[name="sentry-trace"]'); @@ -71,14 +50,7 @@ test('should send transactions with corresponding `sentry-trace` and `baggage` i test('should send transactions with corresponding `sentry-trace` and `baggage` inside a parameterized route', async ({ page, - browserName, }) => { - // This test is flaky on firefox - // https://github.com/getsentry/sentry-javascript/issues/8398 - if (browserName === 'firefox') { - test.skip(); - } - const envelope = await getFirstSentryEnvelopeRequest(page, '/loader-json-response/0'); const sentryTraceTag = await page.$('meta[name="sentry-trace"]'); diff --git a/packages/remix/test/integration/test/client/pageload.test.ts b/packages/remix/test/integration/test/client/pageload.test.ts index 59a8e331668e..7c49e4ac9c8c 100644 --- a/packages/remix/test/integration/test/client/pageload.test.ts +++ b/packages/remix/test/integration/test/client/pageload.test.ts @@ -4,12 +4,7 @@ import { getFirstSentryEnvelopeRequest } from './utils/helpers'; import { test, expect } from '@playwright/test'; import { Event } from '@sentry/types'; -test('should add `pageload` transaction on load.', async ({ page, browserName }) => { - // This test is flaky on firefox - if (browserName === 'firefox') { - test.skip(); - } - +test('should add `pageload` transaction on load.', async ({ page }) => { const envelope = await getFirstSentryEnvelopeRequest(page, '/'); expect(envelope.contexts?.trace.op).toBe('pageload'); From 2273d1490c70a2edfdcf22e33bacb47f8197dd07 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Thu, 27 Jul 2023 10:22:20 -0400 Subject: [PATCH 2/2] run properly in CI --- packages/remix/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/remix/package.json b/packages/remix/package.json index a86df4ef8a32..f24e7040230d 100644 --- a/packages/remix/package.json +++ b/packages/remix/package.json @@ -73,8 +73,8 @@ "test:integration:ci": "run-s test:integration:clean test:integration:prepare test:integration:client:ci test:integration:server", "test:integration:prepare": "(cd test/integration && yarn)", "test:integration:clean": "(cd test/integration && rimraf .cache node_modules build)", - "test:integration:client": "yarn playwright install-deps && yarn playwright test test/integration/test/client/", - "test:integration:client:ci": "yarn test:integration:client --browser='all' --reporter='line'", + "test:integration:client": "yarn playwright install-deps && yarn playwright test test/integration/test/client/ --project='chromium'", + "test:integration:client:ci": "yarn test:integration:client --reporter='line'", "test:integration:server": "export NODE_OPTIONS='--stack-trace-limit=25' && jest --config=test/integration/jest.config.js test/integration/test/server/", "test:unit": "jest", "test:watch": "jest --watch",