-
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
fix: Create Layer Cache during building image #823
Conversation
for image in samcli_images: | ||
docker_client.images.remove(image.id) | ||
|
||
def test_layer_does_not_exist(self): |
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.
So this test, ensures a cache is created for a non existent layer? Its not very explicit what it does.
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.
No. This is just moving existing tests that do not create the cache directory. These tests do not download or build an image and therefore the layer_cache_dir
is not created. The class these were previously under, removed the layer_cache after every tests. Instead of making the tests ignore the delete errors (OSError when the cache does not exist), I moved this to a new class. That way we ensure we always have a clean cache and reduce the risk of a failure to one test not impacting another.
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.
Ok got it, thanks for the explanation. Just trying to capture this information somewhere.
str | ||
Path to the Layer Cache | ||
""" | ||
self._create_cache(self._layer_cache) |
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.
👍
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.
Thanks for the explanation, Approved the PR 👍
@@ -12,6 +13,10 @@ | |||
from tests.integration.local.invoke.layer_utils import LayerUtils | |||
from .invoke_integ_base import InvokeIntegBase | |||
|
|||
# Layers tests require credentials and Travis will only add credentials to the env if the PR is from the same repo. | |||
# This is to restrict layers tests to run outside of Travis and when the branch is not master. | |||
SKIP_LAYERS_TESTS = os.environ.get("TRAVIS", False) and os.environ.get("TRAVIS_BRANCH", "master") != "master" |
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.
Perfect.
Issue #, if available:
#816
Description of changes:
Checklist:
make pr
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.