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:45:40 UTC

[buildstream] 02/13: testing/runcli.py: Fix remove_artifact_from_cache() to work with subdirs.

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

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

commit 504d6da6650c92ab88e0dc814ed9dbf83df49c89
Author: Tristan Van Berkom <tr...@codethink.co.uk>
AuthorDate: Mon May 6 19:15:52 2019 +0900

    testing/runcli.py: Fix remove_artifact_from_cache() to work with subdirs.
    
    The artifact directories are based on the element normal_name, which
    substitutes any path separators with dashes.
    
    Fix the helper function to use the correct path.
---
 buildstream/testing/runcli.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/buildstream/testing/runcli.py b/buildstream/testing/runcli.py
index 72bdce0..934c312 100644
--- a/buildstream/testing/runcli.py
+++ b/buildstream/testing/runcli.py
@@ -637,8 +637,8 @@ class TestArtifact():
     def remove_artifact_from_cache(self, cache_dir, element_name):
 
         cache_dir = os.path.join(cache_dir, 'cas', 'refs', 'heads')
-
-        cache_dir = os.path.splitext(os.path.join(cache_dir, 'test', element_name))[0]
+        normal_name = element_name.replace(os.sep, '-')
+        cache_dir = os.path.splitext(os.path.join(cache_dir, 'test', normal_name))[0]
         shutil.rmtree(cache_dir)
 
     # is_cached():