Skip to content

test(e2e): Avoid network installs in AWS serverless tests - #24059

Merged
msonnb merged 4 commits into
developfrom
feat/aws-serverless-e2e-offline-install
Sep 4, 2026
Merged

msonnb merged 4 commits into
developfrom
feat/aws-serverless-e2e-offline-install

Conversation

@msonnb

@msonnb msonnb commented Sep 4, 2026 •

Copy link
Copy Markdown
Member

The AWS serverless E2E fixture installed dependencies from the registry for every generated Lambda during Playwright setup.

Root cause: slow registry access could leave npm running until the job-wide timeout. Reuse the populated pnpm store offline and use pnpm's hoisted linker, which produces a deployable Lambda node_modules layout without symlinks.

Co-Authored-By: OpenAI Codex <codex@openai.com>
@github-actions

github-actions Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.69 kB - -
@sentry/browser - with treeshaking flags 26.99 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 26.89 kB - -
@sentry/browser (incl. Tracing) 49.07 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 49.07 kB - -
@sentry/browser (incl. Tracing, Profiling) 51.98 kB - -
@sentry/browser (incl. Tracing, Replay) 88.62 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 77.85 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 93.3 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 106.24 kB - -
@sentry/browser (incl. Feedback) 46.17 kB - -
@sentry/browser (incl. sendFeedback) 33.75 kB - -
@sentry/browser (incl. FeedbackAsync) 38.85 kB - -
@sentry/browser (incl. Metrics) 29.66 kB - -
@sentry/browser (incl. Logs) 29.94 kB - -
@sentry/browser (incl. Metrics & Logs) 30.59 kB - -
@sentry/react 30.45 kB - -
@sentry/react (incl. Tracing) 51.28 kB - -
@sentry/vue 35.91 kB - -
@sentry/vue (incl. Tracing) 51.34 kB - -
@sentry/svelte 28.71 kB - -
CDN Bundle 30.43 kB - -
CDN Bundle (incl. Tracing) 49.6 kB - -
CDN Bundle (incl. Logs, Metrics) 32.66 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 51.53 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73.31 kB - -
CDN Bundle (incl. Tracing, Replay) 87.15 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 89.02 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 93.08 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 95.03 kB - -
CDN Bundle - uncompressed 90.13 kB - -
CDN Bundle (incl. Tracing) - uncompressed 147.81 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 96.52 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 153.59 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 225.82 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 267.44 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 273.21 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 281.15 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 286.9 kB - -
@sentry/nextjs (client) 53.89 kB - -
@sentry/sveltekit (client) 49.51 kB - -
@sentry/core/server 40.96 kB - -
@sentry/core/browser 13.53 kB - -
@sentry/node 124.76 kB +0.02% +20 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 81.51 kB - -
@sentry/node - without tracing 88.5 kB +0.03% +23 B 🔺
@sentry/node - without channel injection 104.08 kB +0.02% +18 B 🔺
@sentry/aws-serverless 96.87 kB +0.03% +24 B 🔺
@sentry/cloudflare (withSentry) - minified 201.56 kB - -
@sentry/cloudflare (withSentry) 501.37 kB - -

View base workflow run

msonnb and others added 2 commits September 4, 2026 11:09
Co-Authored-By: OpenAI Codex <codex@openai.com>
Co-Authored-By: OpenAI Codex <codex@openai.com>
@msonnb msonnb changed the title test(e2e): Avoid network installs in AWS serverless tests fix(aws-serverless): Support pnpm-installed Lambda handlers Sep 4, 2026
Co-Authored-By: OpenAI Codex <codex@openai.com>
@msonnb msonnb changed the title fix(aws-serverless): Support pnpm-installed Lambda handlers test(e2e): Avoid network installs in AWS serverless tests Sep 4, 2026
@msonnb
msonnb marked this pull request as ready for review September 4, 2026 10:38
@msonnb
msonnb requested review from a team, Lms24, andreiborza and stephanie-anderson and removed request for a team and stephanie-anderson September 4, 2026 10:39
Comment on lines +100 to +107
execFileSync(
'pnpm',
['install', '--offline', '--prod', '--ignore-scripts', '--no-frozen-lockfile', '--config.node-linker=hoisted'],
{
cwd: lambdaPath,
stdio: 'inherit',
},
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The pnpm install --offline command will fail in the CI environment because transitive registry dependencies are not pre-populated in the pnpm store.
Severity: CRITICAL

Suggested Fix

Add a CI step to pre-populate the pnpm store before the E2E tests run. This can be achieved by running pnpm fetch which will download all required packages, including transitive dependencies, into the store. This will allow the subsequent pnpm install --offline command to resolve all dependencies correctly.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: dev-packages/e2e-tests/test-applications/aws-serverless/src/stack.ts#L100-L107

Potential issue: The `pnpm install` command in `stack.ts` uses the `--offline` flag.
While direct dependencies are local, their transitive dependencies (e.g.,
`@sentry/conventions`, `@opentelemetry/api`) are from the package registry. The CI
environment does not pre-populate the pnpm store with these registry packages, as the
main project uses yarn and there is no preceding `pnpm fetch` step. Consequently, when
`pnpm install --offline` attempts to resolve these transitive dependencies, it will fail
because they are not available in the local store, causing all AWS serverless E2E tests
to fail.

Did we get this right? 👍 / 👎 to inform future reviews.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nah, we run pnpm install in test:build first

@msonnb
msonnb merged commit 1e91b97 into develop Sep 4, 2026
435 of 441 checks passed
@msonnb
msonnb deleted the feat/aws-serverless-e2e-offline-install branch September 4, 2026 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants