Skip to content

Run AWS Lambda tests locally #3988

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 45 commits into from
Mar 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
751f1fe
First running dummy function
antonpirker Jan 22, 2025
7bb1a4a
Full working example with layer and sentry server collecting envelopes
antonpirker Jan 22, 2025
01ff491
Cleanup
antonpirker Jan 22, 2025
981562d
Using the actual Sentry Layer
antonpirker Jan 22, 2025
2d4e47d
Cleanup
antonpirker Jan 22, 2025
fdd627c
Merge branch 'master' into antonpirker/better-aws-tests
antonpirker Jan 27, 2025
e1d0c79
Clearing envelopes between tests
antonpirker Jan 27, 2025
11d7c1b
Moved some stuff into utils file
antonpirker Jan 27, 2025
84ecd5d
Removed unnecessary region parameter
antonpirker Jan 27, 2025
4ea57a0
Removed unnecessary region parameter
antonpirker Jan 27, 2025
b34a611
some work on tests
antonpirker Feb 17, 2025
9e357ef
Merge branch 'master' into antonpirker/better-aws-tests
antonpirker Feb 17, 2025
49982a9
Making AWS Lambda invokation work reliabily
antonpirker Feb 18, 2025
3c540a5
Cleanup and some basic tests
antonpirker Feb 18, 2025
a57575a
Added init error test
antonpirker Feb 18, 2025
aad4396
Make directory name and function name the same
antonpirker Feb 18, 2025
a2e3291
Run tests in local python version
antonpirker Feb 18, 2025
02d8ea2
Merge branch 'master' into antonpirker/better-aws-tests
antonpirker Feb 18, 2025
00c1a51
Updated tox config for aws lambda
antonpirker Feb 18, 2025
507a121
Added timetout test
antonpirker Feb 18, 2025
9e7e251
Add test for non dict events
antonpirker Feb 18, 2025
a0a9fdd
Porting some tests
antonpirker Feb 18, 2025
d9226d6
Some clenaup
antonpirker Feb 18, 2025
afc3bf0
More cleanup
antonpirker Feb 18, 2025
0587975
linting
antonpirker Feb 18, 2025
888e943
Fixed requirements
antonpirker Feb 18, 2025
4998927
run the correct tests in ci
antonpirker Feb 18, 2025
3e3ca95
Renamed so the tests are not run
antonpirker Feb 19, 2025
46a080f
Add region
antonpirker Feb 19, 2025
ce9e90f
Try to make it work in CI
antonpirker Feb 19, 2025
2576948
Make it work in CI and locally
antonpirker Feb 19, 2025
d12abf5
Cleanup
antonpirker Feb 19, 2025
003dd4d
Merge branch 'master' into antonpirker/better-aws-tests
antonpirker Feb 19, 2025
a89b3c4
nicer diffs for other pr
antonpirker Feb 19, 2025
4d206a8
Update test mastrix
antonpirker Feb 19, 2025
d742102
cleanup
antonpirker Feb 19, 2025
1fa3a6f
Merge branch 'master' into antonpirker/better-aws-tests
antonpirker Feb 19, 2025
2b86d05
Merge branch 'master' into antonpirker/better-aws-tests
antonpirker Feb 24, 2025
38fa8c0
Merge branch 'master' into antonpirker/better-aws-tests
antonpirker Feb 24, 2025
bfa0312
Update tox setup for AWS Lambda integration (#4076)
antonpirker Feb 24, 2025
2271253
Merge branch 'master' into antonpirker/better-aws-tests
antonpirker Mar 3, 2025
8cbdfa8
Merge branch 'master' into antonpirker/better-aws-tests
antonpirker Mar 10, 2025
2e75f79
Added tests for testing correct sampling_context given to start_trans…
antonpirker Mar 10, 2025
e815a6e
Merge branch 'master' into antonpirker/better-aws-tests
antonpirker Mar 12, 2025
a858cdb
More tests
antonpirker Mar 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

Thank you for contributing to `sentry-python`! Please add tests to validate your changes, and lint your code using `tox -e linters`.

Running the test suite on your PR might require maintainer approval. The AWS Lambda tests additionally require a maintainer to add a special label, and they will fail until this label is added.
Running the test suite on your PR might require maintainer approval.
72 changes: 0 additions & 72 deletions .github/workflows/scripts/trigger_tests_on_label.py

This file was deleted.

126 changes: 0 additions & 126 deletions .github/workflows/test-integrations-aws.yml

This file was deleted.

18 changes: 17 additions & 1 deletion .github/workflows/test-integrations-cloud.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ jobs:
# ubuntu-20.04 is the last version that supported python3.6
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
os: [ubuntu-20.04]
services:
docker:
image: docker:dind # Required for Docker network management
options: --privileged # Required for Docker-in-Docker operations
steps:
- uses: actions/checkout@v4.2.2
- uses: actions/setup-python@v5
Expand All @@ -47,6 +51,10 @@ jobs:
- name: Erase coverage
run: |
coverage erase
- name: Test aws_lambda latest
run: |
set -x # print commands that are executed
./scripts/runtox.sh "py${{ matrix.python-version }}-aws_lambda-latest"
- name: Test boto3 latest
run: |
set -x # print commands that are executed
Expand Down Expand Up @@ -97,12 +105,16 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.6","3.7","3.9","3.11","3.12","3.13"]
python-version: ["3.6","3.7","3.8","3.9","3.11","3.12","3.13"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
os: [ubuntu-20.04]
services:
docker:
image: docker:dind # Required for Docker network management
options: --privileged # Required for Docker-in-Docker operations
steps:
- uses: actions/checkout@v4.2.2
- uses: actions/setup-python@v5
Expand All @@ -115,6 +127,10 @@ jobs:
- name: Erase coverage
run: |
coverage erase
- name: Test aws_lambda pinned
run: |
set -x # print commands that are executed
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-aws_lambda"
- name: Test boto3 pinned
run: |
set -x # print commands that are executed
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ relay
pip-wheel-metadata
.mypy_cache
.vscode/

# for running AWS Lambda tests using AWS SAM
sam.template.yaml
1 change: 1 addition & 0 deletions requirements-testing.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ socksio
httpcore[http2]
setuptools
Brotli
docker
18 changes: 0 additions & 18 deletions scripts/aws-cleanup.sh

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
#
# Deletes all versions of the layer specified in LAYER_NAME in one region.
# Use with caution!
#

set -euo pipefail
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#!/usr/bin/env bash
#
# Builds and deploys the Sentry AWS Lambda layer (including the Sentry SDK and the Sentry Lambda Extension)
# Builds and deploys the `SentryPythonServerlessSDK-local-dev` AWS Lambda layer (containing the Sentry SDK)
#
# The currently checked out version of the SDK in your local directory is used.
# The latest version of the Lambda Extension is fetched from the Sentry Release Registry.
#

set -euo pipefail
Expand Down
4 changes: 0 additions & 4 deletions scripts/aws_lambda_functions/README.md

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading