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

fix: Create Layer Cache during building image #823

Merged
merged 4 commits into from
Dec 4, 2018

Conversation

jfuss
Copy link
Contributor

@jfuss jfuss commented Dec 3, 2018

Issue #, if available:
#816

Description of changes:

Checklist:

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

@jfuss jfuss requested a review from sriram-mv December 3, 2018 15:34
for image in samcli_images:
docker_client.images.remove(image.id)

def test_layer_does_not_exist(self):
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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

Choose a reason for hiding this comment

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

👍

Copy link
Contributor

@sriram-mv sriram-mv left a 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"
Copy link
Contributor

Choose a reason for hiding this comment

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

Perfect.

@jfuss jfuss merged commit 26baa67 into aws:develop Dec 4, 2018
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.

2 participants