Skip to content

Commit bfa0312

Browse files
authored
Update tox setup for AWS Lambda integration (#4076)
Because we changed our AWS Lambda test suite to not create real Lambda functions but rather run a Lambda environment locally, we do not need all the code necessary for handling the authentication to AWS in the test suite. This PR removes all the AWS auth related code and als moves the AWS Lambda testsuite again into the "Cloud" group of test suites, because it is a "normal" test suite again. The PR that includes the change to have a local Lambda environment is here: #3988
1 parent 38fa8c0 commit bfa0312

17 files changed

+29
-377
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44

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

7-
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.
7+
Running the test suite on your PR might require maintainer approval.

.github/workflows/scripts/trigger_tests_on_label.py

Lines changed: 0 additions & 72 deletions
This file was deleted.

.github/workflows/test-integrations-aws.yml

Lines changed: 0 additions & 125 deletions
This file was deleted.

.github/workflows/test-integrations-cloud.yml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ jobs:
3535
# ubuntu-20.04 is the last version that supported python3.6
3636
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
3737
os: [ubuntu-20.04]
38+
services:
39+
docker:
40+
image: docker:dind # Required for Docker network management
41+
options: --privileged # Required for Docker-in-Docker operations
3842
steps:
3943
- uses: actions/[email protected]
4044
- uses: actions/setup-python@v5
@@ -47,6 +51,10 @@ jobs:
4751
- name: Erase coverage
4852
run: |
4953
coverage erase
54+
- name: Test aws_lambda latest
55+
run: |
56+
set -x # print commands that are executed
57+
./scripts/runtox.sh "py${{ matrix.python-version }}-aws_lambda-latest"
5058
- name: Test boto3 latest
5159
run: |
5260
set -x # print commands that are executed
@@ -97,12 +105,16 @@ jobs:
97105
strategy:
98106
fail-fast: false
99107
matrix:
100-
python-version: ["3.6","3.7","3.9","3.11","3.12","3.13"]
108+
python-version: ["3.6","3.7","3.8","3.9","3.11","3.12","3.13"]
101109
# python3.6 reached EOL and is no longer being supported on
102110
# new versions of hosted runners on Github Actions
103111
# ubuntu-20.04 is the last version that supported python3.6
104112
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
105113
os: [ubuntu-20.04]
114+
services:
115+
docker:
116+
image: docker:dind # Required for Docker network management
117+
options: --privileged # Required for Docker-in-Docker operations
106118
steps:
107119
- uses: actions/[email protected]
108120
- uses: actions/setup-python@v5
@@ -115,6 +127,10 @@ jobs:
115127
- name: Erase coverage
116128
run: |
117129
coverage erase
130+
- name: Test aws_lambda pinned
131+
run: |
132+
set -x # print commands that are executed
133+
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-aws_lambda"
118134
- name: Test boto3 pinned
119135
run: |
120136
set -x # print commands that are executed

scripts/aws-cleanup.sh

Lines changed: 0 additions & 18 deletions
This file was deleted.

scripts/aws-delete-lambda-layer-versions.sh renamed to scripts/aws/aws-delete-lambda-layer-versions.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env bash
22
#
33
# Deletes all versions of the layer specified in LAYER_NAME in one region.
4+
# Use with caution!
45
#
56

67
set -euo pipefail

scripts/aws-deploy-local-layer.sh renamed to scripts/aws/aws-deploy-local-layer.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
#!/usr/bin/env bash
22
#
3-
# Builds and deploys the Sentry AWS Lambda layer (including the Sentry SDK and the Sentry Lambda Extension)
3+
# Builds and deploys the `SentryPythonServerlessSDK-local-dev` AWS Lambda layer (containing the Sentry SDK)
44
#
55
# The currently checked out version of the SDK in your local directory is used.
6-
# The latest version of the Lambda Extension is fetched from the Sentry Release Registry.
76
#
87

98
set -euo pipefail

scripts/aws_lambda_functions/README.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

scripts/aws_lambda_functions/sentryPythonDeleteTestFunctions/README.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

scripts/aws_lambda_functions/sentryPythonDeleteTestFunctions/lambda_function.py

Lines changed: 0 additions & 55 deletions
This file was deleted.

scripts/populate_tox/tox.jinja

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,6 @@ envlist =
5757
{py3.8,py3.11,py3.12}-asyncpg-latest
5858

5959
# AWS Lambda
60-
# The aws_lambda tests deploy to the real AWS and have their own
61-
# matrix of Python versions to run the test lambda function in.
62-
# see `lambda_runtime` fixture in tests/integrations/aws_lambda.py
6360
{py3.8,py3.9,py3.11,py3.13}-aws_lambda
6461

6562
# Beam
@@ -533,8 +530,6 @@ setenv =
533530
socket: TESTPATH=tests/integrations/socket
534531
535532
passenv =
536-
SENTRY_PYTHON_TEST_AWS_ACCESS_KEY_ID
537-
SENTRY_PYTHON_TEST_AWS_SECRET_ACCESS_KEY
538533
SENTRY_PYTHON_TEST_POSTGRES_HOST
539534
SENTRY_PYTHON_TEST_POSTGRES_USER
540535
SENTRY_PYTHON_TEST_POSTGRES_PASSWORD

0 commit comments

Comments
 (0)