Skip to content

test(remix): Run both otel and legacy integration tests on CI #12983

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@ import { uuid4 } from '@sentry/utils';

import { waitForTransaction } from '@sentry-internal/test-utils';

test.describe.configure({ mode: 'serial' });

test('Sends parameterized transaction name to Sentry', async ({ page }) => {
const transactionPromise = waitForTransaction('create-remix-app-express-legacy', transactionEvent => {
return transactionEvent.contexts?.trace?.op === 'http.server';
});

await page.goto('/user/123');

const transaction = await transactionPromise;

expect(transaction).toBeDefined();
expect(transaction.transaction).toBe('routes/user.$id');
});

test('Sends form data with action span to Sentry', async ({ page }) => {
await page.goto('/action-formdata');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@ import { uuid4 } from '@sentry/utils';

import { waitForTransaction } from '@sentry-internal/test-utils';

test.describe.configure({ mode: 'serial' });

test('Sends parameterized transaction name to Sentry', async ({ page }) => {
const transactionPromise = waitForTransaction('create-remix-app-express-vite-dev', transactionEvent => {
return transactionEvent.contexts?.trace?.op === 'http.server';
});

await page.goto('/user/123');

const transaction = await transactionPromise;

expect(transaction).toBeDefined();
expect(transaction.transaction).toBe('GET user/:id');
});

test('Sends two linked transactions (server & client) to Sentry', async ({ page }) => {
// We use this to identify the transactions
const testTag = uuid4();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@ import { uuid4 } from '@sentry/utils';

import { waitForTransaction } from '@sentry-internal/test-utils';

test.describe.configure({ mode: 'serial' });

test('Sends parameterized transaction name to Sentry', async ({ page }) => {
const transactionPromise = waitForTransaction('create-remix-app-express', transactionEvent => {
return transactionEvent.contexts?.trace?.op === 'http.server';
});

await page.goto('/user/123');

const transaction = await transactionPromise;

expect(transaction).toBeDefined();
expect(transaction.transaction).toBe('GET user/:id');
});

test('Sends form data with action span', async ({ page }) => {
await page.goto('/action-formdata');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@ import { uuid4 } from '@sentry/utils';

import { waitForTransaction } from '@sentry-internal/test-utils';

test.describe.configure({ mode: 'serial' });

test('Sends parameterized transaction name to Sentry', async ({ page }) => {
const transactionPromise = waitForTransaction('create-remix-app-legacy', transactionEvent => {
return transactionEvent.contexts?.trace?.op === 'http.server';
});

await page.goto('/user/123');

const transaction = await transactionPromise;

expect(transaction).toBeDefined();
expect(transaction.transaction).toBe('routes/user.$id');
});

test('Sends two linked transactions (server & client) to Sentry', async ({ page }) => {
// We use this to identify the transactions
const testTag = uuid4();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@ import { uuid4 } from '@sentry/utils';

import { waitForTransaction } from '@sentry-internal/test-utils';

test.describe.configure({ mode: 'serial' });

test('Sends parameterized transaction name to Sentry', async ({ page }) => {
const transactionPromise = waitForTransaction('create-remix-app-v2-legacy', transactionEvent => {
return transactionEvent.contexts?.trace?.op === 'http.server';
});

await page.goto('/user/123');

const transaction = await transactionPromise;

expect(transaction).toBeDefined();
expect(transaction.transaction).toBe('routes/user.$id');
});

test('Sends two linked transactions (server & client) to Sentry', async ({ page }) => {
// We use this to identify the transactions
const testTag = uuid4();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@ import { uuid4 } from '@sentry/utils';

import { waitForTransaction } from '@sentry-internal/test-utils';

test.describe.configure({ mode: 'serial' });

test('Sends parameterized transaction name to Sentry', async ({ page }) => {
const transactionPromise = waitForTransaction('create-remix-app-v2', transactionEvent => {
return transactionEvent.contexts?.trace?.op === 'http.server';
});

await page.goto('/user/123');

const transaction = await transactionPromise;

expect(transaction).toBeDefined();
expect(transaction.transaction).toBe('GET user/:id');
});

test('Sends two linked transactions (server & client) to Sentry', async ({ page }) => {
// We use this to identify the transactions
const testTag = uuid4();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@ import { uuid4 } from '@sentry/utils';

import { waitForTransaction } from '@sentry-internal/test-utils';

test.describe.configure({ mode: 'serial' });

test('Sends parameterized transaction name to Sentry', async ({ page }) => {
const transactionPromise = waitForTransaction('create-remix-app', transactionEvent => {
return transactionEvent.contexts?.trace?.op === 'http.server';
});

await page.goto('/user/123');

const transaction = await transactionPromise;

expect(transaction).toBeDefined();
expect(transaction.transaction).toBe('GET user/:id');
});

test('Sends two linked transactions (server & client) to Sentry', async ({ page }) => {
// We use this to identify the transactions
const testTag = uuid4();
Expand Down
7 changes: 5 additions & 2 deletions packages/remix/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,11 @@
"test:integration:otel": "export USE_OTEL=1 && run-s test:integration:v1 test:integration:v2",
"test:integration:legacy": "export USE_OTEL=0 && run-s test:integration:v1 test:integration:v2",
"test:integration:v1": "run-s test:integration:clean test:integration:prepare test:integration:client test:integration:server",
"test:integration:v2": "export REMIX_VERSION=2 && run-s test:integration:v1",
"test:integration:ci": "run-s test:integration:clean test:integration:prepare test:integration:client:ci test:integration:server",
"test:integration:v2": "export REMIX_VERSION=2 && yarn test:integration:v1",
"test:integration:ci": "run-s test:integration:ci:otel test:integration:ci:legacy",
"test:integration:ci:otel": "USE_OTEL=1 yarn test:integration:ci:common",
"test:integration:ci:legacy": "USE_OTEL=0 yarn test:integration:ci:common",
"test:integration:ci:common": "run-s test:integration:clean test:integration:prepare test:integration:client:ci test:integration:server",
"test:integration:prepare": "(cd test/integration && yarn install)",
"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/ --project='chromium'",
Expand Down
Loading