Skip to content

test(aws-lambda): Add basic lambda layer e2e test #12279

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 4 commits into from
May 31, 2024

Conversation

Lms24
Copy link
Member

@Lms24 Lms24 commented May 29, 2024

This PR adds an e2e (or rather integration) test for our AWS lambda layer bundle. The motivation for this test is that we broke the layer during the initial v8 releases (multiple times for different reasons) without us noticing this in tests. Simply because we never tested the bundled SDK code that we create and publish for the lambda layer.

The new e2e test tries to simulate a lambda environment by:

  • copying over the lambda layer content into the test app as if a layer was added to a lambda function
  • running a lambda function as a process which gets passed all environment variables that we instruct users to set for a code-change-less Sentry lambda layer setup. This includes the -r argument to auto-init the SDK.
  • Checking that an event was sent to Sentry
  • Checking that Otel Insteumentation works

This is not the most sophisticated setup and definitely not fully E2E as we don't auto deploy anything to AWS. However, it's a good start and a relatively simple way to ensure at least basic functionality. This test would have caught all the layer-specific bugs we missed in the initial v8 releases.

Note: I had to make some adjustments to the proxy server to basically not always forward events to Sentry if you specify the respective flag when starting the proxy server. This is because we can't pass a tunnel option to the layer without calling Sentry.init explicitly in the code (which defeats the purpose of this test).

@Lms24 Lms24 requested review from AbhiPrasad and andreiborza May 29, 2024 15:17
@Lms24 Lms24 self-assigned this May 29, 2024
@Lms24 Lms24 force-pushed the lms/test-aws-lambda-layer branch from 5901dba to 23e8d93 Compare May 31, 2024 13:18
@Lms24 Lms24 enabled auto-merge (squash) May 31, 2024 13:24
@Lms24 Lms24 merged commit 741e2bf into develop May 31, 2024
109 checks passed
@Lms24 Lms24 deleted the lms/test-aws-lambda-layer branch May 31, 2024 13:41
c298lee pushed a commit that referenced this pull request Jun 4, 2024
Add an e2e (or rather integration) test for our AWS lambda
layer bundle. The motivation for this test is that we broke the layer
during the initial v8 releases (multiple times for different reasons)
without us noticing this in tests. Simply because we never tested the
bundled SDK code that we create and publish for the lambda layer.
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