Skip to content

Commit a44215e

Browse files
committed
Add e2e tests
1 parent 15c2fe5 commit a44215e

166 files changed

Lines changed: 1342 additions & 58 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

dev-packages/e2e-tests/test-applications/astro-4/package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,14 @@
2626
},
2727
"volta": {
2828
"extends": "../../package.json"
29+
},
30+
"sentryTest": {
31+
"variants": [
32+
{
33+
"build-command": "env E2E_USE_SENTRY_TRACE_PROVIDER=1 pnpm test:build",
34+
"assert-command": "env E2E_USE_SENTRY_TRACE_PROVIDER=1 pnpm test:assert",
35+
"label": "astro-4 (sentry-trace-provider)"
36+
}
37+
]
2938
}
3039
}

dev-packages/e2e-tests/test-applications/astro-4/sentry.server.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ Sentry.init({
44
dsn: import.meta.env.PUBLIC_E2E_TEST_DSN,
55
environment: 'qa',
66
tracesSampleRate: 1.0,
7+
...(process.env.E2E_USE_SENTRY_TRACE_PROVIDER === '1'
8+
? {
9+
_experiments: {
10+
useSentryTraceProvider: true,
11+
},
12+
}
13+
: {}),
714
spotlight: true,
815
tunnel: 'http://localhost:3031/', // proxy server
916
});

dev-packages/e2e-tests/test-applications/astro-5/package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,14 @@
2626
},
2727
"volta": {
2828
"extends": "../../package.json"
29+
},
30+
"sentryTest": {
31+
"variants": [
32+
{
33+
"build-command": "env E2E_USE_SENTRY_TRACE_PROVIDER=1 pnpm test:build",
34+
"assert-command": "env E2E_USE_SENTRY_TRACE_PROVIDER=1 pnpm test:assert",
35+
"label": "astro-5 (sentry-trace-provider)"
36+
}
37+
]
2938
}
3039
}

dev-packages/e2e-tests/test-applications/astro-5/sentry.server.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,12 @@ Sentry.init({
44
dsn: import.meta.env.PUBLIC_E2E_TEST_DSN,
55
environment: 'qa',
66
tracesSampleRate: 1.0,
7+
...(process.env.E2E_USE_SENTRY_TRACE_PROVIDER === '1'
8+
? {
9+
_experiments: {
10+
useSentryTraceProvider: true,
11+
},
12+
}
13+
: {}),
714
tunnel: 'http://localhost:3031/', // proxy server
815
});

dev-packages/e2e-tests/test-applications/astro-6/package.json

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
"astro": "astro",
1010
"start": "node ./dist/server/entry.mjs",
1111
"test:build": "pnpm install && pnpm build",
12-
"test:assert": "TEST_ENV=production playwright test"
12+
"test:build:sentry-trace-provider": "E2E_USE_SENTRY_TRACE_PROVIDER=1 pnpm test:build",
13+
"test:assert": "TEST_ENV=production playwright test",
14+
"test:assert:sentry-trace-provider": "E2E_USE_SENTRY_TRACE_PROVIDER=1 pnpm test:assert"
1315
},
1416
"dependencies": {
1517
"@astrojs/node": "^10.0.0",
@@ -21,5 +23,14 @@
2123
"volta": {
2224
"node": "22.22.0",
2325
"extends": "../../package.json"
26+
},
27+
"sentryTest": {
28+
"variants": [
29+
{
30+
"build-command": "pnpm test:build:sentry-trace-provider",
31+
"assert-command": "pnpm test:assert:sentry-trace-provider",
32+
"label": "astro-6 (sentry-trace-provider)"
33+
}
34+
]
2435
}
2536
}

dev-packages/e2e-tests/test-applications/astro-6/sentry.server.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,13 @@ Sentry.init({
44
dsn: import.meta.env.PUBLIC_E2E_TEST_DSN,
55
environment: 'qa',
66
tracesSampleRate: 1.0,
7+
...(process.env.E2E_USE_SENTRY_TRACE_PROVIDER === '1'
8+
? {
9+
_experiments: {
10+
useSentryTraceProvider: true,
11+
},
12+
}
13+
: {}),
714
tunnel: 'http://localhost:3031/', // proxy server
815
debug: true,
916
});

dev-packages/e2e-tests/test-applications/aws-serverless/package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,14 @@
2121
},
2222
"volta": {
2323
"extends": "../../package.json"
24+
},
25+
"sentryTest": {
26+
"variants": [
27+
{
28+
"build-command": "env E2E_USE_SENTRY_TRACE_PROVIDER=1 pnpm test:build",
29+
"assert-command": "env E2E_USE_SENTRY_TRACE_PROVIDER=1 pnpm test:assert",
30+
"label": "aws-serverless (sentry-trace-provider)"
31+
}
32+
]
2433
}
2534
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import * as Sentry from '@sentry/aws-serverless';
2+
3+
const optionsWithTracingEnabled = process.env.SENTRY_TRACES_SAMPLE_RATE
4+
? {
5+
tracesSampleRate: parseFloat(process.env.SENTRY_TRACES_SAMPLE_RATE),
6+
}
7+
: {};
8+
9+
Sentry.init({
10+
integrations: Sentry.getDefaultIntegrations(optionsWithTracingEnabled),
11+
_experiments: {
12+
useSentryTraceProvider: true,
13+
},
14+
});
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import * as Sentry from '@sentry/aws-serverless';
2+
3+
const optionsWithTracingEnabled = process.env.SENTRY_TRACES_SAMPLE_RATE
4+
? {
5+
tracesSampleRate: parseFloat(process.env.SENTRY_TRACES_SAMPLE_RATE),
6+
}
7+
: {};
8+
9+
Sentry.init({
10+
integrations: Sentry.getDefaultIntegrations(optionsWithTracingEnabled),
11+
_experiments: {
12+
useSentryTraceProvider: true,
13+
},
14+
});

dev-packages/e2e-tests/test-applications/aws-serverless/src/stack.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ import { execFileSync } from 'node:child_process';
99

1010
const LAMBDA_FUNCTIONS_DIR = './src/lambda-functions-npm';
1111
const LAMBDA_FUNCTION_TIMEOUT = 10;
12+
const LAMBDA_AUTO_INIT_IMPORT =
13+
process.env.E2E_USE_SENTRY_TRACE_PROVIDER === '1'
14+
? './sentry-trace-provider-auto.mjs'
15+
: '@sentry/aws-serverless/awslambda-auto';
1216
export const SAM_PORT = 3001;
1317

1418
/** Match SAM / Docker to this machine so Apple Silicon does not mix arm64 images with an x86_64 template default. */
@@ -104,7 +108,7 @@ export class LocalLambdaStack extends Stack {
104108
SENTRY_DSN: dsn,
105109
SENTRY_TRACES_SAMPLE_RATE: 1.0,
106110
SENTRY_DEBUG: true,
107-
NODE_OPTIONS: `--import=@sentry/aws-serverless/awslambda-auto`,
111+
NODE_OPTIONS: `--import=${LAMBDA_AUTO_INIT_IMPORT}`,
108112
},
109113
},
110114
},

0 commit comments

Comments
 (0)