sentry-javascript
sentry-javascript copied to clipboard
test(aws-lambda): Add basic lambda layer e2e test
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 via the lambda.
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
-rargument 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.