Skip to content

Use non-default formatted access key ID for tests #8204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

viren-nadkarni
Copy link
Member

@viren-nadkarni viren-nadkarni commented Apr 26, 2023

Summary

This PR makes use of formatted access key IDs for tests that resolve to 000000000001 (for primary account) and 000000000002 (for secondary account). The primary account is used for all tests (via the aws_client fixture) whereas the latter is used for cross-account testing (via secondary_aws_client). This PR also changes to a non-default test region to make sure multi-region works correctly.

In effect, this assures that all services in LocalStack now can work with any arbitrary account ID, and furthermore that service integrations also use the correct account ID. Prior to this PR the fallback account ID 000000000000 and default region us-east-1 was used across LocalStack. For example, when using a service integration with a non-fallback account ID, the called service would still use the fallback account ID.

Related

Supersedes: #7040

Closes: #7041

@viren-nadkarni viren-nadkarni self-assigned this Apr 26, 2023
@viren-nadkarni viren-nadkarni force-pushed the formatted-access-key-id-for-tests branch 3 times, most recently from 083f912 to 0bf5d93 Compare April 27, 2023 14:17
@viren-nadkarni viren-nadkarni added the semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases label Apr 27, 2023
@viren-nadkarni viren-nadkarni force-pushed the formatted-access-key-id-for-tests branch from 0bf5d93 to c4449e5 Compare April 28, 2023 12:40
@viren-nadkarni viren-nadkarni force-pushed the formatted-access-key-id-for-tests branch 3 times, most recently from a554e1b to 62a829f Compare June 22, 2023 07:50
@viren-nadkarni viren-nadkarni force-pushed the formatted-access-key-id-for-tests branch from 62a829f to ef98a30 Compare July 6, 2023 07:32
@viren-nadkarni viren-nadkarni added this to the 3.0 milestone Jul 12, 2023
@viren-nadkarni viren-nadkarni force-pushed the formatted-access-key-id-for-tests branch from ef98a30 to 832502e Compare July 15, 2023 13:42
@viren-nadkarni viren-nadkarni force-pushed the formatted-access-key-id-for-tests branch 2 times, most recently from 3b74fa2 to 9b1350a Compare August 1, 2023 12:38
@viren-nadkarni viren-nadkarni force-pushed the formatted-access-key-id-for-tests branch 6 times, most recently from 5f43208 to d6fa923 Compare August 10, 2023 05:50
@viren-nadkarni viren-nadkarni force-pushed the formatted-access-key-id-for-tests branch from d6fa923 to 148d4fd Compare August 10, 2023 10:53
@viren-nadkarni viren-nadkarni changed the title Use formatted access key ID for tests Use non-default formatted access key ID for tests Aug 10, 2023
@viren-nadkarni viren-nadkarni force-pushed the formatted-access-key-id-for-tests branch 3 times, most recently from 819a00e to a3786df Compare August 11, 2023 10:47
@viren-nadkarni viren-nadkarni force-pushed the formatted-access-key-id-for-tests branch from a3786df to 0abd949 Compare August 16, 2023 11:01
@viren-nadkarni viren-nadkarni force-pushed the formatted-access-key-id-for-tests branch 11 times, most recently from eb815a5 to 7fccaa6 Compare February 5, 2024 12:59
os.environ["AWS_SECRET_ACCESS_KEY"] = constants.INTERNAL_AWS_SECRET_ACCESS_KEY
session = boto3.Session()
credentials = session.get_credentials()
assert credentials
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Boto credentials must be explicit and determined from the request context

@@ -8,9 +8,6 @@
# constant to represent the "local" region, i.e., local machine
REGION_LOCAL = "local"

# dev environment
ENV_DEV = "dev"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dead code

@viren-nadkarni viren-nadkarni force-pushed the formatted-access-key-id-for-tests branch from 7fccaa6 to 41ae35b Compare February 5, 2024 14:01
@viren-nadkarni viren-nadkarni force-pushed the formatted-access-key-id-for-tests branch 3 times, most recently from 79b6693 to 85f36ec Compare February 6, 2024 10:57
@macnev2013 macnev2013 mentioned this pull request Feb 6, 2024
2 tasks
@viren-nadkarni viren-nadkarni force-pushed the formatted-access-key-id-for-tests branch 2 times, most recently from d293f5e to 78f7520 Compare February 13, 2024 09:51
@viren-nadkarni viren-nadkarni force-pushed the formatted-access-key-id-for-tests branch 3 times, most recently from 1b8a96a to ea9cbb0 Compare February 19, 2024 08:02
@coveralls
Copy link

coveralls commented Feb 19, 2024

Coverage Status

coverage: 83.818% (+0.01%) from 83.805%
when pulling d2af625 on formatted-access-key-id-for-tests
into db65a08 on master.

@viren-nadkarni viren-nadkarni force-pushed the formatted-access-key-id-for-tests branch from ea9cbb0 to d2af625 Compare March 1, 2024 08:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multi-Account only working in a limited capacity
3 participants