diff options
author | Tom Pollard <tom.pollard@codethink.co.uk> | 2018-11-05 13:32:29 +0000 |
---|---|---|
committer | Jürg Billeter <j@bitron.ch> | 2018-11-17 13:07:59 +0000 |
commit | 454dcaf1152b21657702af593c052f7ab90333a1 (patch) | |
tree | 30ed236c0f5b9104bd87b6220272003bb123268f /tests/testutils/artifactshare.py | |
parent | 199bfff16160cd0c7c0fe56af3723656f6148068 (diff) | |
download | buildstream-454dcaf1152b21657702af593c052f7ab90333a1.tar.gz |
Don't pull artifact build trees by default.tpollard/494
The addition of cached build trees being included in element
artifacts has led to mostly redundant download overheads when
pulling from a remote artifact server. As such the default behaviour
of pull shouldn't fetch the build tree object if available.
element.py: extend relevant pull logic for specified subdir
consideration and ensure push logic does not lead to partial
artifact pushes. Change assumption that the buildtree can be
extracted if artifact is cached. __cached_buildtree() and
__pull_directories() helpers added.
_artifactcache/: artifactcache.py & cascache.py inclusion of
helper functions for subdir artifact checking & fetching, fetch
logic extended to only pull required artifact directories.
extract & checkout updated to handle full/partial operation.
tests/: addition of integration test pullbuildtrees.py,
buildtrees.py adapted cli options, testutils/artifactshare.py
has_artifact changed to return artifact digest on true condition.
Diffstat (limited to 'tests/testutils/artifactshare.py')
-rw-r--r-- | tests/testutils/artifactshare.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/testutils/artifactshare.py b/tests/testutils/artifactshare.py index 02f76de90..91dcb9bdb 100644 --- a/tests/testutils/artifactshare.py +++ b/tests/testutils/artifactshare.py @@ -114,7 +114,7 @@ class ArtifactShare(): # cache_key (str): The cache key # # Returns: - # (bool): True if the artifact exists in the share, otherwise false. + # (str): artifact digest if the artifact exists in the share, otherwise None. def has_artifact(self, project_name, element_name, cache_key): # NOTE: This should be kept in line with our @@ -134,9 +134,9 @@ class ArtifactShare(): try: tree = self.cas.resolve_ref(artifact_key) - return True + return tree except CASError: - return False + return None # close(): # |