awslabs / aws-saas-boost

AWS SaaS Boost is a ready-to-use toolset that removes the complexity of successfully running SaaS workloads in the AWS cloud.
Apache License 2.0
954 stars 188 forks source link

Fix failing test when AWS credentials are configured in the environment. #507

Closed PoeppingT closed 1 year ago

PoeppingT commented 1 year ago

The RefreshingProfileDefaultCredentialsProviderTest is meant to verify the functionality of the RefreshingProfileDefaultCredentialsProvider, which replaces the default ProfileCredentialsProvider when the profile is refreshing, such as when using AWS Cloud9. This test attempts to alter user system settings to force the AWS SDK to use the configured RefreshingProfileDefaultCredentialsProvider to verify functionality, but has never worked if credentials were configured in the environment, since Environment variables cannot be altered at runtime.

This commit simply skips these tests if environment variables are configured at runtime. If a user is running the installer (and therefore this test) with credentials configured as environment variables then the RefreshingProfileDefaultCredentialsProvider won't be used anyway. Any future alterations to the credentials provider or this test MUST produce a passing test before being accepted for contribution.

Fixes #506


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license