summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Maat <tristan.maat@codethink.co.uk>2019-01-18 15:26:19 +0000
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2019-01-18 22:47:46 +0000
commitaa3411f94574d4e2937e3b7b559cf336635ab10c (patch)
tree953af00b5f810c293759e08ab9fa819fff6a59e8
parent2233a532b88bbf2f25ea04efe1abf47871bc3aad (diff)
downloadbuildstream-aa3411f94574d4e2937e3b7b559cf336635ab10c.tar.gz
testutils/runcli.py: Allow removing artifacts from arbitrary dirs
`remove_artifact_from_cache` used a hard-coded path to remove artifacts, which wasn't sufficient for integration tests.
-rw-r--r--tests/testutils/runcli.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/testutils/runcli.py b/tests/testutils/runcli.py
index d3f5113a0..7cd81e0a6 100644
--- a/tests/testutils/runcli.py
+++ b/tests/testutils/runcli.py
@@ -245,8 +245,14 @@ class Cli():
def remove_artifact_from_cache(self, project, element_name,
*, cache_dir=None):
+ # Read configuration to figure out where artifacts are stored
if not cache_dir:
- cache_dir = os.path.join(project, 'cache', 'artifacts')
+ default = os.path.join(project, 'cache', 'artifacts')
+
+ if self.config is not None:
+ cache_dir = self.config.get('artifactdir', default)
+ else:
+ cache_dir = default
cache_dir = os.path.join(cache_dir, 'cas', 'refs', 'heads')