You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by no...@apache.org on 2020/12/29 12:25:14 UTC

[buildstream] 04/13: artifactcache tests: change artifactcache variables

This is an automated email from the ASF dual-hosted git repository.

not-in-ldap pushed a commit to branch tpollard/prototemp
in repository https://gitbox.apache.org/repos/asf/buildstream.git

commit 23784d07c44671e99ea999e7412e5c033fe5bac7
Author: Raoul Hidalgo Charman <ra...@codethink.co.uk>
AuthorDate: Fri Apr 5 11:09:01 2019 +0100

    artifactcache tests: change artifactcache variables
    
    A few variables were naming artifactcache variables cas, which was
    confusing. Changed this and comments to clarify this.
---
 tests/artifactcache/pull.py | 26 +++++++++++++-------------
 tests/artifactcache/push.py | 28 ++++++++++++++--------------
 2 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/tests/artifactcache/pull.py b/tests/artifactcache/pull.py
index 96fdef8..40fed76 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 7c117e3..4c1d2cd 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: