Skip to content

Commit 6cfb725

Browse files
committed
Merge branch 'develop' into manual-develop-sync
2 parents 45b8f7e + 3048f84 commit 6cfb725

File tree

27 files changed

+167
-129
lines changed

27 files changed

+167
-129
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -954,7 +954,7 @@ jobs:
954954
- name: Build E2E app
955955
working-directory: ${{ runner.temp }}/test-application
956956
timeout-minutes: 7
957-
run: pnpm ${{ matrix.build-command || 'test:build' }}
957+
run: ${{ matrix.build-command || 'pnpm test:build' }}
958958

959959
- name: Install Playwright
960960
uses: ./.github/actions/install-playwright
@@ -965,7 +965,7 @@ jobs:
965965
- name: Run E2E test
966966
working-directory: ${{ runner.temp }}/test-application
967967
timeout-minutes: 10
968-
run: pnpm test:assert
968+
run: ${{ matrix.assert-command || 'pnpm test:assert' }}
969969

970970
- name: Upload Playwright Traces
971971
uses: actions/upload-artifact@v4
@@ -1075,7 +1075,7 @@ jobs:
10751075
- name: Build E2E app
10761076
working-directory: ${{ runner.temp }}/test-application
10771077
timeout-minutes: 7
1078-
run: pnpm ${{ matrix.build-command || 'test:build' }}
1078+
run: ${{ matrix.build-command || 'pnpm test:build' }}
10791079

10801080
- name: Install Playwright
10811081
uses: ./.github/actions/install-playwright
@@ -1086,7 +1086,7 @@ jobs:
10861086
- name: Run E2E test
10871087
working-directory: ${{ runner.temp }}/test-application
10881088
timeout-minutes: 10
1089-
run: pnpm ${{ matrix.assert-command || 'test:assert' }}
1089+
run: ${{ matrix.assert-command || 'pnpm test:assert' }}
10901090

10911091
- name: Pre-process E2E Test Dumps
10921092
if: failure()

.size-limit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ module.exports = [
8282
path: 'packages/browser/build/npm/esm/index.js',
8383
import: createImport('init', 'browserTracingIntegration', 'replayIntegration', 'feedbackIntegration'),
8484
gzip: true,
85-
limit: '95 KB',
85+
limit: '96 KB',
8686
},
8787
{
8888
name: '@sentry/browser (incl. Feedback)',

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,19 @@
2323
},
2424
"volta": {
2525
"extends": "../../package.json"
26+
},
27+
"sentryTest": {
28+
"variants": [
29+
{
30+
"build-command": "NODE_VERSION=20 ./pull-sam-image.sh && pnpm test:build",
31+
"assert-command": "NODE_VERSION=20 pnpm test:assert",
32+
"label": "aws-serverless (Node 20)"
33+
},
34+
{
35+
"build-command": "NODE_VERSION=18 ./pull-sam-image.sh && pnpm test:build",
36+
"assert-command": "NODE_VERSION=18 pnpm test:assert",
37+
"label": "aws-serverless (Node 18)"
38+
}
39+
]
2640
}
2741
}
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
import { getPlaywrightConfig } from '@sentry-internal/test-utils';
22

3-
export default getPlaywrightConfig();
3+
export default getPlaywrightConfig(undefined, {
4+
timeout: 60 * 1000 * 3, // 3 minutes
5+
});
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
# Script to pull the correct SAM docker image based on the NODE_VERSION environment variable.
4+
5+
set -e
6+
7+
if [[ -z "$NODE_VERSION" ]]; then
8+
echo "Error: NODE_VERSION not set"
9+
exit 1
10+
fi
11+
12+
echo "Pulling SAM Node $NODE_VERSION docker image..."
13+
docker pull "public.ecr.aws/sam/build-nodejs${NODE_VERSION}.x:latest"
14+
15+
echo "Successfully pulled SAM Node $NODE_VERSION docker image"

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

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ const LAMBDA_FUNCTIONS_WITH_LAYER_DIR = './src/lambda-functions-layer';
1212
const LAMBDA_FUNCTIONS_WITH_NPM_DIR = './src/lambda-functions-npm';
1313
const LAMBDA_FUNCTION_TIMEOUT = 10;
1414
const LAYER_DIR = './node_modules/@sentry/aws-serverless/';
15+
const DEFAULT_NODE_VERSION = '22';
1516
export const SAM_PORT = 3001;
16-
const NODE_RUNTIME = `nodejs${process.version.split('.').at(0)?.replace('v', '')}.x`;
1717

