summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2018-02-26 12:33:41 +0000
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2018-02-28 09:17:45 +0000
commitad0369fd1b1255407418d5789e83503f52fcd49b (patch)
tree4baa44fd3b15b9700555efd55ba0951b0580d081
parent78b4259a3ab1105cca166b9ee02f05decf800206 (diff)
downloadbuildstream-ad0369fd1b1255407418d5789e83503f52fcd49b.tar.gz
Store integration tests cache inside the current directory by default
Previously the code would default to a directory in `/tmp`, but this is often unsuitable as the Linux 'tmpfs' filesystem doesn't support extended file attributes and thus cannot store OSTree repositories. See: https://gitlab.com/BuildStream/buildstream/issues/267
-rwxr-xr-xconftest.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/conftest.py b/conftest.py
index 22eaae23b..ad42b70eb 100755
--- a/conftest.py
+++ b/conftest.py
@@ -39,16 +39,16 @@ def integration_cache(request):
# Set the tempdir to the INTEGRATION_CACHE variable, or the
# default if that is not set.
- cache_dir = os.environ.get('INTEGRATION_CACHE', tempfile.gettempdir())
+ if 'INTEGRATION_CACHE' in os.environ:
+ cache_dir = os.path.join(os.environ['INTEGRATION_CACHE'], 'integration-cache')
+ else:
+ cache_dir = os.path.abspath('./integration-cache')
- # We use a separate tempdir to cache sources and artifacts to
- # increase test speed
- cache = os.path.join(cache_dir, 'integration-cache')
- yield cache
+ yield cache_dir
# Clean up the artifacts after each test run - we only want to
# cache sources
try:
- shutil.rmtree(os.path.join(cache, 'artifacts'))
+ shutil.rmtree(os.path.join(cache_dir, 'artifacts'))
except FileNotFoundError:
pass