Skip to content

Commit

Permalink
Remove remapping of aws creds.
Browse files Browse the repository at this point in the history
We don't need a remapping since the side effects are gone.
  • Loading branch information
thomasmarwitz committed Dec 17, 2024
1 parent af74511 commit 39a1132
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,6 @@ jobs:
role-to-assume: arn:aws:iam::211125346859:role/github-poweruser
aws-region: eu-central-1

# This is a work around as long as S3FSStore has the side effect of setting env variables
# to provide authentication. This can safely be removed as soon as this side effect is gone
- name: Remap AWS Environment Variables
if: steps.check-id-token.outcome == 'success'
run: |
echo "ACCESS_KEY_ID=${{ env.AWS_ACCESS_KEY_ID }}" >> $GITHUB_ENV
echo "SECRET_ACCESS_KEY=${{ env.AWS_SECRET_ACCESS_KEY }}" >> $GITHUB_ENV
echo "SESSION_TOKEN=${{ env.AWS_SESSION_TOKEN }}" >> $GITHUB_ENV
# We set an env variable according to the result of the check
# to only allow skipping of aws integration test when in fork.
# When being run in the base repo, the aws integration test should always be executed.
Expand Down
11 changes: 5 additions & 6 deletions tests/test_s3fs_aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@ def aws_credentials() -> tuple[str, str, Union[str, None]]:
secret_key = aws_credentials.secret_key
session_token = aws_credentials.token
else:
# Don't look for AWS_ versions, they might be overwritten by test_boto3_store.py
access_key = os.environ.get("ACCESS_KEY_ID", None)
secret_key = os.environ.get("SECRET_ACCESS_KEY", None)
session_token = os.environ.get("SESSION_TOKEN", None)
access_key = os.environ.get("AWS_ACCESS_KEY_ID", None)
secret_key = os.environ.get("AWS_SECRET_ACCESS_KEY", None)
session_token = os.environ.get("AWS_SESSION_TOKEN", None)

if not (access_key and secret_key):
msg = "No s3 credentials available. "
Expand All @@ -45,8 +44,8 @@ def aws_credentials() -> tuple[str, str, Union[str, None]]:
msg += (
"If you want to execute this integration test, "
f"set '{env_var_name}' env variable to "
"provide a valid AWS profile or set 'ACCESS_KEY_ID' and "
"'SECRET_ACCESS_KEY' and optional 'SESSION_TOKEN'."
"provide a valid AWS profile or set 'AWS_ACCESS_KEY_ID' and "
"'AWS_SECRET_ACCESS_KEY' and optional 'AWS_SESSION_TOKEN'."
)

pytest.skip(reason=msg)
Expand Down

0 comments on commit 39a1132

Please sign in to comment.