diff options
author | Tristan Maat <tristan.maat@codethink.co.uk> | 2019-01-18 15:26:19 +0000 |
---|---|---|
committer | Tristan Maat <tristan.maat@codethink.co.uk> | 2019-01-18 17:18:56 +0000 |
commit | d93cddcfedffa2f7ca09bd0364e4778263cd46de (patch) | |
tree | 4e81c6a25067efb9bfdcb2d21403bca1c2b73463 | |
parent | 4236bcc7a2a1f13fd64a4262bee25c3e0e2b0d5a (diff) | |
download | buildstream-d93cddcfedffa2f7ca09bd0364e4778263cd46de.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.py | 8 |
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') |