-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: adding separate bucket based on python version for integration tests. #1828
Conversation
@@ -14,7 +14,22 @@ class PackageIntegBase(TestCase): | |||
@classmethod | |||
def setUpClass(cls): | |||
cls.region_name = os.environ.get("AWS_DEFAULT_REGION") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be below doc strings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually doc string is only for the line where we are reading AWS_S3
and not for the whole method. That is why I didn't move this below docstring. Thoughts?
|
||
For Python36: | ||
AWS_S3=AWS_S3_36 | ||
AWS_S3_36=aws-sam-cli-canary-region-awssamclitestbucket-forpython36 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do no document bucket names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a real bucket name. Something I made up based on how real name looks like.
|
||
For backwards compatibility we are falling back to reading AWS_S3 so that current tests keep working. | ||
""" | ||
cls.pre_created_bucket = os.environ.get(os.environ.get("AWS_S3", False), os.environ.get("AWS_S3")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Break this line up, I am having a hard time following the nested calls here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -16,7 +16,8 @@ class PublishAppIntegBase(TestCase): | |||
@classmethod | |||
def setUpClass(cls): | |||
cls.region_name = os.environ.get("AWS_DEFAULT_REGION") | |||
cls.pre_created_bucket = os.environ.get("AWS_S3", False) | |||
"""Please read comments in package_integ_base.py for more details around this.""" | |||
cls.pre_created_bucket = os.environ.get(os.environ.get("AWS_S3", False), os.environ.get("AWS_S3")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
@@ -17,7 +17,8 @@ class PackageRegressionBase(TestCase): | |||
@classmethod | |||
def setUpClass(cls): | |||
cls.region_name = os.environ.get("AWS_DEFAULT_REGION") | |||
cls.pre_created_bucket = os.environ.get("AWS_S3", False) | |||
"""Please read comments in package_integ_base.py for more details around this.""" | |||
cls.pre_created_bucket = os.environ.get(os.environ.get("AWS_S3", False), os.environ.get("AWS_S3")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
""" | ||
cls.pre_created_bucket = os.environ.get( | ||
os.environ.get("AWS_S3", False), # Reading env var key for specific bucket. | ||
os.environ.get("AWS_S3"), # Fallback to old logic if separate env key not present. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not the same fallback. The previous fallback had a value of False.
Issue #, if available:
Why is this change necessary?
Our integration tests use S3 bucket to run several tests. Given that S3 objects are eventually consistent and we are using same bucket for lot of integration tests, we want to have multiple buckets to reduce transient failures. This change will allow referring correct bucket based on the python version for which test is running.
How does it address the issue?
This spreads total number of objects across several buckets and improving sync time to reduce time it takes by S3 to be consistent.
What side effects does this change have?
NA
Checklist:
make pr
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.