Skip to content

Commit

Permalink
Update tox setup for AWS Lambda integration (#4076)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
antonpirker authored Feb 24, 2025
1 parent 38fa8c0 commit bfa0312
Show file tree
Hide file tree
Showing 17 changed files with 29 additions and 377 deletions.
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.

125 changes: 0 additions & 125 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
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.

5 changes: 0 additions & 5 deletions scripts/populate_tox/tox.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ envlist =
{py3.8,py3.11,py3.12}-asyncpg-latest

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

# Beam
Expand Down Expand Up @@ -533,8 +530,6 @@ setenv =
socket: TESTPATH=tests/integrations/socket
passenv =
SENTRY_PYTHON_TEST_AWS_ACCESS_KEY_ID
SENTRY_PYTHON_TEST_AWS_SECRET_ACCESS_KEY
SENTRY_PYTHON_TEST_POSTGRES_HOST
SENTRY_PYTHON_TEST_POSTGRES_USER
SENTRY_PYTHON_TEST_POSTGRES_PASSWORD
Expand Down
Loading

0 comments on commit bfa0312

Please sign in to comment.