From 1c86896d8f85891e570f3dbf20067dcc20e8915f Mon Sep 17 00:00:00 2001 From: xneyder Date: Mon, 21 Oct 2024 22:47:51 -0400 Subject: [PATCH] Unse vars --- .github/workflows/ci-backend.yml | 8 -------- .../temporal/tests/data_imports/test_end_to_end.py | 12 ++++++++++++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci-backend.yml b/.github/workflows/ci-backend.yml index bff6fb7c24ce8..987ed8eba3c0f 100644 --- a/.github/workflows/ci-backend.yml +++ b/.github/workflows/ci-backend.yml @@ -275,14 +275,6 @@ jobs: id: login-ecr uses: aws-actions/amazon-ecr-login@v2 - - name: Clear AWS environment variables - run: | - echo "AWS_DEFAULT_REGION=''" >> $GITHUB_ENV - echo "AWS_REGION=''" >> $GITHUB_ENV - echo "AWS_ACCESS_KEY_ID=''" >> $GITHUB_ENV - echo "AWS_SECRET_ACCESS_KEY=''" >> $GITHUB_ENV - echo "AWS_SESSION_TOKEN=''" >> $GITHUB_ENV - - uses: ./.github/actions/run-backend-tests if: needs.changes.outputs.backend == 'true' with: diff --git a/posthog/temporal/tests/data_imports/test_end_to_end.py b/posthog/temporal/tests/data_imports/test_end_to_end.py index 3e8a183cea36a..3db8b14c316ef 100644 --- a/posthog/temporal/tests/data_imports/test_end_to_end.py +++ b/posthog/temporal/tests/data_imports/test_end_to_end.py @@ -3,6 +3,7 @@ import aioboto3 import functools import uuid +import os from asgiref.sync import sync_to_async from django.conf import settings from django.test import override_settings @@ -81,6 +82,17 @@ async def minio_client(): Yields the client after creating a bucket. Upon resuming, we delete the contents and the bucket itself. """ + # Unset AWS-related environment variables to prevent conflicts + os.environ.pop("AWS_ACCESS_KEY_ID", None) + os.environ.pop("AWS_SECRET_ACCESS_KEY", None) + os.environ.pop("AWS_SESSION_TOKEN", None) + os.environ.pop("AWS_DEFAULT_REGION", None) + os.environ.pop("AWS_REGION", None) + os.environ.pop("AWS_ROLE_ARN", None) + os.environ.pop("AWS_ROLE_SESSION_NAME", None) + os.environ.pop("AWS_CREDENTIAL_EXPIRATION", None) + os.environ.pop("AWS_PROFILE", None) + async with create_test_client( "s3", aws_access_key_id=settings.OBJECT_STORAGE_ACCESS_KEY_ID,