Skip to content
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

Merged
merged 3 commits into from Feb 27, 2020
Merged

feat: adding separate bucket based on python version for integration tests. #1828

merged 3 commits into from Feb 27, 2020

Conversation

c2tarun
Copy link
Contributor

@c2tarun c2tarun commented Feb 27, 2020

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:

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

@@ -14,7 +14,22 @@ class PackageIntegBase(TestCase):
@classmethod
def setUpClass(cls):
cls.region_name = os.environ.get("AWS_DEFAULT_REGION")
Copy link
Contributor

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.

Copy link
Contributor Author

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
Copy link
Contributor

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.

Copy link
Contributor Author

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"))
Copy link
Contributor

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.

Copy link
Contributor Author

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"))
Copy link
Contributor

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"))
Copy link
Contributor

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.
Copy link
Contributor

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.

@c2tarun c2tarun merged commit af079d7 into aws:develop Feb 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants