Skip to content

Commit

Permalink
test: Streamline E2E test app names (#11828)
Browse files Browse the repository at this point in the history
No need to have the `-app` suffix there.
  • Loading branch information
mydea committed May 7, 2024
1 parent 29e89e1 commit 31d462e
Show file tree
Hide file tree
Showing 56 changed files with 59 additions and 60 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,7 @@ jobs:
[
'angular-17',
'cloudflare-astro',
'node-express-app',
'node-express',
'create-react-app',
'create-next-app',
'create-remix-app',
Expand All @@ -1015,13 +1015,12 @@ jobs:
'sveltekit-2',
'sveltekit-2-svelte-5',
'generic-ts3.8',
'node-fastify-app',
# TODO(v8): Re-enable hapi tests
'node-fastify',
'node-hapi',
'node-nestjs-app',
'node-nestjs',
'node-exports-test-app',
'node-koa-app',
'node-connect-app',
'node-koa',
'node-connect',
'vue-3',
'webpack-4',
'webpack-5'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "node-connect-app",
"name": "node-connect",
"version": "1.0.0",
"private": true,
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import { startEventProxyServer } from '@sentry-internal/event-proxy-server';

startEventProxyServer({
port: 3031,
proxyServerName: 'node-koa-app',
proxyServerName: 'node-connect',
});
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ test('Sends exception to Sentry', async ({ baseURL }) => {
});

test('Sends correct error event', async ({ baseURL }) => {
const errorEventPromise = waitForError('node-connect-app', event => {
const errorEventPromise = waitForError('node-connect', event => {
return !event.type && event.exception?.values?.[0]?.value === 'This is an exception';
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const sentryTestProject = process.env.E2E_TEST_SENTRY_TEST_PROJECT;
const EVENT_POLLING_TIMEOUT = 90_000;

test('Sends an API route transaction', async ({ baseURL }) => {
const pageloadTransactionEventPromise = waitForTransaction('node-connect-app', transactionEvent => {
const pageloadTransactionEventPromise = waitForTransaction('node-connect', transactionEvent => {
return (
transactionEvent?.contexts?.trace?.op === 'http.server' &&
transactionEvent?.transaction === 'GET /test-transaction'
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import { startEventProxyServer } from '@sentry-internal/event-proxy-server';

startEventProxyServer({
port: 3031,
proxyServerName: 'node-nestjs-app',
proxyServerName: 'node-express',
});
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ test('Sends exception to Sentry', async ({ baseURL }) => {
});

test('Sends correct error event', async ({ baseURL }) => {
const errorEventPromise = waitForError('node-express-app', event => {
const errorEventPromise = waitForError('node-express', event => {
return !event.type && event.exception?.values?.[0]?.value === 'This is an exception with id 123';
});

Expand Down Expand Up @@ -109,7 +109,7 @@ test('Should record caught exceptions with local variable', async ({ baseURL })
});

test('Should record uncaught exceptions with local variable', async ({ baseURL }) => {
const errorEventPromise = waitForError('node-express-app', errorEvent => {
const errorEventPromise = waitForError('node-express', errorEvent => {
return !!errorEvent?.exception?.values?.[0]?.value?.includes('Uncaught Local Variable Error');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { createTRPCProxyClient, httpBatchLink } from '@trpc/client';
import type { AppRouter } from '../src/app';

test('Should record span for trpc query', async ({ baseURL }) => {
const transactionEventPromise = waitForTransaction('node-express-app', transactionEvent => {
const transactionEventPromise = waitForTransaction('node-express', transactionEvent => {
return (
transactionEvent.transaction === 'GET /trpc' &&
!!transactionEvent.spans?.find(span => span.description === 'trpc/getSomething')
Expand Down Expand Up @@ -41,7 +41,7 @@ test('Should record span for trpc query', async ({ baseURL }) => {
});

test('Should record transaction for trpc mutation', async ({ baseURL }) => {
const transactionEventPromise = waitForTransaction('node-express-app', transactionEvent => {
const transactionEventPromise = waitForTransaction('node-express', transactionEvent => {
return (
transactionEvent.transaction === 'POST /trpc' &&
!!transactionEvent.spans?.find(span => span.description === 'trpc/createSomething')
Expand Down Expand Up @@ -77,14 +77,14 @@ test('Should record transaction for trpc mutation', async ({ baseURL }) => {
});

test('Should record transaction and error for a crashing trpc handler', async ({ baseURL }) => {
const transactionEventPromise = waitForTransaction('node-express-app', transactionEvent => {
const transactionEventPromise = waitForTransaction('node-express', transactionEvent => {
return (
transactionEvent.transaction === 'POST /trpc' &&
!!transactionEvent.spans?.find(span => span.description === 'trpc/crashSomething')
);
});

const errorEventPromise = waitForError('node-express-app', errorEvent => {
const errorEventPromise = waitForError('node-express', errorEvent => {
return !!errorEvent?.exception?.values?.some(exception => exception.value?.includes('I crashed in a trpc handler'));
});

Expand All @@ -103,14 +103,14 @@ test('Should record transaction and error for a crashing trpc handler', async ({
});

test('Should record transaction and error for a trpc handler that returns a status code', async ({ baseURL }) => {
const transactionEventPromise = waitForTransaction('node-express-app', transactionEvent => {
const transactionEventPromise = waitForTransaction('node-express', transactionEvent => {
return (
transactionEvent.transaction === 'POST /trpc' &&
!!transactionEvent.spans?.find(span => span.description === 'trpc/dontFindSomething')
);
});

const errorEventPromise = waitForError('node-express-app', errorEvent => {
const errorEventPromise = waitForError('node-express', errorEvent => {
return !!errorEvent?.exception?.values?.some(exception => exception.value?.includes('Page not found'));
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "node-fastify-app",
"name": "node-fastify",
"version": "1.0.0",
"private": true,
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import { startEventProxyServer } from '@sentry-internal/event-proxy-server';

startEventProxyServer({
port: 3031,
proxyServerName: 'node-connect-app',
proxyServerName: 'node-fastify',
});
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ test('Sends exception to Sentry', async ({ baseURL }) => {
});

test('Sends correct error event', async ({ baseURL }) => {
const errorEventPromise = waitForError('node-koa-app', event => {
const errorEventPromise = waitForError('node-fastify', event => {
return !event.type && event.exception?.values?.[0]?.value === 'This is an exception with id 123';
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import axios from 'axios';
test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
const id = crypto.randomUUID();

const inboundTransactionPromise = waitForTransaction('node-fastify-app', transactionEvent => {
const inboundTransactionPromise = waitForTransaction('node-fastify', transactionEvent => {
return (
transactionEvent.contexts?.trace?.op === 'http.server' &&
transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-inbound-headers/${id}`
);
});

const outboundTransactionPromise = waitForTransaction('node-fastify-app', transactionEvent => {
const outboundTransactionPromise = waitForTransaction('node-fastify', transactionEvent => {
return (
transactionEvent.contexts?.trace?.op === 'http.server' &&
transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-http/${id}`
Expand Down Expand Up @@ -121,14 +121,14 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
const id = crypto.randomUUID();

const inboundTransactionPromise = waitForTransaction('node-fastify-app', transactionEvent => {
const inboundTransactionPromise = waitForTransaction('node-fastify', transactionEvent => {
return (
transactionEvent?.contexts?.trace?.op === 'http.server' &&
transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-inbound-headers/${id}`
);
});

const outboundTransactionPromise = waitForTransaction('node-fastify-app', transactionEvent => {
const outboundTransactionPromise = waitForTransaction('node-fastify', transactionEvent => {
return (
transactionEvent?.contexts?.trace?.op === 'http.server' &&
transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-fetch/${id}`
Expand Down Expand Up @@ -233,7 +233,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
});

test('Propagates trace for outgoing external http requests', async ({ baseURL }) => {
const inboundTransactionPromise = waitForTransaction('node-fastify-app', transactionEvent => {
const inboundTransactionPromise = waitForTransaction('node-fastify', transactionEvent => {
return (
transactionEvent?.contexts?.trace?.op === 'http.server' &&
transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-http-external-allowed`
Expand Down Expand Up @@ -269,7 +269,7 @@ test('Propagates trace for outgoing external http requests', async ({ baseURL })
});

test('Does not propagate outgoing http requests not covered by tracePropagationTargets', async ({ baseURL }) => {
const inboundTransactionPromise = waitForTransaction('node-fastify-app', transactionEvent => {
const inboundTransactionPromise = waitForTransaction('node-fastify', transactionEvent => {
return (
transactionEvent?.contexts?.trace?.op === 'http.server' &&
transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-http-external-disallowed`
Expand All @@ -292,7 +292,7 @@ test('Does not propagate outgoing http requests not covered by tracePropagationT
});

test('Propagates trace for outgoing external fetch requests', async ({ baseURL }) => {
const inboundTransactionPromise = waitForTransaction('node-fastify-app', transactionEvent => {
const inboundTransactionPromise = waitForTransaction('node-fastify', transactionEvent => {
return (
transactionEvent?.contexts?.trace?.op === 'http.server' &&
transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-fetch-external-allowed`
Expand Down Expand Up @@ -328,7 +328,7 @@ test('Propagates trace for outgoing external fetch requests', async ({ baseURL }
});

test('Does not propagate outgoing fetch requests not covered by tracePropagationTargets', async ({ baseURL }) => {
const inboundTransactionPromise = waitForTransaction('node-fastify-app', transactionEvent => {
const inboundTransactionPromise = waitForTransaction('node-fastify', transactionEvent => {
return (
transactionEvent?.contexts?.trace?.op === 'http.server' &&
transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-fetch-external-disallowed`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const sentryTestProject = process.env.E2E_TEST_SENTRY_TEST_PROJECT;
const EVENT_POLLING_TIMEOUT = 90_000;

test('Sends an API route transaction', async ({ baseURL }) => {
const pageloadTransactionEventPromise = waitForTransaction('node-fastify-app', transactionEvent => {
const pageloadTransactionEventPromise = waitForTransaction('node-fastify', transactionEvent => {
return (
transactionEvent?.contexts?.trace?.op === 'http.server' &&
transactionEvent?.transaction === 'GET /test-transaction'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "node-koa-app",
"name": "node-koa",
"version": "1.0.0",
"private": true,
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import { startEventProxyServer } from '@sentry-internal/event-proxy-server';

startEventProxyServer({
port: 3031,
proxyServerName: 'node-fastify-app',
proxyServerName: 'node-koa',
});
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ test('Sends exception to Sentry', async ({ baseURL }) => {
});

test('Sends correct error event', async ({ baseURL }) => {
const errorEventPromise = waitForError('node-fastify-app', event => {
const errorEventPromise = waitForError('node-koa', event => {
return !event.type && event.exception?.values?.[0]?.value === 'This is an exception with id 123';
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import axios from 'axios';
test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
const id = crypto.randomUUID();

const inboundTransactionPromise = waitForTransaction('node-koa-app', transactionEvent => {
const inboundTransactionPromise = waitForTransaction('node-koa', transactionEvent => {
return (
transactionEvent.contexts?.trace?.op === 'http.server' &&
transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-inbound-headers/${id}`
);
});

const outboundTransactionPromise = waitForTransaction('node-koa-app', transactionEvent => {
const outboundTransactionPromise = waitForTransaction('node-koa', transactionEvent => {
return (
transactionEvent.contexts?.trace?.op === 'http.server' &&
transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-http/${id}`
Expand Down Expand Up @@ -121,14 +121,14 @@ test('Propagates trace for outgoing http requests', async ({ baseURL }) => {
test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
const id = crypto.randomUUID();

const inboundTransactionPromise = waitForTransaction('node-koa-app', transactionEvent => {
const inboundTransactionPromise = waitForTransaction('node-koa', transactionEvent => {
return (
transactionEvent?.contexts?.trace?.op === 'http.server' &&
transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-inbound-headers/${id}`
);
});

const outboundTransactionPromise = waitForTransaction('node-koa-app', transactionEvent => {
const outboundTransactionPromise = waitForTransaction('node-koa', transactionEvent => {
return (
transactionEvent?.contexts?.trace?.op === 'http.server' &&
transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-fetch/${id}`
Expand Down Expand Up @@ -233,7 +233,7 @@ test('Propagates trace for outgoing fetch requests', async ({ baseURL }) => {
});

test('Propagates trace for outgoing external http requests', async ({ baseURL }) => {
const inboundTransactionPromise = waitForTransaction('node-koa-app', transactionEvent => {
const inboundTransactionPromise = waitForTransaction('node-koa', transactionEvent => {
return (
transactionEvent?.contexts?.trace?.op === 'http.server' &&
transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-http-external-allowed`
Expand Down Expand Up @@ -269,7 +269,7 @@ test('Propagates trace for outgoing external http requests', async ({ baseURL })
});

test('Does not propagate outgoing http requests not covered by tracePropagationTargets', async ({ baseURL }) => {
const inboundTransactionPromise = waitForTransaction('node-koa-app', transactionEvent => {
const inboundTransactionPromise = waitForTransaction('node-koa', transactionEvent => {
return (
transactionEvent?.contexts?.trace?.op === 'http.server' &&
transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-http-external-disallowed`
Expand All @@ -292,7 +292,7 @@ test('Does not propagate outgoing http requests not covered by tracePropagationT
});

test('Propagates trace for outgoing external fetch requests', async ({ baseURL }) => {
const inboundTransactionPromise = waitForTransaction('node-koa-app', transactionEvent => {
const inboundTransactionPromise = waitForTransaction('node-koa', transactionEvent => {
return (
transactionEvent?.contexts?.trace?.op === 'http.server' &&
transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-fetch-external-allowed`
Expand Down Expand Up @@ -328,7 +328,7 @@ test('Propagates trace for outgoing external fetch requests', async ({ baseURL }
});

test('Does not propagate outgoing fetch requests not covered by tracePropagationTargets', async ({ baseURL }) => {
const inboundTransactionPromise = waitForTransaction('node-koa-app', transactionEvent => {
const inboundTransactionPromise = waitForTransaction('node-koa', transactionEvent => {
return (
transactionEvent?.contexts?.trace?.op === 'http.server' &&
transactionEvent.contexts?.trace?.data?.['http.target'] === `/test-outgoing-fetch-external-disallowed`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const sentryTestProject = process.env.E2E_TEST_SENTRY_TEST_PROJECT;
const EVENT_POLLING_TIMEOUT = 90_000;

test('Sends an API route transaction', async ({ baseURL }) => {
const pageloadTransactionEventPromise = waitForTransaction('node-koa-app', transactionEvent => {
const pageloadTransactionEventPromise = waitForTransaction('node-koa', transactionEvent => {
return (
transactionEvent?.contexts?.trace?.op === 'http.server' &&
transactionEvent?.transaction === 'GET /test-transaction'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "node-nestjs-app",
"name": "node-nestjs",
"version": "0.0.1",
"private": true,
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { startEventProxyServer } from '@sentry-internal/event-proxy-server';

startEventProxyServer({
port: 3031,
proxyServerName: 'node-nestjs',
});
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ test('Sends captured error to Sentry', async ({ baseURL }) => {
});

test('Sends exception to Sentry', async ({ baseURL }) => {
const errorEventPromise = waitForError('node-nestjs-app', event => {
const errorEventPromise = waitForError('node-nestjs', event => {
return !event.type && event.exception?.values?.[0]?.value === 'This is an exception with id 123';
});

Expand Down

0 comments on commit 31d462e

Please sign in to comment.