1818
export class LocalLambdaStack extends Stack {
1919
sentryLayer: CfnResource;
@@ -73,22 +73,20 @@ export class LocalLambdaStack extends Stack {
7373
execFileSync('npm', ['install', '--prefix', path.join(functionsDir, lambdaDir)], { stdio: 'inherit' });
7474
}
7575

76-
const isEsm = fs.existsSync(path.join(functionsDir, lambdaDir, 'index.mjs'));
77-
7876
new CfnResource(this, functionName, {
7977
type: 'AWS::Serverless::Function',
8078
properties: {
8179
CodeUri: path.join(functionsDir, lambdaDir),
8280
Handler: 'index.handler',
83-
Runtime: NODE_RUNTIME,
81+
Runtime: `nodejs${process.env.NODE_VERSION ?? DEFAULT_NODE_VERSION}.x`,
8482
Timeout: LAMBDA_FUNCTION_TIMEOUT,
8583
Layers: addLayer ? [{ Ref: this.sentryLayer.logicalId }] : undefined,
8684
Environment: {
8785
Variables: {
8886
SENTRY_DSN: dsn,
8987
SENTRY_TRACES_SAMPLE_RATE: 1.0,
9088
SENTRY_DEBUG: true,
91-
NODE_OPTIONS: `--${isEsm ? 'import' : 'require'}=@sentry/aws-serverless/awslambda-auto`,
89+
NODE_OPTIONS: `--import=@sentry/aws-serverless/awslambda-auto`,
9290
},
9391
},
9492
},

dev-packages/e2e-tests/test-applications/aws-serverless/tests/lambda-fixtures.ts

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,27 @@ export const test = base.extend<{ testEnvironment: LocalLambdaStack; lambdaClien
2929
const debugLog = tmp.fileSync({ prefix: 'sentry_aws_lambda_tests_sam_debug', postfix: '.log' });
3030
console.log(`[test_environment fixture] Writing SAM debug log to: ${debugLog.name}`);
3131

32-
const process = spawn(
33-
'sam',
34-
[
35-
'local',
36-
'start-lambda',
37-
'--debug',
38-
'--template',
39-
SAM_TEMPLATE_FILE,
40-
'--warm-containers',
41-
'EAGER',
42-
'--docker-network',
43-
DOCKER_NETWORK_NAME,
44-
],
45-
{
46-
stdio: ['ignore', debugLog.fd, debugLog.fd],
47-
},
48-
);
32+
const args = [
33+
'local',
34+
'start-lambda',
35+
'--debug',
36+
'--template',
37+
SAM_TEMPLATE_FILE,
38+
'--warm-containers',
39+
'EAGER',
40+
'--docker-network',
41+
DOCKER_NETWORK_NAME,
42+
];
43+
44+
if (process.env.NODE_VERSION) {
45+
args.push('--invoke-image', `public.ecr.aws/sam/build-nodejs${process.env.NODE_VERSION}.x:latest`);
46+
}
47+
48+
console.log(`[testEnvironment fixture] Running SAM with args: ${args.join(' ')}`);
49+
50+
const samProcess = spawn('sam', args, {
51+
stdio: ['ignore', debugLog.fd, debugLog.fd],
52+
});
4953

5054
try {
5155
await LocalLambdaStack.waitForStack();
@@ -54,12 +58,12 @@ export const test = base.extend<{ testEnvironment: LocalLambdaStack; lambdaClien
5458
} finally {
5559
console.log('[testEnvironment fixture] Tearing down AWS Lambda test infrastructure');
5660

57-
process.kill('SIGTERM');
61+
samProcess.kill('SIGTERM');
5862
await new Promise(resolve => {
59-
process.once('exit', resolve);
63+
samProcess.once('exit', resolve);
6064
setTimeout(() => {
61-
if (!process.killed) {
62-
process.kill('SIGKILL');
65+
if (!samProcess.killed) {
66+
samProcess.kill('SIGKILL');
6367
}
6468
resolve(void 0);
6569
}, 5000);

dev-packages/e2e-tests/test-applications/create-next-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"sentryTest": {
3232
"variants": [
3333
{
34-
"build-command": "test:build-13",
34+
"build-command": "pnpm test:build-13",
3535
"label": "create-next-app (next@13)"
3636
}
3737
]

dev-packages/e2e-tests/test-applications/create-react-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"sentryTest": {
4848
"variants": [
4949
{
50-
"build-command": "test:build-ts3.8",
50+
"build-command": "pnpm test:build-ts3.8",
5151
"label": "create-react-app (TS 3.8)"
5252
}
5353
]

dev-packages/e2e-tests/test-applications/nextjs-13/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
"sentryTest": {
3333
"optionalVariants": [
3434
{
35-
"build-command": "test:build-canary",
35+
"build-command": "pnpm test:build-canary",
3636
"label": "nextjs-13 (canary)"
3737
},
3838
{
39-
"build-command": "test:build-latest",
39+
"build-command": "pnpm test:build-latest",
4040
"label": "nextjs-13 (latest)"
4141
}
4242
]

0 commit comments

Comments
 (0)