summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaoul Hidalgo Charman <raoul.hidalgocharman@codethink.co.uk>2019-04-05 11:09:01 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-05-15 10:18:26 +0000
commitf2583c2aea2a29d88a00c1f791b2a64c8d925ed7 (patch)
treeacf2caa06ae34e76f14765c40263976779fe98af
parent1d3f336641c08f1b047ac5d20c3577b94fc57a18 (diff)
downloadbuildstream-f2583c2aea2a29d88a00c1f791b2a64c8d925ed7.tar.gz
artifactcache tests: change artifactcache variables
A few variables were naming artifactcache variables cas, which was confusing. Changed this and comments to clarify this.
-rw-r--r--tests/artifactcache/pull.py26
-rw-r--r--tests/artifactcache/push.py28
2 files changed, 27 insertions, 27 deletions
diff --git a/tests/artifactcache/pull.py b/tests/artifactcache/pull.py
index 96fdef812..40fed7637 100644
--- a/tests/artifactcache/pull.py
+++ b/tests/artifactcache/pull.py
@@ -140,18 +140,18 @@ def _test_pull(user_config_file, project_dir, cache_dir,
project = Project(project_dir, context)
project.ensure_fully_loaded()
- # Create a local CAS cache handle
- cas = context.artifactcache
+ # Create a local artifact cache handle
+ artifactcache = context.artifactcache
# Load the target element
element = project.load_elements([element_name])[0]
# Manually setup the CAS remote
- cas.setup_remotes(use_config=True)
+ artifactcache.setup_remotes(use_config=True)
- if cas.has_push_remotes(plugin=element):
+ if artifactcache.has_push_remotes(plugin=element):
# Push the element's artifact
- if not cas.pull(element, element_key):
+ if not artifactcache.pull(element, element_key):
queue.put("Pull operation failed")
else:
queue.put(None)
@@ -203,7 +203,7 @@ def test_pull_tree(cli, tmpdir, datafiles):
project = Project(project_dir, context)
project.ensure_fully_loaded()
artifactcache = context.artifactcache
- cas = artifactcache.cas
+ cas = context.get_cascache()
# Assert that the element's artifact is cached
element = project.load_elements(['target.bst'])[0]
@@ -278,9 +278,9 @@ def _test_push_tree(user_config_file, project_dir, artifact_digest, queue):
project = Project(project_dir, context)
project.ensure_fully_loaded()
- # Create a local CAS cache handle
+ # Create a local artifact cache and cas handle
artifactcache = context.artifactcache
- cas = artifactcache.cas
+ cas = context.get_cascache()
# Manually setup the CAS remote
artifactcache.setup_remotes(use_config=True)
@@ -313,15 +313,15 @@ def _test_pull_tree(user_config_file, project_dir, artifact_digest, queue):
project = Project(project_dir, context)
project.ensure_fully_loaded()
- # Create a local CAS cache handle
- cas = context.artifactcache
+ # Create a local artifact cache handle
+ artifactcache = context.artifactcache
# Manually setup the CAS remote
- cas.setup_remotes(use_config=True)
+ artifactcache.setup_remotes(use_config=True)
- if cas.has_push_remotes():
+ if artifactcache.has_push_remotes():
# Pull the artifact using the Tree object
- directory_digest = cas.pull_tree(project, artifact_digest)
+ directory_digest = artifactcache.pull_tree(project, artifact_digest)
queue.put((directory_digest.hash, directory_digest.size_bytes))
else:
queue.put("No remote configured")
diff --git a/tests/artifactcache/push.py b/tests/artifactcache/push.py
index 7c117e344..4c1d2cd79 100644
--- a/tests/artifactcache/push.py
+++ b/tests/artifactcache/push.py
@@ -112,19 +112,19 @@ def _test_push(user_config_file, project_dir, element_name, element_key, queue):
project = Project(project_dir, context)
project.ensure_fully_loaded()
- # Create a local CAS cache handle
- cas = context.artifactcache
+ # Create a local artifact cache handle
+ artifactcache = context.artifactcache
# Load the target element
element = project.load_elements([element_name])[0]
- # Manually setup the CAS remote
- cas.setup_remotes(use_config=True)
- cas.initialize_remotes()
+ # Manually setup the CAS remotes
+ artifactcache.setup_remotes(use_config=True)
+ artifactcache.initialize_remotes()
- if cas.has_push_remotes(plugin=element):
+ if artifactcache.has_push_remotes(plugin=element):
# Push the element's artifact
- if not cas.push(element, [element_key]):
+ if not artifactcache.push(element, [element_key]):
queue.put("Push operation failed")
else:
queue.put(None)
@@ -189,21 +189,21 @@ def _test_push_message(user_config_file, project_dir, queue):
project = Project(project_dir, context)
project.ensure_fully_loaded()
- # Create a local CAS cache handle
- cas = context.artifactcache
+ # Create a local artifact cache handle
+ artifactcache = context.artifactcache
- # Manually setup the CAS remote
- cas.setup_remotes(use_config=True)
- cas.initialize_remotes()
+ # Manually setup the artifact remote
+ artifactcache.setup_remotes(use_config=True)
+ artifactcache.initialize_remotes()
- if cas.has_push_remotes():
+ if artifactcache.has_push_remotes():
# Create an example message object
command = remote_execution_pb2.Command(arguments=['/usr/bin/gcc', '--help'],
working_directory='/buildstream-build',
output_directories=['/buildstream-install'])
# Push the message object
- command_digest = cas.push_message(project, command)
+ command_digest = artifactcache.push_message(project, command)
queue.put((command_digest.hash, command_digest.size_bytes))
else: